Open
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
Activity