Skip to content

Repository files navigation

OpenAPI v3 Tools

Build StatusPyPIPyPI

OpenAPI v3 object model and helpers.

Installation

pip install openapitools

Usage

fromopenapitoolsimportSpecificationBuilder, ComponentsBuilder, OperationBuilder, SchemaclassTodo:
id: inttext: strdone: Falsecomponents=ComponentsBuilder()
components.scheme(Todo.__name__, Schema.make(Todo))
builder=SpecificationBuilder(components)
builder.describe('TODO REST API', '1.0')
builder.license('MIT')
builder.contact('John Doe', 'https://example.com', 'john-doe@example.com')
get_todo=OperationBuilder()
get_todo.parameter('id', int, 'path')
get_todo.describe('Get todo by ID')
get_todo.tag('todo')
get_todo.response(200, Todo)
builder.operation('/todo/{id}', 'GET', get_todo)
print(builder.build())

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages