-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
Which Umbraco version are you using?
16.2.0 and 16.3.3
Bug summary
When the Content Delivery API v2 is enabled, both the /umbraco/delivery/api/v2/content and /umbraco/delivery/api/v2/media GET endpoints generate the same operationId: "QueryV20" in the OpenAPI/Swagger JSON.
This causes conflicts in OpenAPI clients (e.g. NSwag, Swagger Codegen, OpenAPI Generator) and breaks client generation.
Specifics
Each endpoint should have a unique operationId, e.g.:
"/umbraco/delivery/api/v2/content": { "get": { "operationId": "GetContent2.0" } }
"/umbraco/delivery/api/v2/media": { "get": { "operationId": "GetMedia2.0" } }
And what I got is:
"/umbraco/delivery/api/v2/content": { "get": { "operationId": "QueryV20" } }
"/umbraco/delivery/api/v2/media": { "get": { "operationId": "QueryV20" } }
Steps to reproduce
Create a new Umbraco project:
dotnet new umbraco -n UmbracoBugDemo
cd UmbracoBugDemo
Update to the latest version (16.3.3): Edit your .csproj file:
<PackageReference Include="Umbraco.Cms" Version="16.3.3" />
Restore packages and build:
dotnet restore
dotnet build
Enable Delivery API v2 in appsettings.json:
{
"Umbraco": {
"CMS": {
"DeliveryApi": {
"Enabled": true,
"ApiVersion": "v2"
}
}
}
}
Run the application:
dotnet run
Access Swagger UI:
https://localhost:5001/swagger/index.html
(Port may vary; check console output)
Locate the endpoints in Swagger UI:
- GET /umbraco/delivery/api/v2/content
- GET /umbraco/delivery/api/v2/media
Download/Inspect the OpenAPI JSON:
https://localhost:5001/swagger/v1/swagger.json
Verify the issue in the JSON:
{
"paths": {
"/umbraco/delivery/api/v2/content": {
"get": {
"operationId": "QueryV20" // ← DUPLICATE
}
},
"/umbraco/delivery/api/v2/media": {
"get": {
"operationId": "QueryV20" // ← DUPLICATE
}
}
}
}
Expected vs. Actual
Expected:
- GetContent2.0 for /content
- GetMedia2.0 for /media
Actual:
- QueryV20 for both → Duplicate Conflict
Expected result / actual result
No response