data-api-builder icon indicating copy to clipboard operation
data-api-builder copied to clipboard

[Bug]: Swagger UI shows duplicate entity groups for single entity definition

Open JerryNixon opened this issue 2 months ago • 0 comments

When using Data API builder 1.7.75, the Swagger UI generated at /api/openapi displays the Actor entity twice, even though Actor is defined only once in the configuration. No other entity shares its REST path or alias.

I think this has to do with descriptions

Image

Steps to Reproduce:

  1. Use this configuration (trimmed for brevity):

    {
      "entities": {
        "Actor": {
          "source": { "object": "dbo.Actor", "type": "table" },
          "rest": { "enabled": true, "path": "/Actor" }
        },
        "Character": {
          "source": { "object": "dbo.Character", "type": "table" },
          "rest": { "enabled": true, "path": "/Character" }
        },
        "SeriesActors": {
          "source": { "object": "dbo.SeriesActors", "type": "view" },
          "rest": { "enabled": true, "path": "/SeriesActors" }
        },
        "GetSeriesActors": {
          "source": { "object": "dbo.GetSeriesActors", "type": "stored-procedure" },
          "rest": { "enabled": true, "path": "/GetSeriesActors", "methods": ["post"] }
        }
      }
    }
    
  2. Start DAB (dab start --config dab-config.json).

  3. Open the Swagger UI at /api/openapi.

Expected Behavior: Each entity should appear once under its respective REST path group.

Actual Behavior: Swagger shows two separate groups labeled Actor, each listing the same endpoints (GET, PUT, PATCH, DELETE, POST).

Environment:

  • Data API builder version: 1.7.75
  • Database: SQL Server
  • Host: Azure Container Apps
  • Authentication: StaticWebApps provider

Notes:

  • No other entity defines path: "/Actor".
  • The duplication persists even when unrelated entities (like stored procedures or views) are removed.
  • Suggest investigating the Swagger document generator—likely a duplicate path or tag registration in OpenApiDocumentBuilder.

JerryNixon avatar Nov 12 '25 04:11 JerryNixon