The OpenAPI specification allows for templating of paths. While this is a powerful tool to capture parameters in a route's path, it can lead to ambiguous or masking path definitions. For a given path root, pay attention to not defined more that one templated segment. Also avoid defining both a templated segment and a non-templated segment for the same path root.

Noncompliant Code Example

In this example, the {transactionId} segment is always being masked by the non-templated purge segment. The first route will never be invoked.

/v1/transactions/{transactionId}
/v1/transactions/purge

In this example, both paths are templated, leading to undefined behaviour. Depending on the server's implementation, one route may never be called.

/v1/{server}/destroy
/v1/{transaction}/destroy

Compliant Solution

Define your paths in a non-ambiguous way, so that they don't collide.

/v1/transactions/{transactionId}
/v1/transactions/{transactionId}/purge

/v1/servers/{server}/destroy
/v1/transactions/{transaction}/destroy