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

Impossible to theme using redoc-cli due to incomplete & incorrect documentation #1774

Closed
smisch opened this issue Oct 14, 2021 · 1 comment
Closed

Comments

@smisch
Copy link

smisch commented Oct 14, 2021

Hey,

I spent a few hours trying to theme a generated documentation using mostly redoc-cli 0.8.6 and the redocly/redoc docker image. So far nothing I tried has worked. The github readme mentions a " theme object" but there are 0 examples on how this would even fit into the <redoc> tag, especially since these are all heavily nested.

The github readme mentions "Customization options" and links to "theme option", which in fact documents theming for to paid version, not the free version. Btw. the linked documentation page mentions a "json" example and then shows something which is literally not json. It seems to be some kind of malformed mix between yaml and json, but in the end it's neither, and of course it doesn't work with redoc-cli.

I also found conflicting statements by Redocly staff. For example here somebody claims that theming via external json file is only available in the paid version. Just 3 days ago somebody here suggested to pass a JSON file and linked to an example which does not work. Finally, here somebody suggested to pass a JSON string to the --options argument, which also doesn't work. It seems not even the redoc staff knows how the theming in redoc works.

Please update your documentation.

@RomanHotsiy
Copy link
Member

RomanHotsiy commented Oct 14, 2021

The github readme mentions "Customization options" and links to "theme option", which in fact documents theming for to paid version, not the free version.

The docs explicitly mentiones which options are supported by open-source Redoc (Community Edition):

image

It seems to be some kind of malformed mix between yaml and json

We'll fix this example. This is indeed confusing.

For example here somebody claims that theming via external json file is only available in the paid version.

This was a year ago. Back then it WAS available only in paid version.

Just 3 days ago somebody here suggested to pass a JSON file and linked to an example which does not work. Finally, here somebody suggested to pass a JSON string to the --options argument, which also doesn't work.

All of these variants work just fine with the latest version of redoc-cli which is 0.13.0 (not 0.8.6 which is 2 years old), see here: https://www.npmjs.com/package/redoc-cli

Here is the working command:

npx redoc-cli@0.13.0 bundle ~/Downloads/openapi.yml --options='{"theme": {"colors": {"primary": {"main": "#ff0000" }}}}'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants