Skip to main content

Generate Markdown documentation from OpenAPI 3 Components Schemas

Project description

Software License CircleCI PyPI

OpenAPI Components Schemas to Markdown

The goal of this package is to generate Github Flavored Markdown documentation of Components Schemas from the OpenAPI 3 specification.

Say you've got a YAML file:

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

The package will produce a Markdown file from the YAML specification file with the following content:

## ResultatHumain Model
|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|

And if you render it:

ResultatHumain Model

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

Installation

pip install open-api-schemas-to-markdown

Usage

The package provides a command line tool.

$ 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

Example:

oa-to-md open_api.yml documentation.md

Notice

This software is available under the MIT license and was developed as part of the Entrepreneur d'Intérêt Général program by the French government.

Projet développé dans le cadre du programme « Entrepreneur d’intérêt général ».

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

open_api_schemas_to_markdown-0.2.1.tar.gz (4.4 kB view details)

Uploaded Source

Built Distributions

open_api_schemas_to_markdown-0.2.1-py2.py3-none-any.whl (5.5 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file open_api_schemas_to_markdown-0.2.1.tar.gz.

File metadata

File hashes

Hashes for open_api_schemas_to_markdown-0.2.1.tar.gz
Algorithm Hash digest
SHA256 50a8f3c92607474ee64aa8dc925d4ef394eaa3d2a6aac56bf796e9bf23cb1851
MD5 56bcb2e77c9c823b6df10b91d0602e2f
BLAKE2b-256 f677ea0e9cc3ed7ce22b1d45c9e329b33247d3e90260fbae08e5c3aa5dc57c77

See more details on using hashes here.

Provenance

File details

Details for the file open_api_schemas_to_markdown-0.2.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for open_api_schemas_to_markdown-0.2.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 52cf59209d48d74af15e49d2fc32e78756b486c4ebd8508bb4054560d2320374
MD5 88c972e9ef5da6363015854b1e5ba552
BLAKE2b-256 079e0815ad68fb0d430375f2b7d31197ee281e73a7e80a9afaa073c449b8ac8b

See more details on using hashes here.

Provenance

File details

Details for the file open_api_schemas_to_markdown-0.2.1-py2-none-any.whl.

File metadata

File hashes

Hashes for open_api_schemas_to_markdown-0.2.1-py2-none-any.whl
Algorithm Hash digest
SHA256 55b8057a9e4575a96f5b6193a2880c88305982c6c784716966c2d75c8ce21a58
MD5 2b4b2248433c9b4ca1e997ea9cef5528
BLAKE2b-256 60ccb91b821829118c78617501a48e5faa8f631ff99a0a8f07c69c6c61cb65f8

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page