admin管理员组文章数量:1334278
I need to generate offline documentation (PDF / docx / Standalone html) for a Rest/Json api with a few constraint:
- I don't have access to JVM or Docker
- It needs to be reliable (no online site that could shutdown in the future)
Few extra infos: it's Uvnicorn server (Python3.9) generating openapi (3.0.2) jsonschema
The goal is to provide 1 document, that provide similar informations as SwaggerUI (each endpoints, with http codes, responses schemas, examples)
This document need to provide readable information without any extra tools (e.g. pdf is fine), my best attempt so far was to use this :
But there's still a bunch of imported scripts and ccs that either need seperated files or to be online
I need to generate offline documentation (PDF / docx / Standalone html) for a Rest/Json api with a few constraint:
- I don't have access to JVM or Docker
- It needs to be reliable (no online site that could shutdown in the future)
Few extra infos: it's Uvnicorn server (Python3.9) generating openapi (3.0.2) jsonschema
The goal is to provide 1 document, that provide similar informations as SwaggerUI (each endpoints, with http codes, responses schemas, examples)
This document need to provide readable information without any extra tools (e.g. pdf is fine), my best attempt so far was to use this : https://stackoverflow/a/46484079/15719786
But there's still a bunch of imported scripts and ccs that either need seperated files or to be online
Share Improve this question edited Nov 21, 2024 at 13:42 Jeremy Fiel 3,3072 gold badges11 silver badges26 bronze badges asked Nov 20, 2024 at 8:35 shined dayshined day 135 bronze badges 5- 1 What did you try? We would like to help you but we need details. This is not a wish come true site. – tukan Commented Nov 20, 2024 at 8:37
- What's your question? – Guy Incognito Commented Nov 20, 2024 at 8:39
- See if this helps: How to generate a PDF or markup from OpenAPI 3.0?, How to generate offline Swagger API docs?, Swagger UI single interactive HTML. Also check this list of OpenAPI renderers: openapi.tools/#documentation, some of them can be self-hosted and/or viewed locally (e.g. Redoc, RapiDoc, Widdershins). – Helen Commented Nov 20, 2024 at 11:20
- Also what's your use case? Do you want to self-host the API docs on your own site? Or ship the API docs as part of on-premise product installations? Or something else? – Helen Commented Nov 20, 2024 at 11:24
- 1 @Helen the goal is to provide a (hopefully) standalone, offline document, readable without any special tools (so HTML without imported script, PDF docx are fine) that provide similar information to swagger UI (endpoints, responses schemas, error code handlings...). My best attempt so far was to use stackoverflow/a/46484079/15719786 this python script -> open result in browser -> save as html -> this provides me 1 html with few other files (ccs and scripts) and work fine offline – shined day Commented Nov 20, 2024 at 15:06
1 Answer
Reset to default 0You can use Redocly standalone html
download Redocly cli npm package.
npm install @redocly/cli:latest
Use the build-docs
command to create a standalone html file
redocly build-docs <path/to/api> --output <filename.html>
lots of other customizations you can do with this command with the theme
and config
options.
src: https://redocly/docs/cli/commands/build-docs
本文标签: openapiGenerate offline docs for SwaggerStack Overflow
版权声明:本文标题:openapi - Generate offline docs for Swagger - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742371680a2462362.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论