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 externalized example responses #1164

Merged
merged 2 commits into from
Jul 5, 2024

Conversation

joelrosario
Copy link
Member

@joelrosario joelrosario commented Jul 4, 2024

What:

When running tests, match responses of externalised examples against the spec, and if any response does not conform to the spec, print an error and exit without running any tests.

Why:

An example of a request or response must match the spec. If it does not match the spec, it is not truly an example.

With this PR, Specmatic will matches externalised response examples, which in test mode were previously not done.

How:

  • Modified class ExampleFromFile to load the response
  • Modified class Scenario to validate it

Checklist:

@joelrosario joelrosario self-assigned this Jul 4, 2024
@joelrosario joelrosario merged commit a84344e into main Jul 5, 2024
2 checks passed
@joelrosario joelrosario deleted the validate_externalized_example_responses branch July 5, 2024 06:16
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

Successfully merging this pull request may close these issues.

1 participant