Skip to content
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

Validate that input adheres to openapi spec #76

Open
Hollerweger opened this issue Sep 30, 2022 · 2 comments
Open

Validate that input adheres to openapi spec #76

Hollerweger opened this issue Sep 30, 2022 · 2 comments

Comments

@Hollerweger
Copy link

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.

@Hollerweger
Copy link
Author

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.

@ctnguyen
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants