-
Notifications
You must be signed in to change notification settings - Fork 25k
Fix IOpenApiDocumentProvider injection sample (keyed DI) #36426
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
Conversation
|
@captainsafia FYI |
|
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. |
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")`.
|
Hi @guardrex, no worries. I resolved the conflicts. Happy new years! |
This comment was marked as resolved.
This comment was marked as resolved.
|
@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. |
|
@dotnet-policy-service agree |
|
@guardrex sorry for the delay - thank you for resolving the comments! |
guardrex
left a comment
There was a problem hiding this 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.
Updates the IOpenApiDocumentProvider example in
aspnetcore/fundamentals/openapi/using-openapi-documents.mdto:The previous sample did not compile (because
GetOpenApiDocumentAsyncdoes not take a document name parameter) and did not reflect the keyed registration used byAddOpenApi("v1").Internal previews