Skip to content
This repository has been archived by the owner on Oct 30, 2022. It is now read-only.

meeshkan/openapi-typed

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenAPI typed

CircleCI PyPI PyPi License

Python typings for OpenAPI using TypedDict.

Installation

Install package from PyPI.

pip install openapi-typed

Usage

from openapi_typed import OpenAPIObject, Info

# Valid OpenAPIObject
openapi_valid = OpenAPIObject(
    openapi="3.0.0",
    info=Info(
        title="My API",
        version="0.0.0")
    )

# Invalid OpenAPIObject
openapi_invalid = OpenAPIObject(
    openap="3.0.0",  # Type-check error, unknown attribute
    info=Info(
        title="My API"  # Type-check error, missing attribute `version`
    )
)

Development

Install development dependencies:

pip install -e .[dev]

Run tests:

pytest
# OR
python setup.py test

Run type-checks with mypy:

mypy openapi_typed

Build package:

python setup.py dist

Contributing

Thanks for wanting to contribute! We will soon have a contributing page detaling how to contribute. Meanwhile, feel free to star this repository, open issues and ask for more features and support.

Please note that this project is governed by the Meeshkan Community Code of Conduct. By participating in this project, you agree to abide by its terms.