OAI / OAI/OpenAPI-Specification

Clarification required for templated paths with same hierarchy but different templated names and methods

Open
#2,530 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

clarification request matching
Dominant language
Markdown
Stars
31.2k
Forks
9.2k
Avg merge
6h 37m
Merged PRs (30d)
27

Description

This is alluded to by @kapone89 in Issue 2015 but I believe it warrants an issue of its own to get clarification.

The spec states clearly that "Templated paths with the same hierarchy but different templated names MUST NOT exist as they are identical."

But what it there are there are two templated paths which differ by templated names and also HTTP methods? There is no ambiguity between them, as long as there is only a single path for each method, so I can't see any justification for disallowing this; the example provided by in Issue 2015 is:

GET /pets/{petId}
DELETE /pets/{name}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read the OpenAPI 3.0.3 Patterned Fields section and the linked Issue 2015 comment, then compare the rule with the GET /pets/{petId} and DELETE /pets/{name} example. Done means the specification explicitly clarifies whether differing templated names are allowed when HTTP methods differ.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi
Domain
api, documentation
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.