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

Make doctrine/annotations an optional dependency #334

Merged
merged 9 commits into from
Oct 31, 2024

Conversation

W0rma
Copy link
Contributor

@W0rma W0rma commented Oct 22, 2024

Closes #333

@goetas
Copy link
Collaborator

goetas commented Oct 23, 2024

This looks nice, looking forward to it

@W0rma W0rma force-pushed the optional-annotations branch from fc17fa4 to c4c3368 Compare October 24, 2024 05:19
@W0rma W0rma marked this pull request as ready for review October 24, 2024 05:26
README.md Outdated
@@ -180,7 +191,7 @@ use JMS\Serializer\Annotation as Serializer;
use Hateoas\Configuration\Annotation as Hateoas;

#[Serializer\XmlRoot('user')]
#[Hateoas\Relation('self', href: "expr('/api/users/' ~ object.getId())")]
#[Hateoas\Relation(name: 'self', href: "expr('/api/users/' ~ object.getId())")]
Copy link
Collaborator

Choose a reason for hiding this comment

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

is the name argument needed? it seems that before, it was optional, making it look like annotations

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for the hint.

It is not necessary anymore after 9e8a232

@@ -7,15 +7,9 @@
use Hateoas\Configuration\Annotation as Hateoas;
use JMS\Serializer\Annotation as Serializer;

/**
* @Serializer\ExclusionPolicy("all")
Copy link
Collaborator

Choose a reason for hiding this comment

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

hmm., this change makes it mandatory to have the attribute driver, right? is this a BC break?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I think so.

I just added the annotations again to avoid that possible BC break.

@goetas
Copy link
Collaborator

goetas commented Oct 30, 2024

to me it looks good, i would just like to understand what happens is someone is using still annotations and uses some of the Representation classes?

@W0rma W0rma force-pushed the optional-annotations branch from c4c3368 to 880ec13 Compare October 31, 2024 08:22
@W0rma W0rma force-pushed the optional-annotations branch from 880ec13 to 9e8a232 Compare October 31, 2024 08:25
@W0rma
Copy link
Contributor Author

W0rma commented Oct 31, 2024

to me it looks good, i would just like to understand what happens is someone is using still annotations and uses some of the Representation classes?

@goetas Thank you for the review - I addressed all your comments.

After my latest adjustments the Representation classes are usable with or without annotations.

@goetas
Copy link
Collaborator

goetas commented Oct 31, 2024

@W0rma does your implementation allow to use both annotations and attributes at the same time? If yes, do we have a testcase in which both drivers are enabled?

@W0rma
Copy link
Contributor Author

W0rma commented Oct 31, 2024

does your implementation allow to use both annotations and attributes at the same time? If yes, do we have a testcase in which both drivers are enabled?

@goetas Yes, it does. I added a test case which verifies that.

@goetas goetas merged commit 34396ee into willdurand:master Oct 31, 2024
56 checks passed
@goetas
Copy link
Collaborator

goetas commented Oct 31, 2024

lets ship it!

@goetas
Copy link
Collaborator

goetas commented Oct 31, 2024

tagged as https://github.com/willdurand/Hateoas/releases/tag/3.12.0-beta1

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

Successfully merging this pull request may close these issues.

Make dependency doctrine/annotations optional
2 participants