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

[plugin-api-docs] Support OpenAPI 3.1 #8090

Closed
johanneswuerbach opened this issue Nov 17, 2021 · 18 comments · Fixed by #18223
Closed

[plugin-api-docs] Support OpenAPI 3.1 #8090

johanneswuerbach opened this issue Nov 17, 2021 · 18 comments · Fixed by #18223
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Help/Contributions wanted from community members

Comments

@johanneswuerbach
Copy link
Contributor

johanneswuerbach commented Nov 17, 2021

Feature Suggestion

Support rendering openapi: 3.1.x API definitions in Backstage. OpenAPI 3.1.0 was released as stable in the beginning of the year.

Possible Implementation

This likely depends on swagger-ui supporting OpenAPI 3.1, which it doesn't yet swagger-api/swagger-ui#5891, but it might be a good preparation to update to swagger-ui v4 already as only v4 will get OpenAPI 3.1 support.

Context

Current backstage view when looking at an OpenAPI 3.1 schema:

image

@johanneswuerbach johanneswuerbach added the enhancement New feature or request label Nov 17, 2021
@freben
Copy link
Member

freben commented Nov 24, 2021

Makes sense! Is this something you might be able to work on?

@freben
Copy link
Member

freben commented Nov 24, 2021

I see that we depend on "swagger-ui-react": "^4.0.0-rc.3" in the API plugin. Latest version of that as of this time is 4.1.0.

@Rugvip Rugvip added help wanted Help/Contributions wanted from community members good first issue Good for newcomers labels Nov 25, 2021
@Rugvip
Copy link
Member

Rugvip commented Nov 29, 2021

Yep, would make sense to update to the latest stable release, regardless of whether we get support for 3.1. Opening that up to contributions in case anyone wants to beat us to it 😁

@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added stale and removed stale labels Jul 14, 2022
@floriank
Copy link

floriank commented Aug 25, 2022

So,

Hey - since it'd be rather important to me (and the company) to get some movement on the OAS 3.1 front going, I've spent some time looking into this. The news is a bit bleak though:

  1. Backstage depends on swagger-ui-react (see here)
  2. swagger-ui-react currently does not support OAS 3.1, hence we get no API explorer for specs using that scheme version
  3. The swagger authors decided to work on a new version of their editor first, which will resolve the issue

This unfortunately means either one of two things:

  1. Sit and wait.
  2. Replace the dependency with something like OpenAPI Explorer. I've no opinion on this package myself (and I am not associated).

Anyway, this issue therefore should probably no be a good first contribution 😉.

Cheers ❤️

@floriank
Copy link

(I also should've realized that @johanneswuerbach mentioned most of this in the original issue description, mea culpa 🤦)

@floriank
Copy link

floriank commented Aug 25, 2022

In an effort to provide a tiny bit more substance, here is a branch where I switched out swagger-ui-react with openapi-explorer.

The result needs styling, obviously, but works rather nice, even with OAS 3.1:

image

Note of course that the spotify example is OAS 3.0.1, to test this out, I switched the OAS for the petstore to a OAS 3.1 version.

@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Oct 24, 2022
@johanneswuerbach
Copy link
Contributor Author

Still relevant 👍

@github-actions github-actions bot removed the stale label Oct 24, 2022
@EduSemensati
Copy link

Is anyone looking into this?

@floriank
Copy link

not actively, as I don't really have time myself. Switching out the OpenAPI Explorer is easy, but I am no CSS magician, so it'd look like 💩.

jetslambda pushed a commit to jetslambda/backstage that referenced this issue Feb 12, 2023
…aggerUI with openapi-explorer

Signed-off-by: Brian McManus <bmcmanus@gmail.com>
jetslambda added a commit to jetslambda/backstage that referenced this issue Feb 12, 2023
…aggerUI with openapi-explorer

Signed-off-by: Brian McManus <bmcmanus@gmail.com>
@jetslambda
Copy link

Personal opinion: Tests in Backstage are intended for React components making openapi-explorer hard to test since it is a 'Lit' component (Google.) I was able to integrate it and make it look good but I was unable to fiddle with it enough to get all tests passing. Swagger.io intends to have OpenAPI3.1 compatibility in swagger-ui this Quarter. I think we should wait a few weeks and implement the upcoming version of swagger-ui.

https://swagger.io/blog/swagger-support-for-openapi-3-0-and-openapi-3-1/


Swagger UI and Swagger Client 
Rendering for OpenAPI 3.1 will soon follow as part of our [Swagger UI](https://github.com/swagger-api/swagger-ui) enhancements. In a nutshell, the ability to process and render OpenAPI 3.1 definitions/documents within Swagger UI will be enabled by the integration of [ApiDOM](https://github.com/swagger-api/apidom) with [Swagger Client](https://github.com/swagger-api/swagger-js). 

We’re expecting to have this completed in Q1 2023 which will bring the rendering capability also into our Swagger Editor tool.

@jetslambda
Copy link

My implementation is here if anyone would like to do something with it:

@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Apr 14, 2023
@freakyfelt
Copy link

nudging to appease the stalebot

@pjungermann
Copy link
Contributor

https://github.com/swagger-api/swagger-ui/labels/version%3A%205.x
and swagger-api/swagger-ui#8684 to watch for beta

@pjungermann
Copy link
Contributor

pjungermann commented Jun 12, 2023

FYI: swagger-ui v5.0.0 was released 2h ago.

@type/swagger-ui-react is still pending.

pjungermann added a commit to Bonial-International-GmbH/backstage that referenced this issue Jun 12, 2023
Bump dependency `swagger-ui-react` to v5.0.0
which includes support for OpenAPI Specification (OAS) v3.1.0.

`@types/swagger-ui-react` v4.18.0 seems still compatible.

Closes: backstage#8090
Signed-off-by: Patrick Jungermann <Patrick.Jungermann@gmail.com>
@pjungermann
Copy link
Contributor

In case you didn't see it yet, the linked PR will resolve this issue. It contains two 3.1.0 examples as well. A release of the type package was not necessary, they are still compatible.

If reviews go through, it should be part of next week's main release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Help/Contributions wanted from community members
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants