Forum Discussion

JozefAerts's avatar
New Contributor
3 years ago

multiple PATCH

I am pretty new to OpenAPI ...
I have been asked to add "PATCH" operations to an API spec (in YAML). This works fine for a single component, but I do not know how to do this when there are several components in an object that can/should be updated.
To take the classic example of "Person", the person has an Id (which cannot be updated), a first name, a last name, a birth date, and an array of hobbies.
How do I describe in YAML that "first name" can be separately updated, as well as "last name", "birth date", and an hobby in the arrary can be added, replaced, or deleted, all using "PATCH"?
Does anyone have sample code in YAML?
Many thanks in advance!

2 Replies