znsio / specmatic

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

Fix for query params in external example url #1239

Closed joelrosario closed 3 months ago

joelrosario commented 3 months ago

What:

Added a fix for the code handling query params in external example, such as this:

{
  "http-request": {
    "method": "GET",
    "path": "/data?enabled=true"
  },
  "http-responses": {
    "status": 200,
    "body": []
  }
}

The query param is in the URL, and the fix ensures that example is loaded.

Why:

Query params were mistakenly treated as part of the URL, resulting in the example not being loaded.

How:

Added better path handling to the ExampleFromFile class.

Checklist: