znsio / specmatic

Turn your contracts into executable specifications. Contract Driven Development - Collaboratively Design & Independently Deploy MicroServices & MicroFrontends.
https://specmatic.io
MIT License
280 stars 52 forks source link

Stringified json is converted to json when using in stubbed responses(json) #1383

Open GagandeepSharma060 opened 2 weeks ago

GagandeepSharma060 commented 2 weeks ago

Hi team,

Noticed un unusual behaviour last night. When creating json files for mocking(externalized examples), if i pass a stringified json then it is converted to json when interacting with the json server.

For example:

If in the json file I mention

value : "{\"browsers\":{\"firefox\":{\"name\":\"Firefox\",\"pref_url\":\"about:config\",\"releases\":{\"1\":{\"release_date\":\"2004-11-09\",\"status\":\"retired\",\"engine\":\"Gecko\",\"engine_version\":\"1.7\"}}}}}"

The server sends me

value:
{
  "browsers": {
    "firefox": {
      "name": "Firefox",
      "pref_url": "about:config",
      "releases": {
        "1": {
          "release_date": "2004-11-09",
          "status": "retired",
          "engine": "Gecko",
          "engine_version": "1.7"
        }
      }
    }
  }
}

Which is not what I want,

Can u please have a look. Thanks

GagandeepSharma060 commented 2 weeks ago

@joelrosario Cnn u or someone please confirm if this actually is an issue or something wrong with my implementation

GagandeepSharma060 commented 1 week ago

@harikrishnan83 Can u have a look please

harikrishnan83 commented 1 week ago

@GagandeepSharma060 Thanks for the follow up. I will get back to you shortly on this.

harikrishnan83 commented 1 day ago

@GagandeepSharma060 Apologies for the delay on this. We are able to reproduce the issue based on your inputs. I will keep you posted on the progress of the fix for the same. Thanks.