Skip to content

If the paths defined are relative to URL defined under server tag, the stubs are not getting recognized and loaded during tests. #1470

Discussion options

You must be logged in to vote

hello @prateekkarmakar , thanks for reaching out.

The problem where we cannot change the spec to add path prefixes (to simulate gateways, etc.), add headers, etc. is quite common. The best approach IMHO for this is to use OpenAPI Overlays to add these changes externally.

Specmatic supports overlays and here is the documentation. In your specific case, we can add the /orders/customer prefix to your path externally through an overlay file and Specmatic will apply this change on your OpenAPI spec at runtime and there by pick up your example JSONs (which can continue have /orders/customer/). Hope this helps.

Please reach out to us if you need any help on this.

Regards,
HariKrishnan

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by harikrishnan83
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants