Bug Report Checklist
Description
When generating PHP server code using openapi-generator, query parameters are read from the Symfony request using paramName instead of the OpenAPI‑defined baseName.
This causes query parameters not to be read correctly whenever:
paramName ≠ baseName (e.g. camelCase vs snake_case)
the OpenAPI parameter uses snake_case (common in OCPI / REST APIs)
As a result:
optional query parameters are silently ignored
filtering logic behaves incorrectly
generated controllers are not compliant with the OpenAPI contract
openapi-generator version
Observed with: 7.21.0-SNAPSHOT
Also reproducible with: latest master at the time of testing
This does not appear to be a regression; behavior exists in current releases.
OpenAPI declaration file content or url
openapi: 3.0.3
info:
title: Test API
version: 1.0.0
paths:
/test:
get:
parameters:
- name: date_from
in: query
schema:
type: string
responses:
'200':
description: OK
In this case:
baseName = date_from
paramName = dateFrom
Generation Details
openapi-generator-cli generate
-g php-symfony
-i openapi.yaml
-o generated
--additional-properties=phpVersion=8.1
``
No custom templates used.
Steps to reproduce
- Define a query parameter using snake_case in OpenAPI
- Generate PHP Symfony server code
- Call the endpoint with ?date_from=...
- Observe that the parameter value is null in the controller
Related issues/PRs
No existing issue found that explicitly addresses the paramName vs baseName mismatch for PHP Symfony server generators.
Suggest a fix
- ${{paramName}} = $request->query->get('{{paramName}}'{{#defaultValue}}, {{{.}}}{{/defaultValue}});
+ ${{paramName}} = $request->query->get('{{baseName}}'{{#defaultValue}}, {{{.}}}{{/defaultValue}});
Bug Report Checklist
Description
When generating PHP server code using openapi-generator, query parameters are read from the Symfony request using paramName instead of the OpenAPI‑defined baseName.
This causes query parameters not to be read correctly whenever:
paramName ≠ baseName (e.g. camelCase vs snake_case)
the OpenAPI parameter uses snake_case (common in OCPI / REST APIs)
As a result:
optional query parameters are silently ignored
filtering logic behaves incorrectly
generated controllers are not compliant with the OpenAPI contract
openapi-generator version
Observed with: 7.21.0-SNAPSHOT
Also reproducible with: latest master at the time of testing
This does not appear to be a regression; behavior exists in current releases.
OpenAPI declaration file content or url
In this case:
baseName = date_from
paramName = dateFrom
Generation Details
openapi-generator-cli generate
-g php-symfony
-i openapi.yaml
-o generated
--additional-properties=phpVersion=8.1
``
No custom templates used.
Steps to reproduce
Related issues/PRs
No existing issue found that explicitly addresses the paramName vs baseName mismatch for PHP Symfony server generators.
Suggest a fix