|
| 1 | +/* |
| 2 | + * |
| 3 | + * * |
| 4 | + * * * |
| 5 | + * * * * Copyright 2019-2024 the original author or authors. |
| 6 | + * * * * |
| 7 | + * * * * Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | + * * * * you may not use this file except in compliance with the License. |
| 9 | + * * * * You may obtain a copy of the License at |
| 10 | + * * * * |
| 11 | + * * * * https://www.apache.org/licenses/LICENSE-2.0 |
| 12 | + * * * * |
| 13 | + * * * * Unless required by applicable law or agreed to in writing, software |
| 14 | + * * * * distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | + * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | + * * * * See the License for the specific language governing permissions and |
| 17 | + * * * * limitations under the License. |
| 18 | + * * * |
| 19 | + * * |
| 20 | + * |
| 21 | + */ |
| 22 | + |
| 23 | +package test.org.springdoc.api.v30.app218; |
| 24 | + |
| 25 | + |
| 26 | +import io.swagger.v3.oas.annotations.Operation; |
| 27 | +import io.swagger.v3.oas.annotations.headers.Header; |
| 28 | +import io.swagger.v3.oas.annotations.media.Schema; |
| 29 | +import io.swagger.v3.oas.annotations.responses.ApiResponse; |
| 30 | +import org.springframework.http.HttpHeaders; |
| 31 | +import org.springframework.web.bind.annotation.GetMapping; |
| 32 | +import org.springframework.web.bind.annotation.RequestMapping; |
| 33 | +import org.springframework.web.bind.annotation.RestController; |
| 34 | + |
| 35 | +import java.net.URI; |
| 36 | + |
| 37 | + |
| 38 | +@RestController |
| 39 | +@RequestMapping("/") |
| 40 | +public class HelloController { |
| 41 | + |
| 42 | + @Operation( |
| 43 | + summary = "Summary", |
| 44 | + description = "This is description.", |
| 45 | + tags = {"Sample"}, |
| 46 | + responses = { |
| 47 | + @ApiResponse( |
| 48 | + responseCode = "201", |
| 49 | + description = "201 (Created)", |
| 50 | + headers = |
| 51 | + @Header( |
| 52 | + name = HttpHeaders.LOCATION, |
| 53 | + description = "Sample endpoint", |
| 54 | + schema = @Schema(implementation = URI.class) |
| 55 | + ) |
| 56 | + ) |
| 57 | + } |
| 58 | + ) |
| 59 | + @GetMapping |
| 60 | + public String get() { |
| 61 | + return "Hello World!"; |
| 62 | + } |
| 63 | +} |
0 commit comments