Comments (3)
If the body is not of type BaseModel
, we must re-implement the data validation function (source code), it will be a lot of work.
So I suggest another way:
class UnionModel(BaseModel):
__root__: Union[Dog, Cat]
@app.put('/pet')
def update_pet(body: UnionModel):
print(body)
print(type(body))
return body.json()
from flask-openapi3.
I understand thank you, I believe that I can work with the alternative.
from flask-openapi3.
I want to work on this.
from flask-openapi3.
Related Issues (20)
- Flask-sqlalchemy, Flask-migrate, psycopg3 weird behaviour HOT 1
- Is there a work around to create non json request handlers?
- Option to output openapi3 instead of 3.1 HOT 1
- Permissions decorator running after pydantic validation HOT 4
- Shorthand way of describing that the response will be an array of items. HOT 1
- Every route gets a 422 response created HOT 3
- Make body required false
- Not required (optional) fields in multipart/form-data don't have types in swagger HOT 14
- Different endpoints in swagger "Try it out" fire to the same endpoint when they have the same function name HOT 4
- The default value defined in the form is invalid
- incompatibility with latest pydantic 2.5.2 HOT 3
- Apply multi responses to one HttpStatus or apply arbitrary str as responses key HOT 3
- Allow 422 response to specified model not only array HOT 3
- Optional null value with model_fields_set HOT 3
- Missing Pydantic Calculated Fields From openapi.json HOT 3
- How to add examples to swagger HOT 1
- Issues using flask-openapi3 when its views are decorated
- Swagger Validator Error when application is deployed HOT 3
- How to return a list? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flask-openapi3.