Created from quarkiverse/quarkus-openapi-generator#876 (reply in thread) discussion.
Having the followin OpenAPI:
issue.json
{
"openapi": "3.0.3",
"info": {
"title": "Example API",
"version": "1.0.0"
},
"paths": {
"/v1/inventory": {
"get": {
"tags": ["InventoriesResource"],
"summary": "Retrieve inventories",
"responses": {
"200": {
"description": "A list of inventories",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"example": "inv-123"
},
"name": {
"type": "string",
"example": "Main warehouse"
},
"quantity": {
"type": "integer",
"example": 100
}
}
}
}
}
}
}
}
}
},
"/v1/permissions/inventories": {
"get": {
"tags": ["PermissionsResource"],
"summary": "Retrieve permissions",
"responses": {
"200": {
"description": "A list of inventory permissions",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"type": "object",
"properties": {
"userId": {
"type": "string",
"example": "user-456"
},
"inventoryId": {
"type": "string",
"example": "inv-123"
},
"permission": {
"type": "string",
"example": "READ"
}
}
}
}
}
}
}
}
}
}
}
}
The apicurio-codegen looks the first part of the path /v1 and create a resource called V1Resource instead creating V1PermissionsInventories.
I think it would be great if the apicurio-codegen generates per path and not per path prefix.
cc: @EricWittmann
Created from quarkiverse/quarkus-openapi-generator#876 (reply in thread) discussion.
Having the followin OpenAPI:
issue.json
{ "openapi": "3.0.3", "info": { "title": "Example API", "version": "1.0.0" }, "paths": { "/v1/inventory": { "get": { "tags": ["InventoriesResource"], "summary": "Retrieve inventories", "responses": { "200": { "description": "A list of inventories", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "example": "inv-123" }, "name": { "type": "string", "example": "Main warehouse" }, "quantity": { "type": "integer", "example": 100 } } } } } } } } } }, "/v1/permissions/inventories": { "get": { "tags": ["PermissionsResource"], "summary": "Retrieve permissions", "responses": { "200": { "description": "A list of inventory permissions", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "userId": { "type": "string", "example": "user-456" }, "inventoryId": { "type": "string", "example": "inv-123" }, "permission": { "type": "string", "example": "READ" } } } } } } } } } } } }The apicurio-codegen looks the first part of the path
/v1and create a resource calledV1Resourceinstead creatingV1PermissionsInventories.I think it would be great if the apicurio-codegen generates per path and not per path prefix.
cc: @EricWittmann