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

Parameters in laravel seem a bit too troublesome #1614

Open
caixingyue opened this issue Jun 30, 2024 · 4 comments
Open

Parameters in laravel seem a bit too troublesome #1614

caixingyue opened this issue Jun 30, 2024 · 4 comments

Comments

@caixingyue
Copy link

There is nothing wrong with the following writing, but it cannot be used in GET
#[OA\RequestBody(content: new OA\MediaType(mediaType: 'application/x-www-form-urlencoded', schema: new OA\Schema(ref: '#/components/schemas/DistrictRequest')))]

The following way of writing in the controller is not elegant enough

 #[OA\QueryParameter(ref: '#/components/parameters/DistrictRequestName')]
 #[OA\QueryParameter(ref: '#/components/parameters/DistrictRequestFullName')]

I want to use something similar to RequestBody, but I can also write it differently in DistrictRequest

@DerManoMann
Copy link
Collaborator

You mean using a schema and using all properties as query parameter?

@caixingyue
Copy link
Author

You mean using a schema and using all properties as query parameter?

You don't have to use all attributes as parameters, you can also consider groups, and then just apply the parameter group in the controller

@DerManoMann
Copy link
Collaborator

Could, but sounds all a bit vague so far :) Maybe with somce proper specs someone might be interested in implementing it :)

@caixingyue
Copy link
Author

Could, but sounds all a bit vague so far :) Maybe with somce proper specs someone might be interested in implementing it :)

This may refer to the Java method to write parameter objects

image image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants