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!
Hey @JozefAerts. I did some looking around, and I found this post on Stack Overflow that looks to be dealing with the same question you have. There are a few proposed solutions. Let me know if they help!
Many thanks! That is really helpful!
Inspired by that, I just also found https://swagger.io/docs/specification/data-models/oneof-anyof-allof-not/
which also looks like a very good solution for my case.