[NETCONF-1042] OpenAPI: Missing validation badge Created: 26/May/23  Updated: 31/May/23  Resolved: 31/May/23

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

Type: Bug Priority: Medium
Reporter: Ivan Hrasko Assignee: Oleksandr Zharov
Resolution: Won't Do Votes: 0
Labels: pt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File static-ip-schema.png     PNG File validator.png    

 Description   

We are missing validation badge. The most probable reason for this are our changes in swagger-initializer.js. Maybe our change of:

  window.ui = SwaggerUIBundle({
    url: "https://petstore.swagger.io/v2/swagger.json", 

So now validation logic has no info which URL to validate. We need to set it after each selection of source (controller/device).

As shown on the picture, validation is working when we revert back to original swagger UI:



 Comments   
Comment by Oleksandr Zharov [ 30/May/23 ]

 

So essentially - validation will work if link is accessible by validator. That's why it absent on localhost and works on cluster. It has nothing to do with our UI modifications of swagger. I also did experiment and added petstore.json link to our UI and it showed valid badge on localhost.

Also if we are using static IP (clustering for example) - it also trying validate schema:

All this information is described also here: https://github.com/swagger-api/validator-badge

 

From that point I see two possible ways for this task:
1. Close it. This is intentional behavior and not a bug - validation works just not for localhost.
2. In case we need validator to work on localhost: Expand task or close it and create new one with purpose of installing validator locally and documenting how to work with it.

Comment by Ivan Hrasko [ 31/May/23 ]

No issue. Closed.

Comment by Ivan Hrasko [ 31/May/23 ]

In the future, maybe, we can use https://validator.swagger.io/#/Validator/validateByContent to get badge by uploading the whole JSON definition.

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