/users/{id} and /users/{name} cannot both exist. However, this is not checked in the metaschema (due to an inability to express this in JSON Schema), and we don't check for it in code either.
We can check for this by replacing all placeholders in paths with a token that would be illegal in a URI (say a control character) and then checking for uniqueness (use bits of the PP implementation of uniq, that uses a %seen hash for counting occurrences).
/users/{id}
and/users/{name}
cannot both exist. However, this is not checked in the metaschema (due to an inability to express this in JSON Schema), and we don't check for it in code either.We can check for this by replacing all placeholders in paths with a token that would be illegal in a URI (say a control character) and then checking for uniqueness (use bits of the PP implementation of
uniq
, that uses a %seen hash for counting occurrences).