Skip to content

fix(metadata): defaults should not override values #4702

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

Merged
merged 5 commits into from
Apr 5, 2022
Merged

fix(metadata): defaults should not override values #4702

merged 5 commits into from
Apr 5, 2022

Conversation

silverbackdan
Copy link
Contributor

Q A
Branch? main
Tickets #4699
License MIT
Doc PR n/a
Fix: #4699

@silverbackdan silverbackdan changed the title [WIP][v3] Fix: metadata: defaults overriding props set on attributes [Fix][v3][WIP] metadata: defaults overriding props set on attributes Apr 4, 2022
@silverbackdan silverbackdan changed the title [Fix][v3][WIP] metadata: defaults overriding props set on attributes fix(metadata) v3 with attributes: defaults overriding props set on attributes Apr 4, 2022
@silverbackdan silverbackdan changed the title fix(metadata) v3 with attributes: defaults overriding props set on attributes fix(metadata): v3 with attributes: defaults overriding props set on attributes Apr 4, 2022
@silverbackdan silverbackdan marked this pull request as ready for review April 4, 2022 15:47
Comment on lines 174 to 177
$upperProperty = ucfirst($key);
$getter = "get$upperProperty";

if (method_exists($operation, $getter) && null === $operation->{$getter}()) {
Copy link
Member

Choose a reason for hiding this comment

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

I think just changing the condition would have been alright.

Comment on lines +28 to +32
#[GetCollection(
paginationClientItemsPerPage: true,
paginationItemsPerPage: 5,
paginationMaximumItemsPerPage: 30
)]
Copy link
Member

Choose a reason for hiding this comment

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

You cannot use PHP 8 attributes directly in the tests, you need to use annotations like before, they will be automatically converted to PHP attributes by our command (api:upgrade-resource).

Copy link
Member

Choose a reason for hiding this comment

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

you can you just need to flag them as @php8 tests :)

@soyuka soyuka changed the title fix(metadata): v3 with attributes: defaults overriding props set on attributes fix(metadata): defaults should not override values Apr 5, 2022
@soyuka soyuka merged commit 9182688 into api-platform:main Apr 5, 2022
@silverbackdan silverbackdan deleted the fix/metadata-defaults branch April 5, 2022 19:53
@silverbackdan
Copy link
Contributor Author

Thank you both :)

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.

[Bug][v3][Pagination] V3 pagination limits seem to be broken
3 participants