Giter Site home page Giter Site logo

Comments (11)

joshuaflanagan avatar joshuaflanagan commented on July 28, 2024 1

Thanks - that fixed it, I was able to get a successful build! I'll do more thorough testing tomorrow.

from redocusaurus.

joshuaflanagan avatar joshuaflanagan commented on July 28, 2024 1

This build is working for me and resolves this issue.

from redocusaurus.

rohit-gohri avatar rohit-gohri commented on July 28, 2024

Might be related to Redocly/redoc#1724

Does your spec define a top level field swagger: "2.0"?

from redocusaurus.

markcarroll avatar markcarroll commented on July 28, 2024

from redocusaurus.

joshuaflanagan avatar joshuaflanagan commented on July 28, 2024

Might be related to Redocly/redoc#1724

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:

[ReDoc Compatibility mode]: Converting OpenAPI 2.0 to OpenAPI 3.0

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 spec option.

from redocusaurus.

rohit-gohri avatar rohit-gohri commented on July 28, 2024

@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:

const store = useMemo(() => {
if (!spec) return null;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
return new AppStore(spec as any, specUrl, {
...redocOptions,
theme,
});
}, [spec, specUrl, redocOptions, theme]);

Then this will solve both this and #80 I think.

from redocusaurus.

rohit-gohri avatar rohit-gohri commented on July 28, 2024

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.

from redocusaurus.

joshuaflanagan avatar joshuaflanagan commented on July 28, 2024

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.

from redocusaurus.

joshuaflanagan avatar joshuaflanagan commented on July 28, 2024

To be clear, in my package.json I have:

  "@docusaurus/core": "^2.0.0-beta.17",
  "redocusaurus": "0.0.0-beta-20220314034003",

My attempt at running docusaurus build results in:

[INFO] [en] Creating an optimized production build...
[ERROR] Unable to build website for locale en.
[ERROR] ValidationError: "layout" is not allowed

This appears to be referring to the spec definition in the redocusaurus config of docusaurus.config.js.

My specs config looks like:

  [{
    routePath: 'myservice/api',
    spec: 'myservice/api.yaml',
    layout: { title: 'Service API' }
  }]

When I delete the layout config line, I now get:

[INFO] [en] Creating an optimized production build...
[ERROR] Unable to build website for locale en.
[ERROR] ValidationError: "debug" is not allowed

I don't specify debug anywhere. I also noticed that if I change routePath to route (which the docs suggest) I get [ERROR] ValidationError: "route" is not allowed.

from redocusaurus.

rohit-gohri avatar rohit-gohri commented on July 28, 2024

Thanks for testing it out. Regarding beta, beta.17 is what is supported and what I'm using too.

And you are on the correct version of redocusaurus but my build was wrong. I just released a new version (from the latest commit) : 1.0.0-beta-20220315043813.

Verified the dist files on unpkg and tested it on a fresh project. It should be working now

from redocusaurus.

rohit-gohri avatar rohit-gohri commented on July 28, 2024

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.

from redocusaurus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.