[YANGTOOLS-417] JSON PUT for list item does not work correctly Created: 12/Mar/15 Updated: 10/Apr/22 Resolved: 16/Mar/15 |
|
| Status: | Resolved |
| Project: | yangtools |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | ||
| Reporter: | Keith Burns | Assignee: | Tony Tkacik |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: All |
||
| External issue ID: | 2818 |
| Description |
|
https://gist.github.com/2da83d35b8c8b11c3822 This worked fine Tue 5:30am when I built. Now we are hosed again. It's very very hard not to rant when we change nothing, and either REST doesn't work for 2 days, or when it starts to work again, it breaks something else. We are blocked. |
| Comments |
| Comment by Keith Burns [ 12/Mar/15 ] |
|
The PUT to tenant has worked this way since: commit 304445a4343a67e68fd6111edba6cba8cbaf7ac3 Fixed overwrite of tenant policy. The existing script would overwrite any policy from tenant Change-Id: Ia077b45a883fdd2d11cdd5775c28da6da7fb1a97 |
| Comment by Ed Warnicke [ 12/Mar/15 ] |
|
I have reproduced this error by: cd groupbasedpolicy/ Then using this postman: https://www.getpostman.com/collections/d641d67f578c0abbf3d8 Doing 'Inventory PUT' (which works) followed by 'Policy PUT' (which gives the error Keith saw). |
| Comment by Ed Warnicke [ 12/Mar/15 ] |
|
Note: When I try to use API-docs... API-docs thinks we have the policy model, and even shows the relavent things to GET and PUT... but they are breaking because the schema is missing. |
| Comment by Tony Tkacik [ 12/Mar/15 ] |
|
JSON PUT does not work correctly after fixing POST for list items, this bug has also its variation in https://jenkins.opendaylight.org/releng/view/CSIT-Jobs/job/openflowplugin-csit-1node-imds-flow-services-all-master/14/robot/report/log.html#s1-s4-s2-t3 |
| Comment by Tony Tkacik [ 12/Mar/15 ] |
|
Workaround is to wrap policy:tenant object in array as it is. { }] Seems yang-data-codec-gson does not handle parsing of one list item properly
3.2.4. The "list" Data Node A sequence of one or more sibling XML elements with the same but implemented restconf draft provides examples for lists (which bit changes serialization of list): https://tools.ietf.org/html/draft-bierman-netconf-restconf-02#page-37 Example from biermann PUT /restconf/config/example-jukebox:jukebox/ { } But by referenced YANG-JSON specification it should be ] |
| Comment by Tony Tkacik [ 12/Mar/15 ] |
|
Seems this unclarity between specifications is still present in latest drafts: https://tools.ietf.org/html/draft-ietf-netconf-restconf-04 Where RESTCONF draft showcases reading list item returning }] but PUT showcases } |
| Comment by Tony Tkacik [ 12/Mar/15 ] |
|
YANTools - https://git.opendaylight.org/gerrit/16405 |