Skip to content

Compatibility with Pydantic Models #634

@napocornejo

Description

@napocornejo

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions