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

Try it API console feature #24

Closed
Yuan1979 opened this issue May 6, 2021 · 15 comments
Closed

Try it API console feature #24

Yuan1979 opened this issue May 6, 2021 · 15 comments
Labels
wontfix This will not be worked on

Comments

@Yuan1979
Copy link

Yuan1979 commented May 6, 2021

Is it possible to have the try function like what we have in general apidoc/swagger?

@rohit-gohri
Copy link
Owner

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

@Yuan1979
Copy link
Author

Yuan1979 commented May 6, 2021

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.

@Yuan1979
Copy link
Author

Yuan1979 commented May 6, 2021

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)

@rohit-gohri
Copy link
Owner

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

@rohit-gohri
Copy link
Owner

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

@rohit-gohri rohit-gohri changed the title Try Try it API console feature May 6, 2021
@rohit-gohri rohit-gohri added the wontfix This will not be worked on label May 13, 2021
@rohit-gohri
Copy link
Owner

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

@Anthony-Gaudino
Copy link

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.

@rohit-gohri
Copy link
Owner

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

@Songkeys
Copy link

Songkeys commented Jun 6, 2022

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

@rohit-gohri
Copy link
Owner

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").

@Songkeys
Copy link

Songkeys commented Jun 6, 2022

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

@rohit-gohri
Copy link
Owner

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/

@Songkeys
Copy link

Songkeys commented Jun 6, 2022

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

@uSkizzik
Copy link

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 🤔

@rohit-gohri
Copy link
Owner

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.

Repository owner locked and limited conversation to collaborators Apr 24, 2023
Repository owner unlocked this conversation Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

5 participants