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 stub is generating incorrect response for JSON string value in http-response body #1116

Open
abhishekkhurmi opened this issue May 20, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@abhishekkhurmi
Copy link

Description
For a given HTTP-POST request, I am trying to stub the JSON response in which one of the property is having stringify / JSON-string value. Also, I have added the schema as type: string in the yaml contract. But the stubbed response I am getting back is a parsed JSON object instead of a JSON-string.

Stubbed JSON response-body:

image

image

Steps to reproduce
See above.

Expected behavior
Stubbed response should return the value in json-string or stringify json format.

Screenshots
Actual incorrect response from the stub. Here, expected value of Data property is json-string, but we are getting parsed json-object.

image

System Information:

  • OS & version: MacOS 12.7.1
  • Browser & version: Chrome 124.0.6367.207
  • Specmatic version: 1.3.19
  • JDK version: 17.0.10

Additional context
N/A

@yogeshnikam671
Copy link
Member

Hi @abhishekkhurmi
Thanks for reporting this issue!

We were able to successfully reproduce it with the steps that you have provided.
We will fix this issue and let you know. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants