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

fix:The generated Postman collection does not support file uploads #626

Merged
merged 1 commit into from
Oct 12, 2023

Conversation

delei
Copy link
Contributor

@delei delei commented Oct 11, 2023

Summary(关于这个pr的描述)

fix: The generated Postman collection does not support file uploads #622

Basic example(pr的用例)

controller用例

/**
 * 上传单个文件V1
 * @param userId 用户id
 * @param file 文件
 * @return
 */
@PostMapping(value = "/upload",consumes = "multipart/form-data")
public Result upload(String userId,@RequestParam MultipartFile file) {
    return Result.success();
}

/**
 * 上传单个文件V2
 * @param userId
 * @param userData
 * @param file
 * @return
 */
@PostMapping("upload2")
public Result formData2(String userId,@RequestParam String userData, MultipartFile file){
    return Result.success();
}

/**
 * 批量上传文件
 * @param file 文件
 * @return
 */
@PostMapping(name = "/batchUpload1",consumes = "multipart/form-data")
public Result batchFileUpload1(MultipartFile[] file) {
    return Result.success();
}

/**
 * 批量上传文件1
 * @param file 文件
 * @return
 */
@PostMapping(value = "/batchUpload2",consumes = "multipart/form-data")
public Result batchFileUpload2(List<MultipartFile> file) {
    return Result.success();
}

Postman效果截图

Postman version: 10.18.11

使用PostmanJsonBuilder生成postman.json文件,然后导入到Postman工具中,请求参数 file 显示为 File类型,效果如下:

piSPXh4.png

Motivation(提出这个pr目的)

fix: issue #622

@shalousun shalousun merged commit 5a46a63 into TongchengOpenSource:master Oct 12, 2023
@shalousun shalousun added this to the 3.0.0 milestone Oct 12, 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.

2 participants