-
I have two endpoints. One for POST, one for PATCH. Both take 20+ params, PATCH taking one extra (the ID to update). How do I share a set of 20 params between POST and PATCH? The docs don't indicate that this is possible, which means I'm looking at having to duplicate the set of 20+ params in both the POST and PATCH definitions. The params component only takes individual params, which means I'd still need to duplicate some code (duplicate arrays of param references). What I'm hoping to be able to do is something like: paths:
/api/v2/users:
post:
parameters:
$ref: "#/components/parameterSet/User"
/api/v2/users:
patch:
parameters:
$ref: "#/components/parameterSet/User"
components:
parameterSet:
User:
- name: first_name
in: query
description: "Must not contain numbers or any of the following special characters !@#$%^&*()"
required: true
schema:
type: string
explode: false
example: "John"
- name: last_name
in: query
description: "Must not contain numbers or any of the following special characters !@#$%^&*()"
required: true
schema:
type: string
explode: false
example: "Smith" Is this possible at all using Schemas? It doesn't appear so but I could be missing something. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Just to clarify - are these parameters query parameters, or are they request body fields? I'm asking because your example looks like CRUD, and the typical CRUD design is
rather than |
Beta Was this translation helpful? Give feedback.
-
Looks like this was answered, closing. |
Beta Was this translation helpful? Give feedback.
Just to clarify - are these parameters query parameters, or are they request body fields?
I'm asking because your example looks like CRUD, and the typical CRUD design is
rather than
POST /users?field1=value1&...
.