[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: |
|
| 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: |
| 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. |