OpenAPI v3 Object Model and Helpers
Project description
OpenAPI v3 Tools
OpenAPI v3 object model and helpers.
Installation
pip install openapitools
Usage
from openapitools import SpecificationBuilder, ComponentsBuilder, OperationBuilder, Schema
class Todo:
id: int
text: str
done: False
components = 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())
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
openapitools-0.0.2.tar.gz
(6.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file openapitools-0.0.2.tar.gz.
File metadata
- Download URL: openapitools-0.0.2.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0c4c5b163e72c4a9e9ac823ac151b7681a4081fde0477e7872dc5ab783b2585a
|
|
| MD5 |
5f01a82493ed3c54fe109548d1227278
|
|
| BLAKE2b-256 |
6f7725bd0dfddc40eb461044761b5c28535faa7d4375b3aaf61570d116a9a24c
|
File details
Details for the file openapitools-0.0.2-py3-none-any.whl.
File metadata
- Download URL: openapitools-0.0.2-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c96aadf021e4fde7d2cbf1be57ff7aa29ad3ce80d8537564126288ae36b7c7e1
|
|
| MD5 |
17dcfdd244623014904e8ea9a68b73a0
|
|
| BLAKE2b-256 |
9629bd66c45e4be70954a0fac2048576f24f4f6e530f65e425ae5221fc583e57
|