Skip to content

[Swagger] Undefined array key "$ref" since 3.1.6 #5501

@DeLm0re

Description

@DeLm0re

API Platform version(s) affected: 3.1.6

Description

Since this new version, it is impossible to acces my swagger documentation via /api

For instance for a simple entrypoint like this one

new Metadata\GetCollection(
    routeName: 'api_get_user',
    openapi: new Model\Operation(
        responses: [
            Response::HTTP_UNAUTHORIZED => new Model\Response(ResponseMessage::UNAUTHORIZED),
        ],
        parameters: [
            new Model\Parameter(
                name: 'id',
                in: 'query',
                description: 'The User identifier',
                schema: ['type' => 'object'],
                style: 'deepObject',
                explode: true,
            ),
            new Model\Parameter(
                name: 'name|lastname|username',
                in: 'query',
                description: 'The User denomination',
                schema: ['type' => 'object'],
                style: 'deepObject',
                explode: true,
            ),
        ],
    ),
),

causes a 500 error

Capture d’écran 2023-03-27 à 18 12 04

Additional Context

I'm working on MacOs, Php 8.1, Symfony 6.2.7, doctrine-bundle 2.9.
Everything is working fine on 3.1.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions