Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Autogenerated parameter name with MapQueryString are in snake_case instead of camelCase #2408

Open
Thomerdos opened this issue Dec 12, 2024 · 1 comment
Labels
bug stale stale issue/PR

Comments

@Thomerdos
Copy link

Version

4.33.4

Description

I'm not sure whether it's a bug or a config issue, i'm using this code :

<?php

namespace App\Query;

class SingleCaisseLocaleQuery
{
    public int $numTest;
}

In my controller

#[OA\Parameter(
        name: 'numTest',
        description: 'Numéro de caisse locale à rechercher',
        in: 'query',
        required: true,
        schema: new OA\Schema(type: 'integer', example: 678),
)]
public function getCaisseLocale(Request $request, #[MapQueryString] SingleCaisseLocaleQuery $filters): array

I except this code to generate a single parameter, but it actually generate two parameters, one from the controller attribut in camelCase and another from the MapQueryString numTest attribute in snake_case.

From the example in the documentation i thought it would be generated in camelCase but it doesn't seems to be the case.

JSON OpenApi

JSON OpenApi
"parameters": [
    {
        "name": "numTest",
        "in": "query",
        "description": "Num\u00e9ro de caisse locale \u00e0 rechercher",
        "required": true,
        "schema": {
            "type": "integer",
            "example": 678
        }
    },
    {
        "name": "num_test",
        "in": "query",
        "required": false,
        "schema": {
            "type": "integer"
        }
    }
],

Additional context

No response

@Thomerdos Thomerdos added the bug label Dec 12, 2024
Copy link

This issue has been marked as stale because it has not had any activity for 60 days. Remove stale label or comment to prevent this from being closed in 21 days.

@github-actions github-actions bot added the stale stale issue/PR label Mar 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug stale stale issue/PR
Projects
None yet
Development

No branches or pull requests

1 participant