Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Yaml] Dumping with no value (like Docker Compose volumes section) isn't supported #58155

Closed
@gremo

Description

@gremo

Symfony version(s) affected

7.1

Description

There is no way to dump a YAML section "without values".

How to reproduce

Dumping the following "Docker Compose volumes section":

$yaml = Yaml::dump([
  'volumes' => [
    'db-data' => null,
  ],
]);

Will result in:

volumes:
    db-data: null

Using an empty string istead will result in:

volumes:
    db-data: ''

There is actually no way to dump "without value" like:

volumes:
    db-data:

Possible Solution

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions