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

@@ -222,7 +222,7 @@ public interface FakeApi {
)
ResponseEntity<ResponseObjectWithDifferentFieldNames> responseObjectDifferentNames(
@Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId
@NotNull @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId
) throws Exception;
@@ -629,7 +629,7 @@ public interface FakeApi {
)
ResponseEntity<ModelApiResponse> uploadFileWithRequiredFile(
@Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId,
@NotNull @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId,
@Parameter(name = "requiredFile", description = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile,
@Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata
) throws Exception;

View File

@@ -103,7 +103,7 @@ public interface PetApi {
)
ResponseEntity<Void> deletePet(
@Parameter(name = "petId", description = "Pet id to delete", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId,
@NotNull @Parameter(name = "petId", description = "Pet id to delete", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId,
@Parameter(name = "api_key", description = "", in = ParameterIn.HEADER) @RequestHeader(value = "api_key", required = false) @Nullable String apiKey
) throws Exception;
@@ -217,7 +217,7 @@ public interface PetApi {
)
ResponseEntity<Pet> getPetById(
@Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId
@NotNull @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId
) throws Exception;
@@ -287,7 +287,7 @@ public interface PetApi {
)
ResponseEntity<Void> updatePetWithForm(
@Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId,
@NotNull @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId,
@Parameter(name = "name", description = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) String name,
@Parameter(name = "status", description = "Updated status of the pet") @Valid @RequestParam(value = "status", required = false) String status
) throws Exception;
@@ -325,7 +325,7 @@ public interface PetApi {
)
ResponseEntity<ModelApiResponse> uploadFile(
@Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId,
@NotNull @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId,
@Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata,
@Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file
) throws Exception;

View File

@@ -64,7 +64,7 @@ public interface StoreApi {
)
ResponseEntity<Void> deleteOrder(
@Parameter(name = "order_id", description = "ID of the order that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("order_id") String orderId
@NotNull @Parameter(name = "order_id", description = "ID of the order that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("order_id") String orderId
) throws Exception;
@@ -131,7 +131,7 @@ public interface StoreApi {
)
ResponseEntity<Order> getOrderById(
@Min(1L) @Max(5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("order_id") Long orderId
@NotNull @Min(1L) @Max(5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("order_id") Long orderId
) throws Exception;

View File

@@ -148,7 +148,7 @@ public interface UserApi {
)
ResponseEntity<Void> deleteUser(
@Parameter(name = "username", description = "The name that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username
@NotNull @Parameter(name = "username", description = "The name that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username
) throws Exception;
@@ -183,7 +183,7 @@ public interface UserApi {
)
ResponseEntity<User> getUserByName(
@Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username
@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
) throws Exception;
@@ -275,7 +275,7 @@ public interface UserApi {
)
ResponseEntity<Void> updateUser(
@Parameter(name = "username", description = "name that need to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username,
@NotNull @Parameter(name = "username", description = "name that need to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username,
@Parameter(name = "User", description = "Updated user object", required = true) @Valid @RequestBody User user
) throws Exception;