Skip to content

Add all "Annotations" to OpenApiSchemaReference #2369

@desjoerd

Description

@desjoerd

Currently we can only set description as 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

Metadata

Metadata

Assignees

Labels

priority:p2Medium. Generally has a work-around and a smaller sub-set of customers is affected. SLA <=30 daystype:enhancementEnhancement request targeting an existing experience

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions