Skip to content

[9.0-preview.4] Remove default tag with the assembly name from OpenAPI document #55884

@joegoldman2

Description

@joegoldman2

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.

Similar to #55832, I wonder what the purpose of the default tag which contains the name of the assembly is, at document level and for each operation.

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddOpenApi();

var app = builder.Build();

if (app.Environment.IsDevelopment())
{
    app.MapOpenApi();
}

app.MapGet("/", () => "Hello world!");

app.Run();

It produces the following documentation:

{
  "openapi": "3.0.1",
  "info": {
    "title": "OrderApi | v1",
    "version": "1.0.0"
  },
  "paths": {
    "/": {
      "get": {
        "tags": [
          "OrderApi"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "x-aspnetcore-id": "3859a3eb-53ea-41d9-95bb-6b491227c87f"
      }
    }
  },
  "tags": [
    {
      "name": "OrderApi"
    }
  ]
}

where OrderApi is the name of the assembly.

It leaks the name of the assembly which can be an internal name, and a user may not want to disclose it if the document is internet-facing.

Describe the solution you'd like

The tag containing the name of the assembly should not be added by default, even if it can easily be removed using a transformer.

Additional context

No response

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

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions