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

Specmatic uses auto-generated payload over examples specified in yaml #1301

Open
dennisko762 opened this issue Sep 15, 2024 · 2 comments
Open

Comments

@dennisko762
Copy link

dennisko762 commented Sep 15, 2024

Description

As mentioned in the title while running specmatic contract tests against java spring api, instead of using the payload examples for request and response, specmatic uses auto-generated payload with random values.

Steps to reproduce

  1. Implement a simple CRUD api in any language you prefer based on the attached yaml.
  2. run following command java -jar specmatic.jar test src/main/resources/openapi.yaml --testBaseURL=http://localhost:3000 to test your api.
  3. Observe the test payload that differes from the examples specified in the openapi.yaml file.

Expected behavior
Test payload equals what I specified in the examples section of the api description in the openapi.yaml file.
For the POST and GET endpoints I specified example payloads similarly as described in this article (chapter PetStore API Specification): https://specmatic.io/getting_started.html and expected my examples to be used for the test, resulting in success.

Screenshot_1
Screenshot_2

System Information:

  • Windows 10 Professional
  • Specmatic version: 2.0.20
  • Intellij 2023.1.4
  • JDK version: 19.0.1

Thanks a lot in advance and best regards

@dennisko762
Copy link
Author

dennisko762 commented Sep 15, 2024

Here is the openapi spec file (converted to json) openapi.json

@pranavgawri
Copy link
Contributor

Hi, @dennisko762

Thanks for reporting the problem you are facing. We will look into this and update you ASAP.

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

No branches or pull requests

2 participants