Is there a way to use a definition reference but exclude certain fields from it? For example, I have a definition for a model, which includes things like id, name, description, but when defining the schema for my POST route to create this resource, I don't want id to be included. Am I forced to manually recreate the definition?
It looks like this is an "old" issue and might be implemented in the future.
But I would like to use exclude={"id"} too :)
Sadly you can't exclude properties sometimes, you'll need to create 2 definitions per model. one with the id and one without.
You can reuse the ThingWithoutId annotation inside the ThingWithId by using the allOf composition
Most helpful comment
It looks like this is an "old" issue and might be implemented in the future.
But I would like to use
exclude={"id"}too :)