Skip to content

Duplication of query parameter if it's a reference #2314

Open
@jneidel

Description

@jneidel

Version

4.28.0

Description

Referencing a parameter defined in components duplicates the parameter in the rendered output.

Screenshot 2024-07-15 at 12 38 40
 * @Nelmio\Operation(
 *     @OA\Parameter(ref="#/components/parameters/limit"),
 *      ...
 *
 * @FOS\RestBundle\Controller\Annotations\QueryParam(name="limit", requirements="[1-9]\d*", description="Limit", default="20", strict=true) 
# config/nelmio_api_doc.yaml
nelmio_api_doc:
    documentation:
        components:
            parameters:
                limit:
                    name: limit
                    in: query
                    example: 20
                    description: "How many entries per page?"
                    schema:
                        type: integer

working alternative

Compared to this case where there is no duplication:

@OA\Parameter(name="limit", in="query", description="How many entries per page?", required=false, @OA\Schema(type="string")),
Screenshot 2024-07-15 at 12 40 28

Additional context

Seems similar to the problems described in #1739 and #1407

The error does not happen on parameters of in: path

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions