[Feature] Make better use of cornice/colander validators #615
Labels
help wanted
Extra attention is needed
triage/feature
New requested feature.
triage/investigate
Exploration tasks or issues requirering more analysis
Description
Using the following definitions:
It is possible to make better use of Cornice utilities to perform pre/post validations instead of manual try/except with raise of the HTTPException.
[Feature] Improve schema error reporting and language translation #112
(see https://cornice.readthedocs.io/en/latest/i18n.html)
[Feature] HTML format #210
support
YAML
representation of the process usingAccept
header orf
/format
query #456use
content_type
in cornice decorator over request view to validate the list of permitted content types in request body415 Unsupported Media Type
to responses corresponding tocontent_type
validation(should be auto-handled by
add_cornice_service
handler, but test to validate)use
from cornice.validators import DEFAULT_VALIDATORS, colander_validator, colander_body_validator, colander_headers_validator, colander_path_validator, colander_querystring_validator
to validate items referred byschema
(see also Question: Ambiguity regarding multi-validator use case with colander Cornices/cornice#587)
use
accept
and let cornice/colander perform the406 Not Acceptable
check(consider https://cornice.readthedocs.io/en/latest/validation.html#using-callables-1 to handle
f
instead ofaccept
- inject ihe header?)Simplify exception definitions #215
return contents for corresponding errors (ie: format the JSON with expected OGC structure) using custom
error_handler
(see https://cornice.readthedocs.io/en/latest/validation.html#dealing-with-errors)
The text was updated successfully, but these errors were encountered: