Problem Statement
WebServicesManager::toOpenAPI() generates an OpenAPI 3.1.0 spec with paths and HTTP methods, but the generated spec is missing request parameters. Services that use #[RequestParam] annotations have their parameters configured dynamically at request time via configureParametersForMethod(), but the OpenAPI generator doesn't read these annotations during spec generation.
The result is a spec with correct paths and methods but no parameter definitions — making the Swagger UI less useful for API consumers.
Current Output
{
"paths": {
"/users": {
"get": {
"responses": { "200": { "description": "Successful operation" } }
},
"post": {
"responses": { "200": { "description": "Successful operation" } }
}
}
}
}
Expected Output
{
"paths": {
"/users": {
"get": {
"parameters": [
{ "name": "id", "in": "query", "schema": { "type": "integer" }, "required": false }
],
"responses": { "200": { "description": "Successful operation" } }
},
"post": {
"requestBody": {
"content": {
"application/x-www-form-urlencoded": {
"schema": {
"properties": {
"name": { "type": "string" },
"email": { "type": "string", "format": "email" }
},
"required": ["name", "email"]
}
}
}
},
"responses": { "200": { "description": "Successful operation" } }
}
}
}
}
Proposed Solution
During toOpenAPI() (or in WebService::toPathItemObj()), reflect on the service's methods to read #[RequestParam], #[GetMapping], #[PostMapping], etc. annotations and generate:
parameters array for GET/DELETE methods (query params)
requestBody for POST/PUT methods (form params)
description from the annotation's description field
required from the annotation's optional field
schema.type mapped from ParamType (STRING → string, INT → integer, EMAIL → string with format email, etc.)
This applies to all services that use PHP 8 attributes (#[RequestParam], #[MapEntity], #[ResponseBody]).
WebFiori Version
webfiori/http v5.0.6
Problem Statement
WebServicesManager::toOpenAPI()generates an OpenAPI 3.1.0 spec with paths and HTTP methods, but the generated spec is missing request parameters. Services that use#[RequestParam]annotations have their parameters configured dynamically at request time viaconfigureParametersForMethod(), but the OpenAPI generator doesn't read these annotations during spec generation.The result is a spec with correct paths and methods but no parameter definitions — making the Swagger UI less useful for API consumers.
Current Output
{ "paths": { "/users": { "get": { "responses": { "200": { "description": "Successful operation" } } }, "post": { "responses": { "200": { "description": "Successful operation" } } } } } }Expected Output
{ "paths": { "/users": { "get": { "parameters": [ { "name": "id", "in": "query", "schema": { "type": "integer" }, "required": false } ], "responses": { "200": { "description": "Successful operation" } } }, "post": { "requestBody": { "content": { "application/x-www-form-urlencoded": { "schema": { "properties": { "name": { "type": "string" }, "email": { "type": "string", "format": "email" } }, "required": ["name", "email"] } } } }, "responses": { "200": { "description": "Successful operation" } } } } } }Proposed Solution
During
toOpenAPI()(or inWebService::toPathItemObj()), reflect on the service's methods to read#[RequestParam],#[GetMapping],#[PostMapping], etc. annotations and generate:parametersarray for GET/DELETE methods (query params)requestBodyfor POST/PUT methods (form params)descriptionfrom the annotation'sdescriptionfieldrequiredfrom the annotation'soptionalfieldschema.typemapped fromParamType(STRING → string, INT → integer, EMAIL → string with format email, etc.)This applies to all services that use PHP 8 attributes (
#[RequestParam],#[MapEntity],#[ResponseBody]).WebFiori Version
webfiori/http v5.0.6