flask-pydantic
flask-pydantic copied to clipboard
flask extension for integration with the awesome pydantic package
Built off of @buildpeak's forked PR #41. Added `parse_url` method to mimic what `werkzeug`'s did. This was copied from [flask-restx](https://github.com/python-restx/flask-restx)'s [PR #463](https://github.com/python-restx/flask-restx/pull/463).
This is a very simple version of OpenAPI spec just for internal use. At least the developer can use the Swagger page to do some RESTful tests.
By defining a new config value that flask_pydantic looks for (FLASK_PYDANTIC_VALIDATION_ERROR_RAISE), we can support raising an exception when we have a validation error. If that is set and the exception...
Hello! Thanks for awesome package. I want to make custom response ASIS ``` { "validation_error": { "query_params": [ { "loc": ["age"], "msg": "value is not a valid integer", "type": "type_error.integer"...
This error is occurring for me when the body of an endpoint receives a `pydantic.BaseModel` that contains a field of type `Enum` and the validation fail, the error message returned...
For example: ```python class BookModel(BaseModel): title: str price: float @app.put("/books/") @validate() def update_book(id:int, q:str, book_schema: BookModel): pass ``` Will auto recognize `id` as path param, `book_schema` as request body params,...
if my query string is ``` http://url?a[]=1&a[]=2&a[]=3 ``` i want the get the `a` value is a = [1, 2, 3] can i use the `query: useModel` realize it ?...
Hey all, I am trying to understand if the behavior I am seeing is expected, a bug or misconfiguration of my setup. The following code uses. Flask-Pydantic = "~=0.9.0" There's...
Hi! I am using this module with Python Dependency Injection Framework and when i try to use Provider in kwargs of the view i am getting: `RuntimeError: no validator found...
I am using `Flask-Pydantic` with `mypy` and I got the error > error: Untyped decorator makes function "index" untyped on the line `@validate()` ``` @blueprint.post("/") @validate() def index(body: RequestBodyModel) ->...