question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

improve the error messages for OPEN API SCHEMA tests

See original GitHub issue

We use the OPEN API SCHEMA tests on microcks own endpoints to validate the mocks itself. Often we get schema validation errors which are very hard to identify the exact issue.

The mocks/examples are provided via postman collection - for example for for a POST request some JSON input and some JSON in the response. I now just got this error back:

instance failed to match all required schemas (matched only 1 out of 2)/n

OK, I guess either the request payload or the response do not match the schema - but which one? and where is the error exactly?

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
lbroudouxcommented, Aug 24, 2022

I mean response and not request, sorry… I edited my above comment.

0reactions
lbroudouxcommented, Aug 24, 2022

I was thinking of a JSON schema composition if you have some kind of polymorphism/abstraction in your data. They can be defined inline in the OpenAPI file without no external ref. Would you want to share a simple reproducer so that I can check?

Read more comments on GitHub >

github_iconTop Results From Across the Web

19 Improving input validation with advanced JSON Schema
JSON schema keywords for validation; Enhancing PetSitter schemas with those; ... an OpenAPI-powered mocking and testing tool, to detect whether the API ...
Read more >
[BUG] schemathesis fails with validation error despite schema ...
Describe the bug schemathesis fails with validation error despite schema is openapi 3.0.0 valid. To Reproduce $ docker run --network="host" ...
Read more >
REST API Testing Strategy: What Exactly Should You Test?
1. Verify correct HTTP status code. For example, creating a resource should return 201 CREATED and unpermitted requests should return 403 FORBIDDEN, etc....
Read more >
Validating requests and responses using OpenAPI ...
In this part, we will enable Committee to validate the API responses, catch invalid responses with our automated tests, and explore the library ......
Read more >
How to use the Open API and Swagger Validator plugin for ...
In this post, I've demonstrated the chai-openapi-response-validator and jest-openapi test packages which will improve your tests by checking ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found