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 a REST API response against the Swagger/OpenAPI spec #27

Closed
ddobrin opened this issue Jan 15, 2018 · 4 comments
Closed

Validate a REST API response against the Swagger/OpenAPI spec #27

ddobrin opened this issue Jan 15, 2018 · 4 comments
Assignees

Comments

@ddobrin
Copy link
Contributor

ddobrin commented Jan 15, 2018

Provide a method to validate a response against the specification.

A usable step would allow the validation of a response from integration and/or unit tests.

@stevehu
Copy link
Contributor

stevehu commented Jan 15, 2018

@ddobrin Thanks a lot for raising this issue. Had a long discussion with one of your team members and I think it would help during the development cycle. I was too focused on the production runtime in the beginning and couldn't find a way to return the validation error within the normal response. I am more leaning to implement this in the client module at the moment and we can make it optional so that it can be turned off on production. Let's discuss the details once we meet.

@ddobrin
Copy link
Contributor Author

ddobrin commented Jan 16, 2018

Agreed.
This change needs to be implemented in the Client module, while retaining the ability to toggle its usage, for performance reasons in Production.

@BalloonWen BalloonWen self-assigned this Jan 21, 2019
@ddobrin ddobrin assigned ddobrin and unassigned BalloonWen Jan 22, 2019
@ddobrin
Copy link
Contributor Author

ddobrin commented Jan 22, 2019

@stevehu : there are 3 cases where response validation against the spec can be performed:

  1. client module
  2. handler wired in the handler chain, on the provider side
  3. utility module, on the provider side, which the microservice can invoke to validate the response.

My client wishes to retain both options [2,3], which will be used during development and testing.

Note:
This functionality needs to be enabled/disabled via configuration, as it is not recommended to be used in a production environment

@stevehu
Copy link
Contributor

stevehu commented Feb 16, 2019

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

No branches or pull requests

3 participants