Skip to content

Commit b946d44

Browse files
committed
fix: remove unnecessary @NotNull annotations from path variables
1 parent f53fd92 commit b946d44

158 files changed

Lines changed: 449 additions & 449 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

samples/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/api/DefaultApi.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public interface DefaultApi {
5050
value = DefaultApi.PATH_GET
5151
)
5252
ResponseEntity<Void> get(
53-
@NotNull @ApiParam(value = "A date path parameter", required = true, defaultValue = "1972-01-01") @PathVariable("date") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date,
53+
@ApiParam(value = "A date path parameter", required = true, defaultValue = "1972-01-01") @PathVariable("date") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date,
5454
@NotNull @ApiParam(value = "A date-time query parameter", required = true, defaultValue = "1973-12-19T03:39:57-08:00") @Valid @RequestParam(value = "dateTime", required = true, defaultValue = "1973-12-19T03:39:57-08:00") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime,
5555
@NotNull @ApiParam(value = "A date header parameter", required = true, defaultValue = "1974-01-01") @RequestHeader(value = "X-Order-Date", required = true, defaultValue = "1974-01-01") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate xOrderDate,
5656
@ApiParam(value = "A date cookie parameter", defaultValue = "1975-01-01") @CookieValue(name = "loginDate", required = false, defaultValue = "1975-01-01") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate loginDate
@@ -80,7 +80,7 @@ ResponseEntity<Void> get(
8080
consumes = "application/x-www-form-urlencoded"
8181
)
8282
ResponseEntity<Void> updatePetWithForm(
83-
@NotNull @ApiParam(value = "A date path parameter", required = true, defaultValue = "1970-01-01") @PathVariable("date") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date,
83+
@ApiParam(value = "A date path parameter", required = true, defaultValue = "1970-01-01") @PathVariable("date") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date,
8484
@ApiParam(value = "Updated last visit timestamp", defaultValue = "1971-12-19T03:39:57-08:00") @Valid @RequestParam(value = "visitDate", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime visitDate
8585
);
8686

samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/api/PetApi.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ ResponseEntity<Void> addPet(
9393
value = PetApi.PATH_DELETE_PET
9494
)
9595
ResponseEntity<Void> deletePet(
96-
@NotNull @Parameter(name = "petId", description = "Pet id to delete", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId,
96+
@Parameter(name = "petId", description = "Pet id to delete", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId,
9797
@Parameter(name = "api_key", description = "", in = ParameterIn.HEADER) @RequestHeader(value = "api_key", required = false) @Nullable String apiKey
9898
);
9999

@@ -204,7 +204,7 @@ ResponseEntity<List<Pet>> findPetsByTags(
204204
produces = { "application/json", "application/xml" }
205205
)
206206
ResponseEntity<Pet> getPetById(
207-
@NotNull @Parameter(name = "petId", deprecated = true, description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") @Deprecated Long petId
207+
@Parameter(name = "petId", deprecated = true, description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") @Deprecated Long petId
208208
);
209209

210210

@@ -270,7 +270,7 @@ ResponseEntity<Void> updatePet(
270270
consumes = "application/x-www-form-urlencoded"
271271
)
272272
ResponseEntity<Void> updatePetWithForm(
273-
@NotNull @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId,
273+
@Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId,
274274
@Parameter(name = "name", description = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) String name,
275275
@Parameter(name = "status", description = "Updated status of the pet") @Valid @RequestParam(value = "status", required = false) String status
276276
);
@@ -307,7 +307,7 @@ ResponseEntity<Void> updatePetWithForm(
307307
consumes = "multipart/form-data"
308308
)
309309
ResponseEntity<ModelApiResponse> uploadFile(
310-
@NotNull @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId,
310+
@Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId,
311311
@Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata,
312312
@Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file
313313
);

samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/api/StoreApi.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public interface StoreApi {
6060
value = StoreApi.PATH_DELETE_ORDER
6161
)
6262
ResponseEntity<Void> deleteOrder(
63-
@NotNull @Parameter(name = "orderId", description = "ID of the order that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("orderId") String orderId
63+
@Parameter(name = "orderId", description = "ID of the order that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("orderId") String orderId
6464
);
6565

6666

@@ -125,7 +125,7 @@ ResponseEntity<Map<String, Integer>> getInventory(
125125
produces = { "application/json", "application/xml" }
126126
)
127127
ResponseEntity<Order> getOrderById(
128-
@NotNull @Min(value = 1L) @Max(value = 5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("orderId") Long orderId
128+
@Min(value = 1L) @Max(value = 5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("orderId") Long orderId
129129
);
130130

131131

samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/api/UserApi.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ ResponseEntity<Void> createUsersWithListInput(
153153
value = UserApi.PATH_DELETE_USER
154154
)
155155
ResponseEntity<Void> deleteUser(
156-
@NotNull @Parameter(name = "username", description = "The name that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username
156+
@Parameter(name = "username", description = "The name that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username
157157
);
158158

159159

@@ -187,7 +187,7 @@ ResponseEntity<Void> deleteUser(
187187
produces = { "application/json", "application/xml" }
188188
)
189189
ResponseEntity<User> getUserByName(
190-
@NotNull @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username
190+
@Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username
191191
);
192192

193193

@@ -282,7 +282,7 @@ ResponseEntity<Void> logoutUser(
282282
consumes = "application/json"
283283
)
284284
ResponseEntity<Void> updateUser(
285-
@NotNull @Parameter(name = "username", description = "name that need to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username,
285+
@Parameter(name = "username", description = "name that need to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username,
286286
@Parameter(name = "User", description = "Updated user object", required = true) @Valid @RequestBody User user
287287
);
288288

samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/PetApi.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ ResponseEntity<Pet> addPet(
9292
value = PetApi.PATH_DELETE_PET
9393
)
9494
ResponseEntity<Void> deletePet(
95-
@NotNull @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId,
95+
@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId,
9696
@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) @Nullable String apiKey
9797
);
9898

@@ -202,7 +202,7 @@ ResponseEntity<List<Pet>> findPetsByTags(
202202
produces = { "application/json", "application/xml" }
203203
)
204204
ResponseEntity<Pet> getPetById(
205-
@NotNull @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId
205+
@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId
206206
);
207207

208208

@@ -280,7 +280,7 @@ ResponseEntity<Pet> updatePet(
280280
consumes = "application/x-www-form-urlencoded"
281281
)
282282
ResponseEntity<Void> updatePetWithForm(
283-
@NotNull @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId,
283+
@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId,
284284
@ApiParam(value = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) String name,
285285
@ApiParam(value = "Updated status of the pet") @Valid @RequestParam(value = "status", required = false) String status
286286
);
@@ -319,7 +319,7 @@ ResponseEntity<Void> updatePetWithForm(
319319
consumes = "multipart/form-data"
320320
)
321321
ResponseEntity<ModelApiResponse> uploadFile(
322-
@NotNull @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,
322+
@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,
323323
@ApiParam(value = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata,
324324
@ApiParam(value = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file
325325
);

samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/StoreApi.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public interface StoreApi {
4949
value = StoreApi.PATH_DELETE_ORDER
5050
)
5151
ResponseEntity<Void> deleteOrder(
52-
@NotNull @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") String orderId
52+
@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") String orderId
5353
);
5454

5555

@@ -112,7 +112,7 @@ ResponseEntity<Map<String, Integer>> getInventory(
112112
produces = { "application/json", "application/xml" }
113113
)
114114
ResponseEntity<Order> getOrderById(
115-
@NotNull @Min(value = 1L) @Max(value = 5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId
115+
@Min(value = 1L) @Max(value = 5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId
116116
);
117117

118118

samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/UserApi.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ ResponseEntity<Void> createUsersWithListInput(
142142
value = UserApi.PATH_DELETE_USER
143143
)
144144
ResponseEntity<Void> deleteUser(
145-
@NotNull @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username
145+
@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username
146146
);
147147

148148

@@ -174,7 +174,7 @@ ResponseEntity<Void> deleteUser(
174174
produces = { "application/json", "application/xml" }
175175
)
176176
ResponseEntity<User> getUserByName(
177-
@NotNull @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username
177+
@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username
178178
);
179179

180180

@@ -267,7 +267,7 @@ ResponseEntity<Void> logoutUser(
267267
consumes = "application/json"
268268
)
269269
ResponseEntity<Void> updateUser(
270-
@NotNull @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username,
270+
@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username,
271271
@ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User user
272272
);
273273

samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/api/PetController.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ ResponseEntity<Void> addPet(
8888
value = PetController.PATH_DELETE_PET
8989
)
9090
ResponseEntity<Void> deletePet(
91-
@NotNull @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId,
91+
@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId,
9292
@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) @Nullable String apiKey
9393
);
9494

@@ -202,7 +202,7 @@ ResponseEntity<List<Pet>> findPetsByTags(
202202
produces = { "application/json", "application/xml" }
203203
)
204204
ResponseEntity<Pet> getPetById(
205-
@NotNull @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId
205+
@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId
206206
);
207207

208208

@@ -272,7 +272,7 @@ ResponseEntity<Void> updatePet(
272272
consumes = "application/x-www-form-urlencoded"
273273
)
274274
ResponseEntity<Void> updatePetWithForm(
275-
@NotNull @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId,
275+
@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId,
276276
@ApiParam(value = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) String name,
277277
@ApiParam(value = "Updated status of the pet") @Valid @RequestParam(value = "status", required = false) String status
278278
);
@@ -310,7 +310,7 @@ ResponseEntity<Void> updatePetWithForm(
310310
consumes = "multipart/form-data"
311311
)
312312
ResponseEntity<ModelApiResponse> uploadFile(
313-
@NotNull @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,
313+
@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,
314314
@ApiParam(value = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata,
315315
@ApiParam(value = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file
316316
);

samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/api/StoreController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public interface StoreController {
4949
value = StoreController.PATH_DELETE_ORDER
5050
)
5151
ResponseEntity<Void> deleteOrder(
52-
@NotNull @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") String orderId
52+
@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") String orderId
5353
);
5454

5555

@@ -112,7 +112,7 @@ ResponseEntity<Map<String, Integer>> getInventory(
112112
produces = { "application/json", "application/xml" }
113113
)
114114
ResponseEntity<Order> getOrderById(
115-
@NotNull @Min(value = 1L) @Max(value = 5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId
115+
@Min(value = 1L) @Max(value = 5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId
116116
);
117117

118118

samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/api/UserController.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ ResponseEntity<Void> createUsersWithListInput(
125125
value = UserController.PATH_DELETE_USER
126126
)
127127
ResponseEntity<Void> deleteUser(
128-
@NotNull @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username
128+
@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username
129129
);
130130

131131

@@ -156,7 +156,7 @@ ResponseEntity<Void> deleteUser(
156156
produces = { "application/json", "application/xml" }
157157
)
158158
ResponseEntity<User> getUserByName(
159-
@NotNull @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username
159+
@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username
160160
);
161161

162162

@@ -264,7 +264,7 @@ ResponseEntity<Void> logoutUserOptions(
264264
value = UserController.PATH_UPDATE_USER
265265
)
266266
ResponseEntity<Void> updateUser(
267-
@NotNull @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username,
267+
@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username,
268268
@ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body
269269
);
270270

0 commit comments

Comments
 (0)