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

Question : is it possible to use this library to validate API request/responses #44

Open
sapiens-sapide opened this issue Mar 30, 2017 · 4 comments
Labels

Comments

@sapiens-sapide
Copy link

Hello,
I'm not raising an issue but asking for help/information.
I'm trying to use the go-openapi to write a http middleware that validates requests and responses for a ReST HTTP server. But I can't find which go-openapi component I should use, if any.
My application loads the swagger.json that defines my API. Now, I was wondering how to checks if http requests conform to the swagger.
Any clue ?
Thanks in advance for your help.
Regards, Stan.

@casualjim
Copy link
Member

you'd need to use both the routing and the validation middleware in ./middlewares

@igorsechyn
Copy link

I had the same issue and found it not really trivial to implement this. I can create a gist with a solution, if you are interested.

@casualjim would you be interested in a PR to make it part of the library, i.e. having an easy way to create a simple HTTP middleware for validating requests and responses?

@casualjim
Copy link
Member

absolutely welcome a PR like that

@igorsechyn
Copy link

Sweet, I will work on it in my 20% time and will try to come up with something by the end of the month

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

No branches or pull requests

4 participants