[MDSAL-313] Differentiate between declared (XSD) and enforcement (java.util.regex) patterns Created: 26/Feb/18 Updated: 11/Mar/18 Resolved: 11/Mar/18 |
|
| Status: | Resolved |
| Project: | mdsal |
| Component/s: | Binding codegen, Binding V2 codegen |
| Affects Version/s: | None |
| Fix Version/s: | Fluorine |
| Type: | Improvement | Priority: | Medium |
| Reporter: | Robert Varga | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Description |
|
The strings we are using for IllegalArgumentExceptions in generated code are Java Pattern regexes and are an implementation detail of how enforcement is done. End users should not be exposed to this detail. yang-model-api is exposing both Java Pattern and XSD regex as declared in the model, hence codegen can capture the XSD regex and report that, leading to proper isolation between API contract (enforce the XSD regex (non-) match) and implementation (checking using Pattern). |
| Comments |
| Comment by Robert Varga [ 26/Feb/18 ] |
|
This will require communicating not only a Pattern, but also XSD String down to codegen from BindingGeneratorImpl. Since we are in the area, this issue should also fix binding's failure to take into account invert-match flag. |
| Comment by Robert Varga [ 01/Mar/18 ] |