I try add schema validation as it describe in official cornice doc and the do that through decorator like service_name.post(schema=SomeSchemaClass) but it's doesn't work
import colander
class TrackSchema(colander.MappingSchema):
genre = colander.SchemaNode(colander.String(), location="body", type='str')
@track.post(schema=TrackSchema)
def create_track(request):
...
And I get error
"status": "error", "errors": [{"location": "body", "name": null, "description": "Expecting value: line 1 column 2 (char 1)"}, {"location": "body", "name": "genre", "description": "genre is missing"}]}
I try different types of location arg like querystring and headers but I got the same error.