Giulio Giovannini
05/25/2023, 8:51 AM/mybaseurl/resource
while the provider Open API Spec yaml starts with a servers parameter like:
servers:
- url: /mybaseurl
and then defines the resource as:
/resource
post:
...
Pactflow can not match the paths as it disregards the servers parameter. The open Api Spec is autogenerated by Springboot so I can not change it that much.
Is there a workaround for this?Yousaf Nabi (pactflow.io)
The open Api Spec is autogenerated by Springboot so I can not change it that much.You can, that is the major selling point of using a machine readable specification
Yousaf Nabi (pactflow.io)
Is there a workaround for this?I would assume as an initial pass, it would be to add the path on servers.url[0] into the front of each of your path entries
Yousaf Nabi (pactflow.io)
Giulio Giovannini
05/25/2023, 10:03 AMYousaf Nabi (pactflow.io)
Giulio Giovannini
05/25/2023, 11:13 AMYousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
But editing a OAS that was auto-generated to make it match the consumer contract looks a bit of a hack.You’d be surprised at the amount of auto-generated OAS’s that do need work to be usable/human readable
Yousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
Giulio Giovannini
05/25/2023, 12:26 PMMatt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
servers:
- url: <https://hostname/v1>
servers:
- url: <https://hostname/api/v1>
We would need a way to resolve this reliably without making it confusing. You can also have not just ambiguity, but straight up conflicts.
e.g. it’s also possible to have conflicts at the path
level, like so:
paths:
'/fruits/apple'
servers:
- url: <https://hostname>
'/apple'
servers:
- url: <https://hostname/fruits>
These two would theoretically be the same, as far as the “resolved” path would be.Matt (pactflow.io / pact-js / pact-go)