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

draft: fix(UriVariable): fix string being cast to int #5520

Conversation

PierreRebeilleau
Copy link
Contributor

@PierreRebeilleau PierreRebeilleau commented Apr 3, 2023

Q A
Branch? 3.1
Tickets #5396
License MIT

When passing multiple UriVariables, it is possible that a string, such as a key, could be cast to an integer (e.g., '73foo'). To avoid any potential issues, a check is performed before the cast as a workaround.

@PierreRebeilleau PierreRebeilleau force-pushed the fix/composite-identifiers branch 2 times, most recently from 2ab609b to c1a1fbc Compare April 3, 2023 10:08
@soyuka
Copy link
Member

soyuka commented Apr 4, 2023

try to reproduce the issue at #5396 first, I don't think that an Integer IntegerUriVariableTransformer should transform something to a string. We probably don't even need to transform it if it's a string in the UriVariablesResolverTrait.

Comment on lines -92 to +94
// if ($metadata) {
// return (new class extends HttpOperation {})->withResource($metadata);
// }
// if ($metadata) {
// return (new class extends HttpOperation {})->withResource($metadata);
// }
Copy link
Contributor

Choose a reason for hiding this comment

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

Hey @PierreRebeilleau, remember me ? ;)

I think this has nothing to do with your PR. So maybe I'm wrong but you might have to revert it.
I actually thought of doing a dedicated PR for this because it affect all the created branch

Copy link
Member

Choose a reason for hiding this comment

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

I already did that this needs rebase

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey @MarvinCourcier , yes i remember you ! Glad to see you around, ty i'm gonna rebase :)

@PierreRebeilleau PierreRebeilleau changed the title fix(UriVariable): fix string being cast to int dreft: fix(UriVariable): fix string being cast to int Apr 7, 2023
@PierreRebeilleau PierreRebeilleau changed the title dreft: fix(UriVariable): fix string being cast to int draft: fix(UriVariable): fix string being cast to int Apr 7, 2023
@soyuka soyuka closed this May 23, 2023
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.

3 participants