Skip to content

Add ILoggerFactory-injection to ApiDescriptionGroupCollectionProvider #57295

Open
@captainsafia

Description

@captainsafia

Background and Motivation

To improve the diagnosability of the OpenAPI layer, we'd like to provide logs so that users can understand what components are contributing custom IApiDescriptionProvider implementations to the ApiExplorer layer. In order to support this scenario, we need to support injecting an ILoggerFactory instance to the ApiDescriptionGroupCollectionProvider class that invokes all the discovered IApiDescriptionProvider instances.

Proposed API

- public class ApiDescriptionGroupCollectionProvider : IApiDescriptionGroupCollectionProvider
+ public partial class ApiDescriptionGroupCollectionProvider : IApiDescriptionGroupCollectionProvider
{
+ public ApiDescriptionGroupCollectionProvider(
+       IActionDescriptorCollectionProvider actionDescriptorCollectionProvider,
+       IEnumerable<IApiDescriptionProvider> apiDescriptionProviders,
+       ILoggerFactory loggerFactory)
}

Alternative Designs

  • Add a new internal-only implementation of ApiDescriptionGroupCollectionProvider and support ILoggerFactory injection in its constructors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    api-approvedAPI was approved in API review, it can be implementedarea-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcarea-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesfeature-openapi

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions