从OpenAPI 3组件模式生成Markdown文档
项目描述
OpenAPI组件模式到Markdown
此包的目标是从OpenAPI 3规范生成组件模式的Github Flavored Markdown文档。
假设你有一个YAML文件
openapi: "3.0.0"
info:
version: "0"
title: Demo
paths:
/demo:
get:
summary: Demo
responses:
'200':
description: OK
components:
schemas:
ResultatHumain:
properties:
operation_id:
type: integer
format: int64
description: Le numéro unique de l'opération
example: 1119920371
categorie_personne:
type: string
description: Indique la catégorie de personne impliquée dans le bilan humain
example: Pêcheur français
resultat_humain:
type: string
description: Description du bilan humain
example: Personne secourue
nombre:
type: number
format: int32
minimum: 0
description: Nombre de personnes impliquées dans ce bilan
example: 3
dont_nombre_blesse:
type: number
format: int32
minimum: 0
description: Indique le nombre de personnes blessées dans le bilan
example: 1
该包将从YAML规范文件生成Markdown文件,内容如下
## ResultatHumain
|Field|Type|Description|Example|Properties|
|---|---|---|---|---|
|operation_id|integer($int64)|Le numéro unique de l'opération|1119920371||
|categorie_personne|string|Indique la catégorie de personne impliquée dans le bilan humain|Pêcheur français||
|resultat_humain|string|Description du bilan humain|Personne secourue||
|nombre|number($int32)|Nombre de personnes impliquées dans ce bilan|3|minimum: 0|
|dont_nombre_blesse|number($int32)|Indique le nombre de personnes blessées dans le bilan|1|minimum: 0|
如果你将其渲染
ResultatHumain
字段 | 类型 | 描述 | 示例 | 属性 |
---|---|---|---|---|
operation_id | integer($int64) | 操作的唯一编号 | 1119920371 | |
categorie_personne | string | 指示在人类平衡中所涉及的人的类别 | 法国渔民 | |
resultat_humain | string | 人类平衡的描述 | 获救人员 | |
数量 | number($int32) | 在此平衡中涉及的人数 | 3 | minimum: 0 |
dont_nombre_blesse | number($int32) | 指示在平衡中受伤的人数 | 1 | minimum: 0 |
安装
pip install open-api-schemas-to-markdown
用法
该包提供了一个命令行工具。
$ oa-to-md -h
usage: oa-to-md [-h] input_filepath output_filepath [locale]
positional arguments:
input_filepath The OpenAPI 3 YAML filepath
output_filepath The desired output filepath of the Markdown file
locale Locale to use when generating the Markdown file. Available:
en, fr
optional arguments:
-h, --help show this help message and exit
示例
oa-to-md open_api.yml documentation.md
注意
此软件可在MIT许可下使用,并由法国政府作为Entrepreneur d'Intérêt Général计划的一部分开发。
在“Entrepreneur d'intérêt général”计划下开发的项目。
项目详情
关闭
open_api_schemas_to_markdown-0.3.tar.gz的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | b62186db8b14a75c0489440d3f6ad16320a892277491433bcd8d202139c867fc |
|
MD5 | 060c8aba46b4fab22405884057b179f9 |
|
BLAKE2b-256 | 69e061425177950d50829d5666f94b11ff9b311db75ffe8cc56243fae42e7514 |
关闭
open_api_schemas_to_markdown-0.3-py2.py3-none-any.whl的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 5a46c48bb721e717196ad115655b8c5cf518d12ee6fd1273d5af1006f8cf5580 |
|
MD5 | b859125fa1f9c45f804ff76b5f478266 |
|
BLAKE2b-256 | f8ce8c02bfa64e622ff1c7cb0d7889e1aeb77e7abba4bbc5aa1a706e5d01a2e2 |