mock-server / mockserver

MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby. MockServer also includes a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding).
http://mock-server.com
Apache License 2.0
4.58k stars 1.07k forks source link

Response body validation based on OpenAPI #1147

Closed jianziqin closed 2 years ago

jianziqin commented 2 years ago

Describe the feature request As API's schema is defined in openAPI doc. if the schema of response body changes and mockserver still uses the old schema of response body, that means the mock data are not immediately auto-detected the latest requirements of the API definition which will cause consumer and provider to be not on the same page. So openAPI doc is the baseline of a valid response mock data.

The solution you'd like if there is an optional parameter to control enabling response body's validation, that will be exactly helpful.

jamesdbloom commented 2 years ago

I agree that makes sense.

This feature request has been accepted, new feature requests are prioritised on Trello, so closing issue in GitHub, only bugs or unaccepted feature requests will stay in GitHub, so that new feature backlog can be more effectively managed, see: https://trello.com/c/8izEHnYR/163-response-body-validation-based-on-openapi

However when this feature is implemented this issue will be checked so please continue any conversation related to this issue here.

brcros commented 1 year ago

Hello, we are also looking for validation of expectation using openapi doc( request & response). Actually, we use mockserver with a test framework, and so, we want tests to be not passed when api specifications does not match anymore with the mocks. That would be a great feature to have the openapi extra validation.

brcros commented 1 year ago

Would this features be cover by this one ? https://github.com/mock-server/mockserver/issues/1239