Skip to content

Compatibility with Pydantic Models #634

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
napocornejo opened this issue Feb 19, 2025 · 0 comments
Open

Compatibility with Pydantic Models #634

napocornejo opened this issue Feb 19, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@napocornejo
Copy link

Pydantic has become increasingly popular in the python world, and API development is of particular interest. Many API's work based on json requests which are a natural serialization for pydantic. However there is currently no way to create the flask-restx models from pydantic models.

Ideally, decorators like:

api.marshal_with(model)
namespace.doc(model=model)

can accept pydantic models.

At the moment I create utilitarian functions that device the flask-restx models from the pydantic models. Given the popularity of Pydantic this would be ideal to come out of the box in flask-restx.

@napocornejo napocornejo added the enhancement New feature or request label Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant