-
Notifications
You must be signed in to change notification settings - Fork 280
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
Cannot generate documentation for requests whose content-type is form-data and urlencoded #799
Comments
@shaunhurryup According to the code you provided, the OpenAPI generated by smart-doc can be normally displayed by the latest version of |
@shaunhurryup Currently, smart-doc is optimal for scenarios that use JSON requests, but its handling of schemas and components is not very complete. This can affect scenarios where OpenAPI is used to generate code. The documentation display can be used normally. If you are familiar with OpenAPI, you are welcome to participate in the joint improvement. |
Yeah, the JSON output can be rendered by any UI tools that support the OpenAPI specification. However, it is displayed using query parameters instead of x-www-form-urlencoded.
I import json output to Postman, it display query parameters too
A request of type You can see my json output if you want~ |
@shaunhurryup We have tested it, and the parameters generated by openapi ui are also placed in the parameters. Our processing method is to directly split the parameter fields, not using ref. There may be no mandatory requirements for the presentation of application/x-www-form-urlencoded. It does indeed treat x-www-form-urlencoded types as key=value from the browser's perspective. Whether the community will optimize it to the way you want remains to be seen, as I don't have time to deal with it recently. Smart-doc initially leaned towards the more mainstream JSON request method at present, so its support for form requests will be somewhat weaker. |
This problem can cause the `@RequestParam` parameter of the POST request to be placed in the body parameter, and because the parameter is placed incorrectly, may cause the object's nested parameter structure to be incorrect. The root cause of this BUG is the incorrect modification in TongchengOpenSource#808 to fix TongchengOpenSource#799 Closes TongchengOpenSource#953
I did read the documentation and QA, but didn't find the answers :-(
Your Environment
Expected Behavior
The type, example, and description of the request parameters should be in the
/api/example/goods-form-urlencoded.post.requestBody.content.application/x-www-form-urlencoded
Current Behavior
The type, example, and description of the request parameters are set in
/api/example/goods-form-urlencoded.post.parameters
incorrectlyContext
The text was updated successfully, but these errors were encountered: