Skip to content

Commit

Permalink
Resolved an issue with the descriptions that Swagger UI displays (par…
Browse files Browse the repository at this point in the history
…ams where they were not required)
  • Loading branch information
slloyd-src committed Sep 18, 2024
1 parent 97d1ef8 commit 27a48bf
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/main/java/org/uksrc/archive/ObservationResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,23 @@ public Response getAllObservations(@QueryParam("page") Integer page, @QueryParam
@Operation(summary = "Retrieve observations from a collection", description = "Returns a list of observations that are members of the supplied collection")
@Parameters({
@Parameter(
name = "collection",
name = "collectionId",
description = "The collection name to retrieve observations for",
in = ParameterIn.PATH,
required = true,
example = "e-merlin"
),
@Parameter(
name = "page",
description = "The page number to retrieve, zero-indexed. If not provided, ALL results are returned.",
in = ParameterIn.QUERY,
schema = @Schema(type = SchemaType.INTEGER, minimum = "0")
),
@Parameter(
name = "size",
description = "The number of observations per page. If not provided, ALL results are returned.",
in = ParameterIn.QUERY,
schema = @Schema(type = SchemaType.INTEGER, minimum = "1")
)
})
@APIResponse(
Expand Down Expand Up @@ -394,7 +407,7 @@ private Response errorResponse (@NotNull String message){
* @param query query to perform
* @return Response containing HTTP response code and expected body if successful.
*/
private Response performQuery(@QueryParam("page") Integer page, @QueryParam("size") Integer size, TypedQuery<Observation> query) {
private Response performQuery(Integer page, Integer size, TypedQuery<Observation> query) {
try {
if (page != null && size != null) {
int firstResult = page * size;
Expand Down

0 comments on commit 27a48bf

Please sign in to comment.