redoc icon indicating copy to clipboard operation
redoc copied to clipboard

Please create a node.js api that can be used in place of the cli

Open billytetrud opened this issue 2 years ago • 9 comments

You have a cli, but I would have guessed that the cli runs off of a core javascript api. Doesn't look like you publish documentation for it, and I'm wondering if a good js api even exists, when looking at how the cli is written. Its silly to have to run command line tools within a node.js build script.

billytetrud avatar May 11 '22 17:05 billytetrud

Here are some docs:

https://redocly.com/docs/redoc/deployment/html/#step-2---reference-the-redoc-script https://redocly.com/docs/redoc/deployment/react/#how-to-use-the-redoc-react-component

If you have some ideas for better API, your contributions would be appreciated!

RomanHotsiy avatar May 12 '22 11:05 RomanHotsiy

No, that is not what I'm talking about. I'm talking about a javascript api that can be used in place of the cli (ie via a node.js script). Please reopen

billytetrud avatar May 12 '22 16:05 billytetrud

@RomanHotsiy

billytetrud avatar May 13 '22 18:05 billytetrud

I think this issue is more related to the repository https://github.com/Redocly/redocly-cli. It includes two libs @redocly/cli and @redocly/openapi-core.

AlexVarchuk avatar May 19 '22 09:05 AlexVarchuk

@AlexVarchuk, no. It is not. They mean to implement some way to run a redoc-cli build from node.js directly.

RomanHotsiy avatar May 19 '22 12:05 RomanHotsiy

Any updates with this?

KlausGrosser avatar Aug 31 '22 13:08 KlausGrosser

No update. PRs are welcome.

RomanHotsiy avatar Aug 31 '22 13:08 RomanHotsiy

@RomanHotsiy thank you for the response, just to know, I've noticed that in the redoc-cli documentation the keyword "bundle" refers to the "build" command. Is this the same for the @redoc/openapi-core bundle? If that is the case, we could use the "bundle" usage to generate a redoc-html from an openapi.json?

KlausGrosser avatar Aug 31 '22 14:08 KlausGrosser

No, we're renaming "bundle" to "build" so there is no confusion between two.

RomanHotsiy avatar Aug 31 '22 15:08 RomanHotsiy

redoc-cli was replaced by Redocly CLI, which does wrap a JS library. You can find out more and see examples of how to use it here https://www.npmjs.com/package/@redocly/openapi-core

lornajane avatar Nov 09 '23 18:11 lornajane