1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.bremersee.spring.test.api.comparator;
18
19 import io.swagger.v3.oas.annotations.Operation;
20 import io.swagger.v3.oas.annotations.Parameter;
21 import io.swagger.v3.oas.annotations.media.Content;
22 import io.swagger.v3.oas.annotations.media.Schema;
23 import io.swagger.v3.oas.annotations.responses.ApiResponse;
24 import io.swagger.v3.oas.annotations.responses.ApiResponses;
25 import io.swagger.v3.oas.annotations.tags.Tag;
26 import java.util.List;
27 import org.springframework.http.ResponseEntity;
28 import org.springframework.web.bind.annotation.GetMapping;
29 import org.springframework.web.bind.annotation.PathVariable;
30 import org.springframework.web.bind.annotation.PostMapping;
31 import org.springframework.web.bind.annotation.PutMapping;
32 import org.springframework.web.bind.annotation.RequestBody;
33 import org.springframework.web.bind.annotation.RequestMapping;
34 import org.springframework.web.bind.annotation.RequestMethod;
35 import org.springframework.web.bind.annotation.RequestParam;
36
37
38
39
40
41
42 public class BadApis {
43
44
45
46
47 @Tag(name = "BadApiController")
48 public interface One {
49
50 }
51
52
53
54
55 public interface Two {
56
57 }
58
59
60
61
62
63 @Tag(name = "BadApiController")
64 public interface Three {
65
66
67
68
69
70
71
72 @RequestMapping(
73 value = "/api/models",
74 produces = {"application/json"},
75 method = RequestMethod.GET)
76 ResponseEntity<List<ExampleModel>> getExampleModels(
77 @Parameter(description = "The query.") @RequestParam(name = "q", required = false)
78 String query);
79
80
81
82
83
84
85
86
87 @PutMapping(path = "/api/models/{id}")
88 ResponseEntity<Void> updateExampleModel(
89 @PathVariable("id") String id,
90 @RequestBody ExampleModel model);
91
92
93
94
95
96
97
98 @PostMapping(path = "/api/models")
99 ResponseEntity<Void> addExampleModel(
100 @RequestBody ExampleModel model);
101
102
103
104
105
106
107
108 @Operation(
109 summary = "Get model by ID.",
110 operationId = "getExampleModel",
111 tags = {"model-controller"})
112 @ApiResponses(value = {
113 @ApiResponse(
114 responseCode = "200",
115 description = "OK",
116 content = @Content(schema = @Schema(implementation = ExampleModel.class)))
117 })
118 @GetMapping(path = "/api/models/{id}")
119 ResponseEntity<ExampleModel> getExampleModel(@PathVariable("id") String id);
120 }
121
122
123
124
125 @Tag(name = "BadApiController")
126 public interface Four {
127
128
129
130
131
132
133
134 @PutMapping(path = "/api/models/{id}")
135 ResponseEntity<Void> updateExampleModel(
136 @RequestBody ExampleModel model);
137
138
139
140
141
142
143
144 ResponseEntity<Void> addExampleModel(
145 @RequestBody ExampleModel model);
146
147
148
149
150
151
152
153 @Operation(
154 summary = "Get model by ID.",
155 operationId = "getExampleModel",
156 tags = {"model-controller"})
157 @ApiResponses(value = {
158 @ApiResponse(
159 responseCode = "200",
160 description = "OK",
161 content = @Content(schema = @Schema(implementation = String.class)))
162 })
163 @GetMapping(path = "/api/models/{id}")
164 ResponseEntity<String> getExampleModel(@PathVariable("id") String id);
165 }
166
167
168
169
170
171 @Tag(name = "BadApiController")
172 public interface Five {
173
174
175
176
177
178
179
180 @RequestMapping(
181 value = "/api/models",
182 produces = {"application/json"},
183 method = RequestMethod.GET)
184 ResponseEntity<List<ExampleModel>> getExampleModels(
185 @Parameter(description = "The query.")
186 @RequestParam(name = "q", required = false) String query);
187 }
188
189
190
191
192 @Tag(name = "BadApiController")
193 public interface Six {
194
195
196
197
198
199
200
201 @GetMapping(
202 value = "/api/models",
203 produces = {"application/json"})
204 ResponseEntity<List<ExampleModel>> getExampleModels(
205 @Parameter(description = "The query.") @RequestParam(name = "q", required = false)
206 String query);
207 }
208
209
210
211
212
213 @Tag(name = "BadApiController")
214 public interface Seven {
215
216
217
218
219
220
221
222 @RequestMapping(
223 value = "/api/models",
224 produces = {"application/json"},
225 method = RequestMethod.GET)
226 ResponseEntity<List<ExampleModel>> getExampleModels(
227 @Parameter(description = "The query.") @RequestParam(name = "q", required = false)
228 String query);
229 }
230
231
232
233
234 @Tag(name = "BadApiController")
235 public interface Eight {
236
237
238
239
240
241
242
243 @RequestMapping(
244 value = "/api/models",
245 produces = {"application/json"},
246 method = RequestMethod.GET)
247 ResponseEntity<List<ExampleModel>> getExampleModels(
248 @RequestParam(name = "q", required = false) String query);
249 }
250
251
252 }