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

Non singleValue value objects as query parameters are not handled correctly yet #11

Open
mficzel opened this issue Apr 9, 2024 · 0 comments

Comments

@mficzel
Copy link
Member

mficzel commented Apr 9, 2024

If a value object is used as query parameter the generated openapi spec will lead swagger ui to pass each property ob the value object as single parameter.

VO

final readonly class Person
{
    public function __construct(
        public string $firstName,
        public string $lastName,
    ) {
    }
}

controller action

    public function personAction(
        Person $person
    ): PersonResponse {
    }

generated ur by swagger ui: path?firstName=foo&lastName=bar
expected uri: path?person[firstName]=foo&person[lastName]=bar | path?person={"firstName":"foo", "lastName":"bar"}

I am pretty sure the generated uris are not correct but cannot say which of the correctish ones should be expected.

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

No branches or pull requests

1 participant