Fix #21921 by marking required path parameters as @NotNull (#21951)

This commit is contained in:
GregDThomas
2025-09-13 10:48:47 +01:00
committed by GitHub
parent 0edcc9d204
commit ec28d6261c
142 changed files with 402 additions and 402 deletions

View File

@@ -101,7 +101,7 @@ public interface PetApi {
@ResponseStatus(HttpStatus.BAD_REQUEST)
default void deletePet(
@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId,
@NotNull @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId,
@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) @Nullable String apiKey
) {
getDelegate().deletePet(petId, apiKey);
@@ -223,7 +223,7 @@ public interface PetApi {
@ResponseStatus(HttpStatus.OK)
default Pet getPetById(
@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId
@NotNull @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId
) {
return getDelegate().getPetById(petId);
}
@@ -309,7 +309,7 @@ public interface PetApi {
@ResponseStatus(HttpStatus.METHOD_NOT_ALLOWED)
default void updatePetWithForm(
@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId,
@NotNull @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId,
@ApiParam(value = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) String name,
@ApiParam(value = "Updated status of the pet") @Valid @RequestParam(value = "status", required = false) String status
) {
@@ -352,7 +352,7 @@ public interface PetApi {
@ResponseStatus(HttpStatus.OK)
default ModelApiResponse uploadFile(
@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,
@NotNull @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,
@ApiParam(value = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata,
@ApiParam(value = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file
) {

View File

@@ -54,7 +54,7 @@ public interface StoreApi {
@ResponseStatus(HttpStatus.BAD_REQUEST)
default void deleteOrder(
@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") String orderId
@NotNull @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") String orderId
) {
getDelegate().deleteOrder(orderId);
}
@@ -125,7 +125,7 @@ public interface StoreApi {
@ResponseStatus(HttpStatus.OK)
default Order getOrderById(
@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId
@NotNull @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId
) {
return getDelegate().getOrderById(orderId);
}

View File

@@ -159,7 +159,7 @@ public interface UserApi {
@ResponseStatus(HttpStatus.BAD_REQUEST)
default void deleteUser(
@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username
@NotNull @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username
) {
getDelegate().deleteUser(username);
}
@@ -195,7 +195,7 @@ public interface UserApi {
@ResponseStatus(HttpStatus.OK)
default User getUserByName(
@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username
@NotNull @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username
) {
return getDelegate().getUserByName(username);
}
@@ -300,7 +300,7 @@ public interface UserApi {
@ResponseStatus(HttpStatus.BAD_REQUEST)
default void updateUser(
@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username,
@NotNull @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username,
@ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User user
) {
getDelegate().updateUser(username, user);