-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Empty request when using custom validators #71
Labels
Comments
I can't check right now, but I think you can create a body schema transfomer for the validator and append it to the list of transformers that are ran: def body_schema_transformer(schema, args):
validators = args.get('validators', [])
if my_validator in validators:
body_schema = schema
schema = colander.MappingSchema()
schema['body'] = body_schema
return schema
@swagger.get()
def swagger_spec(request):
...
generator = CorniceSwagger(get_services())
generator.schema_transformers.append(body_schema_transformer)
... |
@jomasti answer should do the job. Currently that's not documented, but it definitely should be on this section. |
Related to #51 |
@tesarm I've updated the documentation and assumed this to be solved. Feel free to reopen it if you have more problems. :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Swagger doesn't generate request object for services with custom validators:
How to reproduce:
The reason why I need to use custom validator is because I want to bind request to schema. My actual validator looks like the function below, but it doesn't make any difference if I call it with modifications
The text was updated successfully, but these errors were encountered: