Skip to content

Support in-memory only metadata dictionary in OpenAPI object modelΒ #1719

@captainsafia

Description

@captainsafia

Is your feature request related to a problem? Please describe.
Currently, all properties within the OpenAPI object model are serialized to the output as part of the OpenAPI writer implementation. This makes it difficult to manage temporary state associated with the in-memory OpenAPI model. For example, ASP.NET Core needs to correlate a given OpenApiOperation with a unique identifier for each endpoint recognized by the framework.

Describe the solution you'd like
The OpenAPI object model should support some sort of property bag that allows users to manage metadata associated with an object model in-memory without having to worry about information in this property bag being serialized.

public class OpenApiHasPropertyBag
{
	IDictionary<string, object> MetadataCollection { get; }
}

Describe alternatives you've considered
Currently, ASP.NET Core works around this limitation by storing the metadata in the Extensions property on OpenApiSchema and OpenApiOperation then scrubbing this metadata out from the in-memory model before it is serialized. This presents a couple of issues:

  • The additional cost of having to scrub out metadata that doesn't need to be serialized
  • The additional cost of mapping property bag values to OpenApiAny implementers

Metadata

Metadata

Assignees

Labels

WIPpriority:p1High priority but not blocking. Causes major but not critical loss of functionality SLA <=7days

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions