-
-
Notifications
You must be signed in to change notification settings - Fork 483
Add the function of normalizing request parameters and returning data… #162
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
Conversation
|
What's your use case here? |
|
Glad to hear from you 1. Format the request parameters to keep the request parameters stable and automatically fill in the default values for exampledescribelist user info METHOD-POST parameters
response
request example 1request example 2request example 3all three example ok, but the parameter structure received by the server is not fixed, and there is no default value, This features ensures that the server always receives a fixed parameter structure 2.according to the interface requirements, only the required data is returned, and redundant data is deletedfor example basic user info api olny need name and avatar attribute ,and normal user info api need all attributes . This features fit it |
merge main repository
merge getkin/kin-openapi
|
What needs to be worked on for this PR to be merged? |
|
The two apparent intents of this PR should be broken in two:
|
|
I keep that on my radar for when I have time, you specify « request bodies » but I guess query parameters as well should get their defaults? |
|
Ah yes my verbiage was poor. I meant default values should be set on requests on the receiving side (and should probably be omitted on the sending side, if only to save as many bytes from going on the wire) |
Thank you for your reply help me review the code |
Thank you for your reply |
thinks My requirement is to make a microservice with this library, which is used to verify and standardize the request , response body. The original plan was to start another library to standardize the request and response bodies. However, it was found that the new library was heavily dependent on the current verification library. Therefore, we wanted to add a switch on the existing library to standardize the request and response bodies |
… format