dukeofharen / httplaceholder

A very flexible cross platform HTTP stub application.
MIT License
113 stars 4 forks source link

feat: Define JSON response as object #375

Open dukeofharen opened 2 months ago

dukeofharen commented 2 months ago

See https://httplaceholder.org/docs/#json-response. Right now, when defining a JSON response, it is always a string. It would be nice to also be able to define an object in YAML format. This way, it is a lot easier to define JSON because then you can define string values without having to escape them.

Example:

- id: situation-json
  conditions:
    method: GET
    url:
      path:
        equals: /text.json
  response:
    statusCode: 200
    json:
      msg: 'All OK!'