@Schema type的字符串类型为string

This commit is contained in:
byteblogs168 2023-09-04 22:41:43 +08:00
parent aa2e74e96b
commit 89f4394b29
4 changed files with 7 additions and 5 deletions

View File

@ -34,7 +34,7 @@ public class LocalAndRemoteRetryController {
"📢查看任务列表: http://preview.easyretry.com/#/retry-task/list"
)
public void remoteRetryWithLocalRemote(@Parameter(name = "params", description = "测试参数",
schema = @Schema(type = "String", description = "测试参数", defaultValue = "test")
schema = @Schema(type = "string", description = "测试参数", defaultValue = "test")
)
@RequestParam("params") String params) {
localRemoteService.remoteRetryWithLocalRemote(params);

View File

@ -64,7 +64,7 @@ public class LocalRetryController {
"下面参数可以指定:NullPointerException, ParamException"
)
public void localRetryIncludeException(@Parameter(name = "type", description = "异常类型", in = ParameterIn.QUERY,
schema = @Schema(type = "String", description = "异常类型")) @RequestParam("type") String type) {
schema = @Schema(type = "string", description = "异常类型")) @RequestParam("type") String type) {
localRetryService.localRetryIncludeException(type);
}

View File

@ -26,7 +26,7 @@ public class ManualRetryExecutorController {
+ "📢查看任务列表: http://preview.easyretry.com/#/retry-task/list"
)
@GetMapping("/retry")
public void remoteRetryWithCallback(@Parameter(name = "params", description = "测试参数", schema = @Schema(description = "测试参数", defaultValue = "test"))
public void remoteRetryWithCallback(@Parameter(name = "params", description = "测试参数", schema = @Schema(type = "string", description = "测试参数", defaultValue = "test"))
@RequestParam("params") String params) {
manualRetryExecutorMethodService.myExecutorMethod(params);
}

View File

@ -2,6 +2,7 @@ package com.example.easy.retry.controller;
import java.util.Random;
import java.util.UUID;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Schema;
@ -42,6 +43,7 @@ public class RemoteRetryController {
/**
* 一个最简单的远程调用案例
* schema = @Schema(type = "String", defaultValue = "test", description = "测试参数", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
*/
@GetMapping("/retry/sync")
@Operation(
@ -50,7 +52,7 @@ public class RemoteRetryController {
"📢查看任务列表: http://preview.easyretry.com/#/retry-task/list"
)
public void remoteSync(@Parameter(name = "params", description = "测试参数",
schema = @Schema(type = "String", defaultValue = "test", description = "测试参数"))
schema = @Schema(type = "string", defaultValue = "test", description = "测试参数"))
@RequestParam("params") String params) {
remoteRetryService.remoteSync(params);
}
@ -86,7 +88,7 @@ public class RemoteRetryController {
@GetMapping("/retryWithSingleParamIdempotentGenerate")
public void retryWithSingleParamIdempotentGenerate(
@Parameter(name = "params", description = "测试参数",
schema = @Schema(type = "String", description = "测试参数", defaultValue = "test"))
schema = @Schema(type = "string", description = "测试参数", defaultValue = "test"))
@RequestParam("params") String params) {
remoteRetryService.retryWithSingleParamIdempotentGenerate(params);
}