Skip to content

Allow adding XML documents at runtime to OpenApi living inside a Nuget Package #64439

@FluentProgrammer

Description

@FluentProgrammer

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

Hi Maintainers,

Currently there doesn't seem to be an option to dynamically pass ie. the EntryAssembly XML documents to AddOpenApi() if AddOpenApi() lives inside a Nuget package which is referenced by the EntryAssembly. This means that we can't generate OpenApi documentation for Controllers/Models that live inside the EntryAssembly.

This is a similar issue to #62941 except assume the class library given in that sample repo is a Nuget package referenced by the EntryAssembly.

This feature was previously possible when using Swashbuckle.WebApi.

Example Scenario:

  1. Create Organisation.Common Nuget package with WebApplication.CreateBuilder() and all the common bootstrapping code along with AddOpenApi() and MapOpenApi() in it.
  2. EntryAssembly which as Program.Main() references the Organisation.Common Nuget Package
  3. EntryAssembly calls the common bootstrapper code.
  4. Enable XML documentation for EntryAssembly.
  5. Build and run EntryAssembly.
  6. No OpenAPI documentation is produced for the Controllers and Models in EntryAssembly.

Thanks

Describe the solution you'd like

Provide a way to dynamically pass XML documenation files to AddOpenApi() just like SwashBuckle so that if an Organisation has a Nuget package with all the common bootstrap code in it then OpenApi documentation can still be generated for the Controllers and Models in the EntryAssembly.

Additional context

Enable XML documentation in an ASP.NET Core API project

Swashbuckle.WebApi.

#62941

Microsoft.AspNetCore.OpenApi 10.0.0

dotnet --version
10.0.100

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcfeature-openapi

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions