Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for unserializable annotations on OpenAPI document #1769

Merged
merged 1 commit into from
Aug 5, 2024

Conversation

captainsafia
Copy link
Member

Addresses #1719.

This PR adds support for unserizable property bags to the OpenApiDocument,OpenApiOperation, and OpenApiSchema` to support managing in-memory metadata about a given OpenAPI instance without having these properties embedded into the serialized document.

  • I landed on Annotations and IOpenApiAnnotatable as the names used in this API to align with the "ble" naming style used elsehwere. Open to other name ideas.
  • Annotations are not eagerly initialized by the API to avoid allocating them when not necessary. It's up to the end-user to initialize the dictionary before appending elements to it.
  • The interface is applied only to the OpenApiDocument, OpenApiOperation, and OpenApiSchema types at the moment to support ASP.NET Core's scenarios. We can evaluate what other types it makes sense to apply this interface to.
  • The Annotatations property uses the same copy semantics used by other Dictionary properties in the copy constructor.

@captainsafia
Copy link
Member Author

@MaggieKimani1 @darrelmiller Any change we can merge and publish this to v1.6.x soon? I'd like to update the Microsoft.OpenApi dependency in ASP.NET Core before we ship RC1.

@MaggieKimani1
Copy link
Contributor

@MaggieKimani1 @darrelmiller Any change we can merge and publish this to v1.6.x soon? I'd like to update the Microsoft.OpenApi dependency in ASP.NET Core before we ship RC1.

Hey @captainsafia,
I think this is ready for merging. I can work on getting out a release for you tomorrow.

@MaggieKimani1 MaggieKimani1 merged commit 7876018 into microsoft:vnext Aug 5, 2024
6 checks passed
@MaggieKimani1
Copy link
Contributor

@captainsafia v1.6.17 is now GA.🙂

@captainsafia
Copy link
Member Author

@MaggieKimani1 Thanks! I've updated ASP.NET Core to use the new version. We'll be going live with it for .NET 9 RC1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants