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

inconsistency of returning types #42

Closed
yalagin opened this issue Apr 3, 2021 · 2 comments
Closed

inconsistency of returning types #42

yalagin opened this issue Apr 3, 2021 · 2 comments

Comments

@yalagin
Copy link

yalagin commented Apr 3, 2021

there is an inconsistency of returning types when translation is empty it's returning array instead of object

no translations

{
"id":1,
 "translations": []
}

there are translations

{
"id":1,
 "translations": { 
        "en":{
            "title":"test",
            "content":"test",
            "locale":"en"
        },
        "de":{
            "title":"test de",
            "content":"test de",
            "locale":"de"
        }
    }
}

maybe it's should return {} or null if there are no translations

@yalagin
Copy link
Author

yalagin commented Apr 5, 2021

well, I took a look at why it's serializing an array. it's because of symfony/symfony#37061 and symfony/symfony#37049

@paullla
Copy link
Member

paullla commented Jul 2, 2021

@yalagin thank you for reporting. I'm closing it since it's Symfony issue

@paullla paullla closed this as completed Jul 2, 2021
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