-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Closed
Description
I have a schema that I would like to use for both POST and PUT methods but a target parameter is allowed only for the POST request.
To make it clear let's imagine that there is a possibility to create and update a user.
At the POST it's required the name and the inviteCode, then for the PUT just the name and don't allow to edit the inviteCode anymore
components:
schemas:
user:
type: object
properties:
name:
type: string
inviteCode:
type: string
paths:
"/user":
post:
requestBody:
content:
application/json:
schema:
"$ref": "#/components/schemas/user"
"/user/{id}":
put:
parameters:
- name: id
in: path
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
"$ref": "#/components/schemas/user"Is there a way to do it by just adding a parameter to the inviteCode?
Metadata
Metadata
Assignees
Labels
No labels