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

Serialization groups #27

Open
lube opened this issue Jul 3, 2016 · 6 comments
Open

Serialization groups #27

lube opened this issue Jul 3, 2016 · 6 comments
Labels

Comments

@lube
Copy link

lube commented Jul 3, 2016

I cannot get serialization groups to work this is probably my fault, but maybe someone else is having the same issue and can find help here.

serialization file:

DemoBundle\Entity\Comment:
    exclusion_policy: ALL
    xml_root_name: comment
    properties:
        id:
            expose: true
            type: integer
        text:
            expose: true
            type: string
            groups: [foo]
        postId:
            expose: true
            type: DemoBundle\Entity\Post
            serialized_name: post

routing:

comment_api:
    resource: demo.comment
    type: sylius.api
    defaults:
        serialization_groups: [foo]
@pjedrzejewski
Copy link
Contributor

pjedrzejewski commented Jul 4, 2016

Try with:

comment_api:
    resource: demo.comment
    type: sylius.api
    defaults:
        _sylius:
            serialization_groups: [foo]

@lube
Copy link
Author

lube commented Jul 4, 2016

didn't work :/

getting: { }

@lchrusciel
Copy link
Member

lchrusciel commented Jul 4, 2016

Try foo -> Default. If you are testing it on a index page, especially.
Also, just as a remainder, clear cache ;)

@lube
Copy link
Author

lube commented Jul 4, 2016

Im always clearing cache, good ol symfony.

You mean the name of the Serializtion group, instead of foo naming it Default?

@lchrusciel
Copy link
Member

lchrusciel commented Jul 4, 2016

Yes, IIRC there were some issues with managing an index data for other serialization groups than Default. It had something to do with default serialization group in hateoas bundle, i suppose.

And, I know that clear:cache advise was a little bit trivial, but we sometimes forgot even the simplest things.

@lube
Copy link
Author

lube commented Jul 4, 2016

Oh for sure, Symfony cache has bitten me before, no worries.

I'll try renaming the serialization group when I get back from work!

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

No branches or pull requests

3 participants