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 manyToOne with yml configutaion #411

Closed
flohw opened this issue Sep 1, 2014 · 3 comments
Closed

Serialization manyToOne with yml configutaion #411

flohw opened this issue Sep 1, 2014 · 3 comments

Comments

@flohw
Copy link

flohw commented Sep 1, 2014

Hi I am trying to serialize two entities with a simple manyToOne relationship using yaml configuration. I have my entities Address (name changed) to one People : (Annotation mapping is correct with a many to one in Address and the other way too)

namespave Vendor\MyBundle\Entity;
class Address {
    private $id;
    private $zipCode;
    private $people;
}
class People {
    private $id;
    private $addresses;
}

And my yml files :

# src/Vendor/MyBundle/Resources/config/serializer/Entity.Address.yml
Vendor\MyBundle\Entity\Address:
    exclusion_policy: ALL
    properties:
        id: { expose: true }
        zipCode: { expose: true }
        people: { expose: true, type: Vendor\MyBundle\Entity\People }

# src/Vendor/MyBundle/Resources/config/serializer/Entity.People.yml
Vendor\MyBundle\Entity\Peple:
    exclusion_policy: ALL
    properties:
        id: { expose: true}

When I get my Address entity and return it (api build with fosrestbundle) I get a 502 bad gateway. But when I transform my yaml into annotations, all works fine.

Did I miss someting? thanks for your anwsers!

@stof
Copy link
Contributor

stof commented Sep 1, 2014

Can you check your logs to see which error was thrown when you got the 502 error ?

@flohw
Copy link
Author

flohw commented Sep 1, 2014

Maximum exacution time of 30s exceed...

But we may have an error in our yml file. I just try on my computer (I was on my colleagues one) and it works fine... or the cache has been to long to generate...

Thanks if you may have another explanation that we can verify.

@goetas
Copy link
Collaborator

goetas commented Jan 20, 2017

Sorry for the long feedback loop.
This issue is probably already solved.

(if not feel free to re open the issue or to comment here)

Thanks

@goetas goetas closed this as completed Jan 20, 2017
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

3 participants