-
Notifications
You must be signed in to change notification settings - Fork 109
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
Regression: Redocusaurus can no longer load OpenAPI/Swagger 2.0 definitions #106
Comments
Might be related to Redocly/redoc#1724 Does your spec define a top level field |
Yes it does.
Mark
On Nov 30, 2021, at 8:11 PM, Rohit Gohri ***@***.***> wrote:
Might be related to Redocly/redoc#1724
Does your spec define a top level field swagger: "2.0"?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
It is not - in that issue, the reporter had an invalid spec (version specified as an integer instead of a string). I tested and verified that redoc-cli can properly load Swagger 2.0 files. However, it does report that it converts the file to 3.0 first:
which I've tracked down to the loadAndBundleSpec utility function in redoc. It seems like redocusaurus might be initiating redoc in a way that bypasses that conversion. I see the same error when specifying a swagger 2.0 file in JSON format using the |
@joshuaflanagan Thanks for tracking it down! It seems they are using this function in StoreBuilder : https://github.com/Redocly/redoc/blob/6c7685e5fa04314328a445d7077600692c49489c/src/components/StoreBuilder.ts If we switch to using StoreBuilder too for creating the AppStore here:
Then this will solve both this and #80 I think. |
I have released a beta for v1 where this is fixed: #146 It has some breaking changes (mostly simplification of option names). New docs are at https://redocusaurus-v1.vercel.app/docs It will be great if you could try it and give some feedback. |
I am trying to test it, but am running into errors. However, it is difficult to tell the source, since I am also attempting to update my version of docusaurus at the same time. If you tell me the exact version of docusaurus that you are testing on and expect to support, I can use the same. They have been releasing a lot of betas recently which can add to the confusion. |
To be clear, in my package.json I have:
My attempt at running
This appears to be referring to the spec definition in the redocusaurus config of My
When I delete the
I don't specify |
Thanks for testing it out. Regarding beta, And you are on the correct version of redocusaurus but my build was wrong. I just released a new version (from the latest commit) : Verified the dist files on unpkg and tested it on a fresh project. It should be working now |
Thanks - that fixed it, I was able to get a successful build! I'll do more thorough testing tomorrow. |
This build is working for me and resolves this issue. |
Awesome! Thanks for testing it out. There are some minor styling changes compared to v0 (see percy diff). I know the fix for most of those, so I'll release stable v1 once they are fixed. |
Version 0.4.6 successfully loads and displays OpenAPI/Swagger v2.0 documents, but upgrading to v0.5 now returns an error:
Reverted to 0.4.6 and it works again.
The text was updated successfully, but these errors were encountered: