Skip to content
This repository was archived by the owner on May 9, 2024. It is now read-only.
This repository was archived by the owner on May 9, 2024. It is now read-only.

Native schema support #22

Description

@pdiazvargas

What

I want to have the ability to define an object schema using a library like marshmallow.

The schema definition should validate as well as automatically convert a given payload to an instance of the object as defined by the schema. Proposed syntax:

class ArtistSchema(Schema):
    name = fields.Str()

@app.route('/artist', methods=['POST'], schema=ArtistSchema())
def create_artist():
    artist = app.request.object
    save_artist(artist)
    return {"name": artist.name}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions