Skip to content

Make SwaggerCommand yml compatible w/ openapi-generator #2285

@Cethy

Description

@Cethy

As is, using openapi-generator after bin/console api:swagger:export -y -o swagger.yaml result in a failure because the empty arrays are converted as empty objects (and openapi-generator does not like that).

Adding the Yaml::DUMP_EMPTY_ARRAY_AS_SEQUENCE mask to Yaml::dump fixes the problem :

Yaml::dump($data, 6, 4, Yaml::DUMP_OBJECT_AS_MAP | Yaml::DUMP_EMPTY_ARRAY_AS_SEQUENCE);

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