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

Upgraded 2.4 -> 3.4 / Symfony 4.3.3 #1112

Closed
tlorens opened this issue Aug 7, 2019 · 4 comments
Closed

Upgraded 2.4 -> 3.4 / Symfony 4.3.3 #1112

tlorens opened this issue Aug 7, 2019 · 4 comments

Comments

@tlorens
Copy link

tlorens commented Aug 7, 2019

Q A
Bug report? yes
Feature request? no
BC Break report? Maybe?
RFC? no
Platform MacOS Majave
PHP 7.2.15
JSON 1.6.0

Source JSON to deserialize

{
    "id": 1,
    "shortName": "Short Description",
    "description": "Default description of imported template.  Please edit me.",
    "templateType": {
        "id": 1,
        "shortName": "Template v3.2"
    },
    "reusable": true,
    "auditTemplateProcesses": [{
        "id": 1,
        "sequence": 1,
        "processObjective": {
....

Output

  #id: 1
    -shortName: null
    -description: "Default description of imported template.  Please edit me."
    -templateType: null
    -ancestor: null
    -reusable: true
    -version: null
    -srcFile: null
    #auditTemplateProcesses: null

Getting an entire project up to date. Upgraded JMS serializer and now nested objects don't seem to be deserialized and are null/empty. The top level properties appear to be set just fine. I feel like I may be doing something wrong? I've tried adding @expose and setting @type just to see if that mattered. I've reset the JMS yaml config file to defaults.

So I have an Object with an array of nested Objects. This array is empty. JSON source hasn't changed. I've tried changing from lazy loading to eager loading.

@goetas
Copy link
Collaborator

goetas commented Aug 8, 2019

Hi,
I think you should add more details to the bug report.
Current code, current json, current output and expected output.

Did you follow the instructions in the upgrading document https://github.com/schmittjoh/serializer/blob/master/UPGRADING.md?

It is difficult to guess the issue...

@tlorens
Copy link
Author

tlorens commented Aug 8, 2019

Hi,
I think you should add more details to the bug report.
Current code, current json, current output and expected output.

Did you follow the instructions in the upgrading document https://github.com/schmittjoh/serializer/blob/master/UPGRADING.md?

It is difficult to guess the issue...

I read the upgrading instructions and I don't use those features. Just basic Object->JSON->Object type stuff. Nothing fancy.

@goetas
Copy link
Collaborator

goetas commented Aug 8, 2019

are you sure the naming strategy works correct? I see only the "description" field being deserialized...

@tlorens
Copy link
Author

tlorens commented Aug 8, 2019

are you sure the naming strategy works correct? I see only the "description" field being deserialized...

Boom! Fixed!! Fixed up the the YAML files and had to nuke the cache manually.

Thanks for pointing me in the right direction!

@tlorens tlorens closed this as completed Aug 8, 2019
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

2 participants