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

BC from 1.1.* to ^1.2 #643

Closed
ruscon opened this issue Sep 9, 2016 · 12 comments
Closed

BC from 1.1.* to ^1.2 #643

ruscon opened this issue Sep 9, 2016 · 12 comments

Comments

@ruscon
Copy link

ruscon commented Sep 9, 2016

v 1.1.*
has translations.en key

"category": {
        "id": 6,
        "position": 4,
        "createdAt": "2016-04-28T14:12:00+0300",
        "updatedAt": "2016-07-27T00:48:15+0300",
        "translations": {
          "en": {
            "name": "xxx"
          },
          "ru": {
            "name": "yyy"
          }
        }
      }

v ^1.2

"category": {
        "id": 6,
        "position": 4,
        "createdAt": "2016-04-28T14:12:00+0300",
        "updatedAt": "2016-07-27T00:48:15+0300",
        "translations": [
          {
            "name": "xxx"
          },
          {
            "name": "yyy"
          }
        ]
      },
@ruscon ruscon changed the title BC from v1.1 to v1.2 BC from 1.1 to ^1.2 Sep 9, 2016
@ruscon ruscon changed the title BC from 1.1 to ^1.2 BC from 1.1.* to ^1.2 Sep 9, 2016
@goetas
Copy link
Collaborator

goetas commented Sep 9, 2016

Looks because of b0a46c8

@smurfy
Copy link
Contributor

smurfy commented Sep 9, 2016

Yea i'm having the same problem. Even array<string,MyObject> instead of array<MyObject> does not help.

It looks like associative arrays are no longer supported.

@goetas
Copy link
Collaborator

goetas commented Sep 9, 2016

@schmittjoh can you help here?

@goetas
Copy link
Collaborator

goetas commented Sep 9, 2016

@smurfy

Even array<string,MyObject> instead of array does not help.

are you sure about this?

@smurfy
Copy link
Contributor

smurfy commented Sep 9, 2016

@goetas yes, just tested again to be sure. even with declaring the key to be of type string it still transforms the array from a associative arrays to a normal array in the serialisation.

If you need sample code to reproduce i'm happy to provide it.

@goetas
Copy link
Collaborator

goetas commented Oct 23, 2016

@ruscon can you provide a failed test case for this?

@smurfy
Copy link
Contributor

smurfy commented Oct 23, 2016

@goetas, @ruscon I can create a unittest for this as-well, for example if @ruscon has no time for it.

@goetas
Copy link
Collaborator

goetas commented Oct 23, 2016

@smurfy if you can, for me is fine

@smurfy
Copy link
Contributor

smurfy commented Oct 24, 2016

@goetas Ok, while trying to reproduce the problem in a unit-test, i failed to do so.
So i went back to my code and tried to reproduce it there and my test failed.
BUT after changing the annotation to array<string,MyObject> it worked. But only after i did a cache clear on my symfony2 application.

So my guess is i missed the cache clear on my tests on september the ninth and i told you false informations. (currently running all my unittest just to be sure)

But in a way this is still a BC break and i would add this maybe to a upgrading or changlog :)

So @ruscon i would suggest trying to fix your annotations by adding the key type of the array.

@ruscon
Copy link
Author

ruscon commented Oct 24, 2016

@smurfy, I will try, thx

@ruscon
Copy link
Author

ruscon commented Nov 24, 2016

fixed by adding array type

properties:
    translations:
        expose: true
        type: array

@goetas
Copy link
Collaborator

goetas commented Nov 25, 2016

works :)

@goetas goetas closed this as completed Nov 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants