openapi-mock
openapi-mock copied to clipboard
Validate that input adheres to openapi spec
It seems that the post data is not validated against the openapi specification. Is there a possibility to enable data validation against the specification? A 400 BadRequest should be returned in case the data does not adhere to the specification.
Okay just saw that request validation is currently not supported. Is this something that is planned? Which openapi generator is used here? The ones I know are usually generation input validation for server stubs.
It seems a simple action to do by modifying the code at openapi validator
https://github.com/muonsoft/openapi-mock/blob/master/internal/openapi/handler/ResponseGeneratorHandler.go#L54
It'd be nice to give user an option to choose being strict or not. If yes, then validate request body, if not, ignore request body