Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Mar 5, 2020

Conversation

mbarnach
Copy link
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
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
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
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
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