Skip to content

Conversation

@gabr0236
Copy link
Contributor

@gabr0236 gabr0236 commented Dec 3, 2025

Updates the IOpenApiDocumentProvider example in
aspnetcore/fundamentals/openapi/using-openapi-documents.md to:

  • Inject the provider as a keyed service using [FromKeyedServices("v1")].
  • Call GetOpenApiDocumentAsync with an optional CancellationToken instead of a document name.
  • Note that the service key "v1" must match the name passed to AddOpenApi.

The previous sample did not compile (because GetOpenApiDocumentAsync does not take a document name parameter) and did not reflect the keyed registration used by AddOpenApi("v1").


Internal previews

📄 File 🔗 Preview link
aspnetcore/fundamentals/openapi/using-openapi-documents.md aspnetcore/fundamentals/openapi/using-openapi-documents

@gabr0236
Copy link
Contributor Author

gabr0236 commented Dec 3, 2025

@captainsafia FYI

@guardrex guardrex requested a review from captainsafia December 3, 2025 10:54
@guardrex
Copy link
Collaborator

guardrex commented Dec 30, 2025

Hi @gabr0236! Sorry for the delay. I don't think Safia saw the ping. I sent her an email. Give her a little time to respond due to the holidays. Most of us are either totally OOF or working limited days until the first week of January. Happy New Year! 🥳

BTW ... Please resolve the conflict, so she can see the changes that you're requesting.

@guardrex guardrex self-assigned this Dec 30, 2025
Updates the `IOpenApiDocumentProvider` example in
`aspnetcore/fundamentals/openapi/using-openapi-documents.md` to:

* Inject the provider as a keyed service using `[FromKeyedServices("v1")]`.
* Call `GetOpenApiDocumentAsync` with an optional `CancellationToken` instead of a document name.
* Note that the service key `"v1"` must match the name passed to `AddOpenApi`.

The previous sample did not compile and did not reflect the keyed registration used by `AddOpenApi("v1")`.
@gabr0236
Copy link
Contributor Author

Hi @guardrex, no worries. I resolved the conflicts. Happy new years!

@guardrex

This comment was marked as resolved.

@guardrex
Copy link
Collaborator

guardrex commented Jan 13, 2026

@gabr0236 ... Please sign the CLA if you agree to its terms 👇. We can't accept the PR without it.

@captainsafia ... Please see the diff now. I made the changes that you suggested.

@gabr0236
Copy link
Contributor Author

@dotnet-policy-service agree

@gabr0236
Copy link
Contributor Author

@guardrex sorry for the delay - thank you for resolving the comments!

Copy link
Collaborator

@guardrex guardrex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @gabr0236! 🚀 I think Safia's suggestions are covered, so we'll go ahead without a final look from her.

@guardrex guardrex merged commit e8205f8 into dotnet:main Jan 15, 2026
4 checks passed
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.

3 participants