-
-
Notifications
You must be signed in to change notification settings - Fork 951
Open
Labels
Description
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>