Skip to content

Schemas

EmptySchema (Schema) marshmallow-model

An empty schema used to generate a 204 response.

Examples:

@app.delete('/foo')
@app.output(EmptySchema)
def delete_foo():
    return ''

It equals to:

@app.delete('/foo')
@app.output({}, 204)
def delete_foo():
    return ''
Source code in apiflask/schemas.py
class EmptySchema(Schema):
    """An empty schema used to generate a 204 response.

    Example:

    ```python
    @app.delete('/foo')
    @app.output(EmptySchema)
    def delete_foo():
        return ''
    ```

    It equals to:

    ```python
    @app.delete('/foo')
    @app.output({}, 204)
    def delete_foo():
        return ''
    ```
    """

    pass

PaginationSchema (Schema) marshmallow-model

A schema for common pagination information.

Source code in apiflask/schemas.py
class PaginationSchema(Schema):
    """A schema for common pagination information."""
    page = Integer()
    per_page = Integer()
    pages = Integer()
    total = Integer()
    current = URL()
    next = URL()
    prev = URL()
    first = URL()
    last = URL()