[MDSAL-85] Binding Model API: restrictions do not match java type Created: 27/May/15 Updated: 19/Jan/24 |
|
| Status: | Confirmed |
| Project: | mdsal |
| Component/s: | Binding runtime |
| Affects Version/s: | None |
| Fix Version/s: | 14.0.0 |
| Type: | Bug | ||
| Reporter: | Robert Varga | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | pt | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: All |
||
| Issue Links: |
|
||||||||
| External issue ID: | 3399 | ||||||||
| Description |
|
Restrictions returned for a particular ConcreteType should match the underlying type. The parser generates restrictions in whatever the default is, for example 0 for Short is expressed as a Long. This is largely fine in binding-independent world, but makes it unusable if we want to actually use restrictions with objects of that type. BaseYangTypes is a prime offender, as its singleRangeRestrictions() callers do the wrong thing. Furthermore BindingGeneratorUtil needs to translate whatever it sees to the appropriate type. |
| Comments |
| Comment by Robert Varga [ 21/Jun/22 ] |
|
In mdsal-10.0.0 Restrictions are a final class with a few static factory methods, hence we should be able to isolate the contracts further. |
| Comment by Robert Varga [ 21/Jun/22 ] |
|
Most notably MDSAL-736 requires us to also capture fraction-digits in the Restrictions object (or its specialization, really) |