[YANGTOOLS-246] NPE in yangtools when parsing yang file Created: 03/Aug/14 Updated: 10/Apr/22 Resolved: 18/Mar/15 |
|
| Status: | Resolved |
| Project: | yangtools |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | ||
| Reporter: | Ed Warnicke | Assignee: | Unassigned |
| Resolution: | Cannot Reproduce | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: Mac OS |
||
| Attachments: |
|
| Description |
|
Here is the exeception: [ERROR] yang-to-sources: Unable to parse yang files from /Users/hagbard/try/controller/opendaylight/md-sal/model/model-flow-base/src/main/yang |
| Comments |
| Comment by Ed Warnicke [ 03/Aug/14 ] |
|
Attachment opendaylight-match-types.yang has been added with description: Yang file that produced the exception |
| Comment by Ed Warnicke [ 03/Aug/14 ] |
|
Looking through the tests I'm going to go out on a limb and say this is because of the fact the union contains an identityref (I don't see tests for that). |
| Comment by Ed Warnicke [ 03/Aug/14 ] |
|
Fix for NPEs is here https://git.opendaylight.org/gerrit/9630 But we still are not generating Union Types correctly for the examples: identity vlan-id-special-types { description "Base type for indicating special vlans like ANY or NONE"; }identity vlan-id-none { description "No vlan header present"; base vlan-id-special-types; }identity vlan-id-any { description "Vlan header present with any vlan-id"; base vlan-id-special-types; } grouping vlan-id-attributes { leaf vlan-id { type l2t:vlan-id; The resulting class has a constructor for but not org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.VlanIdSpecialTypes There is a similar problem with (from controller/opendaylight/md-sal/model/model-flow-base/src/main/yang/opendaylight-port-types.yang): leaf port-number { } The generated PortNumber has a generator for Long, but not String. |
| Comment by Ladislav Borak [ 04/Aug/14 ] |
|
Attachment test_and_gen.zip has been added with description: Test and generated files |
| Comment by Ladislav Borak [ 04/Aug/14 ] |
|
I tested generation classes from yang files included as attachment and all constructors were generated correctly. I used for generation your patch https://git.opendaylight.org/gerrit/9630. |