Giter Site home page Giter Site logo

Comments (15)

Anthony-Gaudino avatar Anthony-Gaudino commented on July 28, 2024 1

Hi @rohit-gohri

There's a plugin for ReDoc to do this: https://github.com/wll8/redoc-try

Maybe it will work well and just need some styling.

I'm also interested on this.

from redocusaurus.

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

Not sure what you are talking about, could you add an example?

from redocusaurus.

Yuan1979 avatar Yuan1979 commented on July 28, 2024

Hi, Rohit,

What I mean is like the swagger ui, we have a "Try it out" button.

image

Another question, is it possible to have the openapi.yaml in another folder, i.e. apis to handle multiple openapi files.

Btw, I love what you have done. Great work.

from redocusaurus.

Yuan1979 avatar Yuan1979 commented on July 28, 2024

Another issue, when i change the routePath to something other than api, i.e./api/petstore, i got another issue:

Error: end of the stream or a document separator is expected in "http://localhost:3000/api/openapi.yaml" at line 35, column 47:
at BaseResolver.parseDocument (webpack-internal:///./node_modules/@redocly/openapi-core/lib/resolve.js:122:19)
at eval (webpack-internal:///./node_modules/@redocly/openapi-core/lib/resolve.js:133:29)

from redocusaurus.

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

Hi, Rohit,

What I mean is like the swagger ui, we have a "Try it out" button.

So this plugin is a wrapper around https://github.com/redocly/redoc to make it easy to use with docusaurus, so a feature like that will be out of scope for the purpose of this plugin.

They already have an open issue for this: Redocly/redoc#53

from redocusaurus.

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

Another question, is it possible to have the openapi.yaml in another folder, i.e. apis to handle multiple openapi files.

Not sure what you mean. Some thing like #23 ?

Btw, I love what you have done. Great work.

Thanks! :D

from redocusaurus.

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

Closing this, since the original request is out of scope for this project. Hopefully redoc will implement it.

Please open a new issue for any other issues

from redocusaurus.

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

@Anthony-Gaudino Styling wll8/redoc-try to also support docusaurus themes is going to be a lot of work. I think a better alternative is to use code examples (curl is one) instead that make it easy to try the API in your local, and they are already supported by redoc.

from redocusaurus.

Songkeys avatar Songkeys commented on July 28, 2024

@rohit-gohri

I think a better alternative is to use code examples

Could you please instruct me to enable the code examples? I tried what the doc says but not working:

        theme: {
          options:
            {
              // https://redocly.com/docs/api-reference-docs/configuration/functionality/
              generateCodeSamples: {
                languages: [
                  { lang: "curl" },
                  { lang: "Node.js" },
                  { lang: "JavaScript", label: "JS" },
                ],
              },
            },
        },

Thank you in advance.

from redocusaurus.

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

Hey @Songkeys, that feature is part of redocly's paid offerings. From their docs (https://redocly.com/docs/api-reference-docs/guides/generate-code-samples/) :

warning

Auto-generated code samples are not available in Redoc (the "community edition").

from redocusaurus.

Songkeys avatar Songkeys commented on July 28, 2024

@rohit-drone
Oh. Btw, is redocusaurus compatible with the paid service? (I see I need to configure a licenseKey to enable this?) If so, I will a deep look at their paid service.

from redocusaurus.

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

I'm not sure, haven't used it. We use the official package behind the scenes: https://github.com/Redocly/redoc/
If that can be configured with licenseKey then so should redocusaurus

Btw, they also have a "Try it API console": https://redocly.com/docs/api-reference-docs/guides/try-it-console/

from redocusaurus.

Songkeys avatar Songkeys commented on July 28, 2024

I'll take a look. Thank you so much for this info and this amazing project!

from redocusaurus.

uSkizzik avatar uSkizzik commented on July 28, 2024

Hey @Songkeys, that feature is part of redocly's paid offerings. From their docs (https://redocly.com/docs/api-reference-docs/guides/generate-code-samples/) :

How much of a pain would it be to remake it 🤔

from redocusaurus.

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

How much of a pain would it be to remake it 🤔

Not in scope of this package. This package's aim is just to provide an integration, not to remake redoc.

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.