You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Comparison of Pact interactions to OAS endpoints does not consider any basePath in its comparison.
In OAS 3 (and also 2), all API endpoints are considered to be relative to the base URL. For example, assuming the base URL of https://api.example.com/v1, the /users endpoint refers to https://api.example.com/v1/users.
Our comparison does not consider the impact of basePath as there may be multiple servers with different context paths and there is no clear way to resolve this ambiguity. In this example, a pact interaction with path /v1/users/ will not match an OAS that only has /users/ in its resource path.
Ways to resolve ambiguity
If there is only a single server, we use the path component from that
If there are multiple servers, all with the same base path. e.g. https://server1/base/path and https://server2/base/path then we can assume a /base/path is the correct one
If there are multiple servers with different base paths, then we have some additional options
a. Fail with an error
b. Allow a user to annotate the OAS with x-pactflow-<property> which specifies the basePath for the purposes of cross-contract validation
The text was updated successfully, but these errors were encountered:
Comparison of Pact interactions to OAS endpoints does not consider any
basePath
in its comparison.In OAS 3 (and also 2), all API endpoints are considered to be relative to the base URL. For example, assuming the base URL of
https://api.example.com/v1
, the/users
endpoint refers tohttps://api.example.com/v1/users
.Our comparison does not consider the impact of
basePath
as there may be multiple servers with different context paths and there is no clear way to resolve this ambiguity. In this example, a pact interaction with path/v1/users/
will not match an OAS that only has/users/
in its resource path.Ways to resolve ambiguity
https://server1/base/path
andhttps://server2/base/path
then we can assume a/base/path
is the correct onea. Fail with an error
b. Allow a user to annotate the OAS with
x-pactflow-<property>
which specifies thebasePath
for the purposes of cross-contract validationThe text was updated successfully, but these errors were encountered: