Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with product api's breaking when installing the bundle #260

Open
oliverde8 opened this issue Nov 11, 2024 · 0 comments
Open

Issue with product api's breaking when installing the bundle #260

oliverde8 opened this issue Nov 11, 2024 · 0 comments

Comments

@oliverde8
Copy link

Hello,

When we install the bundle our product api's brakes/changes. (Unless I missed something)

For example the path for the api api/v2/shop/products/{code} becomes api/v2/products/{code}
the content returned by the api changes as well.

This is caused by the "incomplete" Product.xml api description provided here:
https://github.com/BitBagCommerce/SyliusElasticsearchPlugin/blob/master/src/Resources/config/api_resources/Product.xml

compared to the native sylius Product.xml file
https://github.com/Sylius/Sylius/blob/1.13/src/Sylius/Bundle/ApiBundle/Resources/config/api_resources/Product.xml

We are missing for example this:

<itemOperation name="shop_get">
    <attribute name="method">GET</attribute>
    <attribute name="path">/shop/products/{code}</attribute>

and

<attribute name="normalization_context">
    <attribute name="groups">
        <attribute>shop:product:show</attribute>
        <attribute>sylius:shop:product:show</attribute>
    </attribute>
</attribute>

I would be willing to provide a "fix" but I am not sure what is the best method.

  • Should we remove the Product.xml file and just add the steps to make the changes necessary to the install documentation
  • Should we change the Product.xml file to have a complete file with the content of the native merged in it.
  • Should we not touch the Product.xml file but add a warning to the documentation about how if the api's are enabled the developer needs to merge both files.

None of these are good solutions, but I don't think there is one.

Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant