Metadata-Version: 2.1
Name: flask-openapi3
Version: 0.9.0
Summary: Generate RESTful API and OpenAPI document for your Flask project.
Home-page: https://github.com/luolingchun/flask-openapi3
Author: llc
Author-email: luolingchun@outlook.com
License: BSD-3-Clause
Description: # flask-openapi3
        
        Generate RESTful API and OpenAPI document for your Flask project.
        
        ## Installation
        
        ```bash
        $ pip install -U flask-openapi3
        ```
        
        ## A Simple Example
        
        Here's a simple example, further go to the [wiki](https://github.com/luolingchun/flask-openapi3/wiki)
        
        ```python
        from pydantic import BaseModel
        
        from flask_openapi3 import OpenAPI
        from flask_openapi3.models import Info, Tag
        
        info = Info(title='book API', version='1.0.0')
        app = OpenAPI(__name__, info=info)
        
        book_tag = Tag(name='book', description='图书')
        
        
        class BookData(BaseModel):
            age: int
            author: str
        
        
        @app.get('/book', tags=[book_tag])
        def get_book(query: BookData):
            """get books
            get all books
            """
            return {
                "code": 0,
                "message": "ok",
                "data": [
                    {"bid": 1, "age": query.age, "author": query.author},
                    {"bid": 2, "age": query.age, "author": query.author}
                ]
            }
        
        
        if __name__ == '__main__':
            app.run(debug=True)
        ```
        
        ## API docs
        
        Run the [simple example](https://github.com/luolingchun/flask-openapi3/blob/master/examples/simple_demo.py), and go to http://127.0.0.1:5000/openapi.
        
        You will see the document: [Swagger UI](https://github.com/swagger-api/swagger-ui) and [Redoc](https://github.com/Redocly/redoc).
        
        ![openapi](https://github.com/luolingchun/flask-openapi3/raw/master/docs/images/openapi.png)
        ![openapi-swagger](https://github.com/luolingchun/flask-openapi3/raw/master/docs/images/openapi-swagger.png)
        ![openapi-redoc](https://github.com/luolingchun/flask-openapi3/raw/master/docs/images/openapi-redoc.png)
        
        
Platform: any
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Environment :: Web Environment
Classifier: Framework :: Flask
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Requires-Python: >=3.6
Description-Content-Type: text/markdown
