Skip to content

[Yaml] Parse error when comment on another indent level #16065

@PeterFour

Description

@PeterFour

New merge commit 2ff0f97
(from parent commit 150f52f and issue #15860 )
just cause an error on Yaml file with different comment level.

This file will throw an exception :

services:
# Session Handler (Inactivity Logout)
    app.handler.session_idle:
        class: AppBundle\Handler\SessionIdleHandler
        arguments: ["@session", "@security.token_storage", "@router", %session_max_idle_time%]
        tags:
            - { name: kernel.event_listener, event: kernel.request, method: onKernelRequest }

but this one is not (note the comment position):

services:
    # Session Handler (Inactivity Logout)
    app.handler.session_idle:
        class: AppBundle\Handler\SessionIdleHandler
        arguments: ["@session", "@security.token_storage", "@router", %session_max_idle_time%]
        tags:
            - { name: kernel.event_listener, event: kernel.request, method: onKernelRequest }

I think the error is caused especially if you put a comment between two entries, but you keep the comment on root level

Is it a changes in Yaml syntax ?

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