1

I want to use Redoc for my API documentation. I also have swagger.

I found here : https://github.com/Redocly/redoc this line - Integrate API Introduction into side menu - ReDoc takes advantage of markdown headings from OpenAPI description field. It pulls them into side menu and also supports deep linking.

I want to add my readme file to left side bar in Redoc. But I didn`t find any good example for it. What should I change, where readme should be added?

My redoc setup :

app.UseReDoc(c =>
            {
                c.DocumentTitle = $"Documentation";
                c.SpecUrl = /api/docs/swagger.json";
                c.RoutePrefix = "docs";
            });
andrey1567
  • 97
  • 1
  • 13

1 Answers1

1

That documentation is referring to the info.description field.

You can embed the readme into the API definition like this:

info:
  description:
     $ref: ./path/to/readme.md

Replace that path with your actual path to the readme.


Source: https://redoc.ly/docs/api-reference-docs/embedded-markdown/#embedded-markdown-in-redocly-api-reference-docs

Note: If you are unable to change the API description, you could do it in post-processing using OpenAPI CLI and a custom decorator with the bundle command.

Domino
  • 361
  • 1
  • 2
  • 7