Skip to content

Commit ce48bc2

Browse files
AS-3270: Use regular expression to constrain lineItemId.
1 parent fcad5e0 commit ce48bc2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

farms-api/farms-api-rest-endpoints/src/main/java/ca/bc/gov/farms/api/rest/v1/endpoints/LineItemEndpoints.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public Response getLineItemsByProgramYear(
6767
@ApiResponse(responseCode = "404", description = "Not Found"),
6868
@ApiResponse(responseCode = "500", description = "Internal Server Error", content = @Content(schema = @Schema(implementation = MessageListRsrc.class))) })
6969
@GET
70-
@Path("/{lineItemId}")
70+
@Path("/{lineItemId:\\d+}")
7171
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
7272
public Response getLineItem(
7373
@Parameter(description = "The identifier of the Line Item resource.") @PathParam("lineItemId") Long lineItemId);
@@ -115,7 +115,7 @@ public Response createLineItem(
115115
@ApiResponse(responseCode = "404", description = "Not Found"),
116116
@ApiResponse(responseCode = "500", description = "Internal Server Error", content = @Content(schema = @Schema(implementation = MessageListRsrc.class))) })
117117
@DELETE
118-
@Path("/{lineItemId}")
118+
@Path("/{lineItemId:\\d+}")
119119
public Response deleteLineItem(
120120
@Parameter(description = "The identifier of the Line Item resource.") @PathParam("lineItemId") Long lineItemId);
121121

@@ -137,7 +137,7 @@ public Response deleteLineItem(
137137
@ApiResponse(responseCode = "404", description = "Not Found"),
138138
@ApiResponse(responseCode = "500", description = "Internal Server Error", content = @Content(schema = @Schema(implementation = MessageListRsrc.class))) })
139139
@PUT
140-
@Path("/{lineItemId}")
140+
@Path("/{lineItemId:\\d+}")
141141
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
142142
@Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
143143
public Response updateLineItem(

0 commit comments

Comments
 (0)