-
Notifications
You must be signed in to change notification settings - Fork 286
Add all "Annotations" to OpenApiSchemaReference #2369
Copy link
Copy link
Labels
priority:p2Medium. Generally has a work-around and a smaller sub-set of customers is affected. SLA <=30 daysMedium. Generally has a work-around and a smaller sub-set of customers is affected. SLA <=30 daystype:enhancementEnhancement request targeting an existing experienceEnhancement request targeting an existing experience
Milestone
Description
Activity
Metadata
Metadata
Assignees
Labels
priority:p2Medium. Generally has a work-around and a smaller sub-set of customers is affected. SLA <=30 daysMedium. Generally has a work-around and a smaller sub-set of customers is affected. SLA <=30 daystype:enhancementEnhancement request targeting an existing experienceEnhancement request targeting an existing experience
Currently we can only set
descriptionas an annotation on an OpenApiSchemaReference. With OpenApi 3.1 and Json Schema 2020-12 it's allowed to apply all annotations on a reference.Annotations: https://json-schema.org/understanding-json-schema/reference/annotations#annotations
Spec: https://json-schema.org/draft/2020-12/json-schema-core#section-7.7.1.1
Meta data schema: json-schema.org/draft/2020-12/meta/meta-data
Why
When mapping nested classes to OpenApi in ASP.NET Core it uses comments to apply annotations like title, description, examples. But this is currently limited to only apply a description for a reference. In the [example](https://json-schema.org/understanding-json-schema/reference/annotations#annotations
Spec: https://json-schema.org/draft/2020-12/json-schema-core#section-7.7.1.1) provided in the spec it would be awesome to be able to set different metadata on properties (which become references).
Links
Related issue: dotnet/aspnetcore#61965