Git Product home page Git Product logo

Comments (6)

gquemener avatar gquemener commented on June 1, 2024

ProductNormalizer was designed to hierarchically normalize a product in order to present it in json through the public api.
So, as you can see in the https://github.com/akeneo/pim-community-dev/blob/master/src/Pim/Bundle/CatalogBundle/Controller/Api/ProductController.php#L105, the channel is manually set, in the intention of filtering the product values for this channel (https://github.com/akeneo/pim-community-dev/blob/master/src/Pim/Bundle/ImportExportBundle/Normalizer/ProductNormalizer.php#L105).

Can you tell me which processor you are using? If you are using your own, you must call setChannel before using $serializer->serialize($product, 'json', ....).

As a side note, I'd say that, after a second thought, the product normalizer should not filter values by channel, but instead should receive product with already filtered values and just focus on normalizing what's given to it. What do you think @filipsalpe ?

from pim-community-dev.

srascar avatar srascar commented on June 1, 2024

I'm using my own processor. Plus the normalizer is a protected attribute of the serializer so i couldn't set channel before calling the serialize method.
And I totaly agree with you on the second point.

from pim-community-dev.

nidup avatar nidup commented on June 1, 2024

Agree with you guys, I think also that we should avoid/make optional the Router dependency in this normalizer.

FYI, this normalizer has been originaly created to deal with json API (cf routes oro_api_get_products an oro_api_get_product), we'll work to complete this API for the 1.0.

from pim-community-dev.

srascar avatar srascar commented on June 1, 2024

What I did is use a parameter url in the writer. So i can post to this url using pecl_http library.

from pim-community-dev.

srascar avatar srascar commented on June 1, 2024

I would like to submit an other idea.
You should add the family code to the data normalized in Pim\Bundle\ImportExportBundle\Normalizer\ProductNormalizer.

from pim-community-dev.

BitOne avatar BitOne commented on June 1, 2024

Thanks @srascar for the idea. We will revamp the REST API for 1.1.0. I've created an issue with it: #766

from pim-community-dev.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.