[CONTROLLER-596] Swagger UI is failing to load Created: 03/Jul/14 Updated: 07/Jul/14 Resolved: 07/Jul/14 |
|
| Status: | Resolved |
| Project: | controller |
| Component/s: | restconf |
| Affects Version/s: | Helium |
| Fix Version/s: | None |
| Type: | Bug | ||
| Reporter: | Devin Avery | Assignee: | Devin Avery |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: Mac OS |
||
| External issue ID: | 1290 |
| Description |
|
The swagger UI is no longer rendering any of the possible end points and if you look at the browser developer tools you see an exception getting thrown from the browser java script. |
| Comments |
| Comment by Devin Avery [ 03/Jul/14 ] |
|
The cause: I found the cause of this problem. The backend swagger documentation code that generated the JSON model for the yang file made the assumption that you can have two "types" for a property. However swagger is choking on that. It appears that in swagger we were generating a list of types for the "Unions" that were defined in yang. We didn't actually have any unions in exposed models until The Fix: For union types, instead of passing back an array of types, we just append the multiples types together into a string with 'or'. So: leaf port-number { } becomes "integer or string" instead of " { 'integer', 'string' }". Swagger will now display that without any problem. |
| Comment by Devin Avery [ 03/Jul/14 ] |