1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| @RestController @Tag(name = "Test APIs", description = "Test APIs for demo purpose") public class TestController {
@GetMapping("test") @Operation(description = "Get a test model demo", parameters = { @Parameter(name = "name", in = ParameterIn.QUERY, required = true, description = "name parameter") }) public Mono<TestDto> getTestDto(final @RequestParam String name, final ServerWebExchange exchange) { TestDto testDto = new TestDto(); testDto.setName(name); testDto.setAge(0); testDto.setName("Welcome "+name); return Mono.just(testDto); }
@PostMapping("test") @Operation(description = "Create a test model demo", requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody()) public Mono<TestDto> postTestDto(@Valid @RequestBody final TestDto testDto, final ServerWebExchange exchange) { return Mono.just(testDto); }
}
|