Skip to content

Using routeName in resource with xml configration generates an error #6031

@jphooiveld

Description

@jphooiveld

API Platform version(s) affected: 3.2

Description

Using routeName in resource with XML configuration generates an error. It works ok when using attributes.

The following error occurs in the console:

Element '{https://api-platform.com/schema/metadata/resources-3.0}operation', attribute 'routeName': The attribute 'routeName' is not allowed.

How to reproduce

The example is from your own documentation. See https://api-platform.com/docs/core/controllers/

<resources xmlns="https://api-platform.com/schema/metadata/resources-3.0"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
        https://api-platform.com/schema/metadata/resources-3.0.xsd">
    <resource class="App\Entity\Book">
        <operations>
            <operation class="ApiPlatform\Metadata\Get" />
            <operation class="ApiPlatform\Metadata\Post" name="post_publication" routeName="book_post_publication" />
            <operation class="ApiPlatform\Metadata\Post" name="book_post_discontinuation" />
        </operations>
    </resource>
</resources>

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