-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add api configuration for Product and ProductTranslation
- Loading branch information
Showing
6 changed files
with
82 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/Sylius/Bundle/ApiBundle/Resources/config/api_resources/ProductTranslation.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?xml version="1.0" ?> | ||
|
||
<resources xmlns="https://api-platform.com/schema/metadata" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="https://api-platform.com/schema/metadata https://api-platform.com/schema/metadata/metadata-2.0.xsd"> | ||
|
||
<resource | ||
class="%sylius.model.product_translation.class%" | ||
shortName="ProductTranslation" | ||
> | ||
<attribute name="validation_groups">sylius</attribute> | ||
<collectionOperations /> | ||
<itemOperations> | ||
<itemOperation name="get" /> | ||
</itemOperations> | ||
<property name="id" identifier="true" writable="false" /> | ||
<property name="name" identifier="false" required="true" /> | ||
<property name="locale" identifier="false" required="true" /> | ||
<property name="slug" identifier="false" required="true" /> | ||
<property name="description" identifier="false" required="false" /> | ||
<property name="metaKeywords" identifier="false" required="false" /> | ||
<property name="metaDescription" identifier="false" required="false" /> | ||
<property name="shortDescription" identifier="false" required="false" /> | ||
</resource> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/Sylius/Bundle/ApiBundle/Resources/config/serializer/ProductTranslation.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?xml version="1.0" ?> | ||
|
||
<serializer xmlns="http://symfony.com/schema/dic/serializer-mapping" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://symfony.com/schema/dic/serializer-mapping https://symfony.com/schema/dic/serializer-mapping/serializer-mapping-1.0.xsd"> | ||
|
||
<class name="Sylius\Component\Product\Model\ProductTranslation"> | ||
<attribute name="id"> | ||
<group>product:read</group> | ||
</attribute> | ||
<attribute name="name"> | ||
<group>product:read</group> | ||
<group>product:create</group> | ||
<group>product:update</group> | ||
</attribute> | ||
<attribute name="locale"> | ||
<group>product:create</group> | ||
<group>product:update</group> | ||
</attribute> | ||
<attribute name="slug"> | ||
<group>product:create</group> | ||
<group>product:read</group> | ||
</attribute> | ||
</class> | ||
|
||
</serializer> |