-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed
Labels
Needs: Attention 👋This issue needs the attention of a contributor, typically because the OP has provided an update.This issue needs the attention of a contributor, typically because the OP has provided an update.area-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesfeature-openapi
Milestone
Description
How can I access OpenApiDocument
with new OpenApi package ?
I can see that today the only options are during build time and using the mapped endpoint, but will only have the jsom/yaml file. I wanted to access the OpenApiDocument
at runtime so I can work with some metadata I need to expose based on the OpenApiDocument
.
Here where I found the endpoint mapped that access OpenApiDocumentService
to generate the OpenApi document, but they are all internal classes.
endpoints.MapGet(pattern, async (HttpContext context, string documentName = OpenApiConstants.DefaultDocumentName) =>
{
...
var documentService = context.RequestServices.GetKeyedService<OpenApiDocumentService>(lowercasedDocumentName);
....
var document = await documentService.GetOpenApiDocumentAsync(context.RequestServices, context.RequestAborted);
....
}
Thanks
Metadata
Metadata
Assignees
Labels
Needs: Attention 👋This issue needs the attention of a contributor, typically because the OP has provided an update.This issue needs the attention of a contributor, typically because the OP has provided an update.area-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesfeature-openapi