-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Closed
Description
According to the specification, each defined path parameter must correspond to a same-named variable placeholder in the path:
name: If
inis"path", the name field MUST correspond to the associated path segment from the path field in the Paths Object. See Path Templating for further information.
There is no information about what is a valid name. Is there any restriction/recommendation about the characters that should or must be used?
For example, for:
GET <server>/api/231
231 corresponds to the path parameter.
In the following example with the name is todoID:
openapi: 3.0.1
info:
title: Todo Backend
version: '1.0'
paths:
'/api/{todoID}':
get:
parameters:
- name: todoID
description: The id of the todo
schema:
format: int64
type: integer
in: path
required: true
responses:
'200':
description: OK
summary: Get one todoAn other example with todo-id:
openapi: 3.0.1
info:
title: Todo Backend
version: '1.0'
paths:
'/api/{todo-id}':
get:
parameters:
- name: todo-id
description: The id of the todo
schema:
format: int64
type: integer
in: path
required: true
responses:
'200':
description: OK
summary: Get one todoAre both names (todoID and todo-id) allowed?
Metadata
Metadata
Assignees
Labels
No labels