Skip to content

Use SwaggerUI 3.25.0: better compatibility with OpenAPI 3.0.x#29

Merged
djones6 merged 2 commits intoKitura:masterfrom
mbarnach:SwaggerUI-3.25.0
Mar 5, 2020
Merged

Use SwaggerUI 3.25.0: better compatibility with OpenAPI 3.0.x#29
djones6 merged 2 commits intoKitura:masterfrom
mbarnach:SwaggerUI-3.25.0

Conversation

@mbarnach
Copy link
Copy Markdown
Member

When trying new features of OpenAPI, I've realized some JSON could be valid and supported by the editor at https://editor.swagger.io/ but not by Kitura-OpenAPI UI. This is due to some issues/bug in the version 3.18 and/or higher.
I've update some files in SwaggerUI (not sure if this all needed or not) and it fixes the issue.
The new page keeps the Kitura logo instead of the SwaggerUI logo (as before).

window.onload = function() {
// Build a system
const ui = SwaggerUIBundle({
url: "/doc",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because there is a swagger serving endpoint URL hard-coded into this file, we instead templated it (see https://github.com/IBM-Swift/Kitura-OpenAPI/blob/master/swaggerui/template.html), and Kitura-OpenAPI will write an index.html file with the appropriate link: https://github.com/IBM-Swift/Kitura-OpenAPI/blob/f8cffe163cc75de00cb187c6df06afcb5ed26508/Sources/KituraOpenAPI/KituraOpenAPI.swift#L141.

If the new UI requires updates to the index.html, make them to template.html instead (keeping the placeholder)

@djones6
Copy link
Copy Markdown
Contributor

djones6 commented Mar 4, 2020

@mbarnach Other than the comment above about the templating of the index.html, this looks good to me.

@mbarnach
Copy link
Copy Markdown
Member Author

mbarnach commented Mar 5, 2020

I've removed the index.html file. No changes were needed I think in template.html.

@djones6 djones6 merged commit 7761bdf into Kitura:master Mar 5, 2020
@djones6
Copy link
Copy Markdown
Contributor

djones6 commented Mar 5, 2020

This is now tagged in Kitura-OpenAPI 1.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants