Skip to content

Document deferred validators with new API #412

@leplatrem

Description

@leplatrem

In Cornice 1.2 the schema was bound to the request before validation (for deferred fields).
https://github.com/Cornices/cornice/blob/1.2.1/cornice/schemas.py#L35
#288
https://github.com/Cornices/cornice/blob/1.2.1/cornice/tests/test_schemas.py#L62-L65

Now, it can be achieve just this way:

def bound_schema_validator(request, **kwargs):
    schema  = kwargs['schema']
    kwargs['schema'] = schema.bind(request=request)
    return colander_validator(request, **kwargs)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions