Would be great to have multiple stubs in the same file (for example, in an array). Something like the following json:
[
  {
    "request": {
      "method": "GET",
      "url": "/some/thing"
    },
    "response": {
      "status": 200,
      "body": "Hello world!",
      "headers": {
        "Content-Type": "text/plain"
      }
    }
  },
  {
    "request": {
      "method": "GET",
      "url": "/some/thing2"
    },
    "response": {
      "status": 200,
      "body": "Hello world! 2",
      "headers": {
        "Content-Type": "text/plain"
      }
    }
  }
]
This is particularly useful for grouping stubs, and having a manageable amount of files.
PS: Thanks for the great work!
Closing as a duplicate of https://github.com/tomakehurst/wiremock/issues/987
In case anyone runs across this trying to get multiple mapping into one json file as I did, be aware that the suggested format above is not what ended up in the code. There is no requests array, just mappings. See
https://github.com/tomakehurst/wiremock/blob/master/src/test/resources/multi-stub/multi.json
for a working example.
In case anyone runs across this trying to get multiple mapping into one json file as I did, be aware that the suggested format above is not what ended up in the code. There is no requests array, just mappings. See
https://github.com/tomakehurst/wiremock/blob/master/src/test/resources/multi-stub/multi.json
for a working example.
Thanks this helped me :)
Most helpful comment
In case anyone runs across this trying to get multiple mapping into one json file as I did, be aware that the suggested format above is not what ended up in the code. There is no requests array, just mappings. See
https://github.com/tomakehurst/wiremock/blob/master/src/test/resources/multi-stub/multi.json
for a working example.