[NETCONF-667] Unable to load SwaggerUI when read API from server fails Created: 22/Apr/20  Updated: 10/Nov/20  Resolved: 10/Nov/20

Status: Resolved
Project: netconf
Component/s: restconf-openapi
Affects Version/s: Neon SR1
Fix Version/s: None

Type: Bug Priority: Medium
Reporter: Francesca Vezzosi Assignee: Iaroslav Kholiavko
Resolution: Cannot Reproduce Votes: 0
Labels: pt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File image-2020-10-29-14-01-55-270.png     PNG File javascript-console.png     Text File karaf-error.log    

 Description   

Hi,

I am testing Neon SR1 with a ConfD server and I am facing some issues with the apidoc explorer.

The resource is mounted correctly, but when I try to list the APIs I get an uncaught javascript exception and the operation list for each API is not displayed.
When inspecting the javascript console, it appears that the server returns a "500 Request failed" error for two of the APIs. All the other APIs are retrieved correctly and are visible in the raw response, but clicking on "Show/Hide", "List operations" and "Expand operations" has no effect on any API.



 Comments   
Comment by Iaroslav Kholiavko [ 29/Oct/20 ]

Hi, francesca.vezzosi

According to this, looks like it is expected behavior of apidoc explorer. As it tries  to resolve version of `null` string. If need to resolve default version empty version should be passed.

Also please check the model. Probably problem in incorrect version there. Or problem with YangTools. But I can not check it based on information in this ticket.

 

rovarga, probably we should improve code:
if we pass invalid version behavior should be the same as we do not pass version at all. Please share you thoughts. 

Comment by Francesca Vezzosi [ 29/Oct/20 ]

Hi IaroslavK,

yes, I understand the exception thrown for that specific model. The issue is that even if just one model has no revision, nothing is shown for ANY other model.

In my case, I have two models with no revision (thus throwing the exception), and several other ones with revision for which I would like to be able to visualize the APIs, but the javascript code fails on all of them.

Comment by Iaroslav Kholiavko [ 10/Nov/20 ]

According to the code It will not reproduce on last releases (Aluminium and next). Could not reproduce on Magnesium (but potentially it is possible), as I could not create model with `null` revision. Probably it is problem in YangTools, but not enough information.

Generated at Wed Feb 07 20:15:35 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.