doctrine-json-odm icon indicating copy to clipboard operation
doctrine-json-odm copied to clipboard

Allow using type names in place of class names

Open TamasSzigeti opened this issue 3 years ago • 1 comments

Introduce bundle config to map keys to class names

See https://github.com/dunglas/doctrine-json-odm/issues/63

The static type mapper might seem to be weird but this way we don't need to inject anything extra into the serializer and we do not break BC, especially given the doc encourages overriding the service definition.

Comments welcome, let me know what you think, I'll add doc and tests if it can go forward

TamasSzigeti avatar Sep 01 '22 14:09 TamasSzigeti

@dunglas Please have a look

TamasSzigeti avatar Sep 01 '22 14:09 TamasSzigeti

bump @dunglas What do you think of this approach?

TamasSzigeti avatar Sep 28 '22 09:09 TamasSzigeti

I personally often change class namespaces to better organize code, leading to thorny migrations, so that change would be very welcome!

I +1 👍

bpolaszek avatar Sep 29 '22 05:09 bpolaszek

@dunglas Addressed change reqs, added tests and notes in readme.

TamasSzigeti avatar Oct 17 '22 09:10 TamasSzigeti

@dunglas Also fixed some unrelated issues to make CI green

TamasSzigeti avatar Oct 18 '22 06:10 TamasSzigeti

@dunglas any chance to see this merge soon ? Can I help with something ?

amenophis avatar Jan 27 '23 17:01 amenophis

@TamasSzigeti Do you want to make the modification proposed by @dunglas ? If you don't have time, i can do it !

Let me know 🙂

amenophis avatar Feb 02 '23 08:02 amenophis

Thanks for the review, Kévin!

@amenophis Thanks for the offer, go ahead if you wish, otherwise I can take care of it this weekend.

TamasSzigeti avatar Feb 02 '23 08:02 TamasSzigeti

Hi @TamasSzigeti,

Seems you did not had time to push update. Could you give me permissions to push on your fork and will try to fix last comments ?

Thanks

amenophis avatar Feb 09 '23 21:02 amenophis

@dunglas Comments addressed

@amenophis Thanks, just did it (:

TamasSzigeti avatar Feb 10 '23 08:02 TamasSzigeti

Really nice feature :+1:

Guite avatar Feb 14 '23 08:02 Guite

@dunglas Comments addressed plus I fixed the workflow again:

  • Switched to using mysql from container as somehow setting legacy auth started failing.
  • Enable tests on php 8.2
  • doctrine/annotations has to become a direct dependency for latest versions

Might be worth dropping unsupported php and symfony versions in another PR

TamasSzigeti avatar Feb 18 '23 09:02 TamasSzigeti

Thank you very much for your hard work @TamasSzigeti!!

dunglas avatar Feb 23 '23 13:02 dunglas