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

Fix ResourceClassResolver handling of inheritance #2797

Merged

Conversation

teohhanhui
Copy link
Contributor

@teohhanhui teohhanhui commented May 15, 2019

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #2609, #2683, #2759
License MIT
Doc PR N/A

Alternative to #2714

TODO:

Notable changes:

  • ResourceClassResolver returns the most specific resource class for an object.
  • Use ResourceClassResolver where we didn't before.
  • Denormalization of non-resources no longer handled by our ItemNormalizer.

@teohhanhui teohhanhui force-pushed the fix/resource-class-resolver-inheritance branch 3 times, most recently from ebc7fd2 to 6e8588b Compare May 17, 2019 04:16
@teohhanhui teohhanhui changed the title [WIP] Fix ResourceClassResolver handling of inheritance Fix ResourceClassResolver handling of inheritance May 17, 2019
@teohhanhui teohhanhui force-pushed the fix/resource-class-resolver-inheritance branch 3 times, most recently from f304bba to 3598dcd Compare May 17, 2019 19:03
@teohhanhui teohhanhui requested review from soyuka, meyerbaptiste, antograssiot and dunglas and removed request for soyuka May 17, 2019 19:05
@teohhanhui teohhanhui force-pushed the fix/resource-class-resolver-inheritance branch 2 times, most recently from aafd6c7 to 3fc76f1 Compare May 17, 2019 19:19
@teohhanhui
Copy link
Contributor Author

Hmm... 1 test fails on PostgreSQL: https://travis-ci.org/api-platform/core/jobs/533956026#L770-L777

I'm not sure what is going on. 😆

@teohhanhui
Copy link
Contributor Author

Fixed failing test on postgres.

src/Api/IdentifiersExtractor.php Outdated Show resolved Hide resolved
src/Api/ResourceClassResolver.php Outdated Show resolved Hide resolved
src/Bridge/Symfony/Routing/IriConverter.php Outdated Show resolved Hide resolved
src/Serializer/AbstractItemNormalizer.php Show resolved Hide resolved
src/Serializer/AbstractItemNormalizer.php Outdated Show resolved Hide resolved
src/Serializer/AbstractItemNormalizer.php Outdated Show resolved Hide resolved
@vincentchalamon vincentchalamon removed their request for review May 20, 2019 14:59
@teohhanhui teohhanhui force-pushed the fix/resource-class-resolver-inheritance branch 3 times, most recently from 1d0127f to d3d173a Compare May 20, 2019 17:06
@teohhanhui teohhanhui requested a review from dunglas May 20, 2019 17:34
@teohhanhui teohhanhui force-pushed the fix/resource-class-resolver-inheritance branch from d3d173a to 6d02057 Compare May 20, 2019 17:57
teohhanhui and others added 2 commits May 20, 2019 20:01
Co-authored-by: Vincent Chalamon <vincentchalamon@gmail.com>
Co-authored-by: "Nek (Maxime Veber)" <nek.dev@gmail.com>
@teohhanhui teohhanhui force-pushed the fix/resource-class-resolver-inheritance branch 2 times, most recently from 9156bc3 to 79c3a65 Compare May 21, 2019 17:45
Copy link
Member

@soyuka soyuka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

@teohhanhui teohhanhui merged commit 717b909 into api-platform:2.4 May 22, 2019
@teohhanhui teohhanhui deleted the fix/resource-class-resolver-inheritance branch May 22, 2019 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants