[YANGTOOLS-505] malformed union type not caught at compile time Created: 15/Sep/15 Updated: 10/Apr/22 Resolved: 18/Dec/15 |
|
| Status: | Resolved |
| Project: | yangtools |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | ||
| Reporter: | Jan Medved | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: All |
||
| Issue Links: |
|
||||||||
| External issue ID: | 4310 | ||||||||
| Description |
|
I (mis)defined a union as this (missing 'type' keywords inside the union): leaf datapath-id { The parser did not complain, but at run time i got the following exception: 2015-09-14 19:41:54,787 | WARN | bundle-tracker-0 | YangParserImpl | 79 - org.opendaylight.yangtools.yang-parser-impl - 0.8.0.SNAPSHOT | Error in module of-l3-topology at line 89: Failed to resolve node urn:ietf:params:xml:ns:yang:ietf-yang-types:hex-string : no such extension definition found. The parser should catch this syntax error. |
| Comments |
| Comment by Martin Ciglan [ 16/Sep/15 ] |
|
Hi Jan Basically, both (mis)defined statements were recognized as unknown ones. If we want parser to recognize this type of input error, we would need to implement extra functionality to check all TYPE statements afterwards and inform user accordingly. |
| Comment by Robert Varga [ 10/Nov/15 ] |
|
The parser should be reacting rather strongly to such a yang file now – is this still reproducible (e.g. silent failure)? |
| Comment by Jan Medved [ 10/Nov/15 ] |
|
It is a silent failure in the sense that it gets detected at run time, not at compile time. Compilation finished just fine. |
| Comment by Filip Gregor [ 01/Dec/15 ] |
|
This issue is resolved in current yangtools code base, please retry |
| Comment by Filip Gregor [ 02/Dec/15 ] |
|
latest related patch: https://git.opendaylight.org/gerrit/#/c/30202/ |