openapi-core icon indicating copy to clipboard operation
openapi-core copied to clipboard

[Question] Is there an option to change the flow of calling validation & formatting.

Open sarangsbabu367 opened this issue 4 years ago • 2 comments

  • Currently formatter is called after validating the field, is there any option to alter this flow.
  • use-case: - I have to trim string values before validating with minLength.

sarangsbabu367 avatar Jul 03 '20 14:07 sarangsbabu367

@sarangsbabu367

That sounds like use case for you request/response library. You should try to do this with some kind of middleware. Alternatively you can try to create custom formatter with trim option.

p1c2u avatar Jul 20 '20 14:07 p1c2u

@p1c2u If we make a custom formatter, still formatter is called after validation. So it wont be useful.

sarangsbabu367 avatar Jul 26 '20 03:07 sarangsbabu367