Skip to content

Commit fdce77f

Browse files
authored
Merge pull request #1204 from OAI/path-templating-clarifications
Clarified path matching
2 parents 1a7ea68 + 9a9ef7a commit fdce77f

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

versions/3.0.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,10 +632,33 @@ The path is appended to the URL from the [`Server Object`](#serverObject) in ord
632632

633633
Field Pattern | Type | Description
634634
---|:---:|---
635-
<a name="pathsPath"></a>/{path} | [Path Item Object](#pathItemObject) | A relative path to an individual endpoint. The field name MUST begin with a slash. The path is **appended** (no relative URL resolution) to the expanded URL from the [`Server Object`](#serverObject)'s `url` field in order to construct the full URL. [Path templating](#pathTemplating) is allowed.
635+
<a name="pathsPath"></a>/{path} | [Path Item Object](#pathItemObject) | A relative path to an individual endpoint. The field name MUST begin with a slash. The path is **appended** (no relative URL resolution) to the expanded URL from the [`Server Object`](#serverObject)'s `url` field in order to construct the full URL. [Path templating](#pathTemplating) is allowed. When matching URLs, concrete (non-templated) paths would be matched before their templated counterparts. Templated paths with the same hierarchy but different templated names MUST NOT exist as they are identical. In case of ambiguous matching, it's up to the tooling to decide which one to use.
636636

637637
This object can be extended with [Specification Extensions](#specificationExtensions).
638638

639+
##### Path Templating Matching
640+
641+
Assuming the following paths, the concrete definition, `/pets/mine`, will be matched first if used:
642+
643+
```
644+
/pets/{petId}
645+
/pets/mine
646+
```
647+
648+
The following paths are considered identical and invalid:
649+
650+
```
651+
/pets/{petId}
652+
/pets/{name}
653+
```
654+
655+
The following may lead to ambiguous resolution:
656+
657+
```
658+
/{entity}/me
659+
/books/{id}
660+
```
661+
639662
##### Paths Object Example
640663

641664
```json

0 commit comments

Comments
 (0)