From 098a7d57b7905b377d7476c816deda9a55daf896 Mon Sep 17 00:00:00 2001 From: Kaveh Shahedi Date: Thu, 7 Nov 2024 14:27:16 -0500 Subject: [PATCH] server: Update swagger schema for BookmarkQueryParameters Since the BookmarkServiceManager class is mentioning the BookmarkQueryParameters for its endpoints, the actual swagger documentation was not aligned with it. Now, the swagger documentation (schema) is same as its implementation and usage. [Fixed] Incorrect swagger documentation for BookmarkQueryParameters is fixed Signed-off-by: Kaveh Shahedi --- .../core/model/BookmarkQueryParameters.java | 42 +++++++++++++------ 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/trace-server/org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core/src/org/eclipse/tracecompass/incubator/internal/trace/server/jersey/rest/core/model/BookmarkQueryParameters.java b/trace-server/org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core/src/org/eclipse/tracecompass/incubator/internal/trace/server/jersey/rest/core/model/BookmarkQueryParameters.java index 00f77212..05e2e83a 100644 --- a/trace-server/org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core/src/org/eclipse/tracecompass/incubator/internal/trace/server/jersey/rest/core/model/BookmarkQueryParameters.java +++ b/trace-server/org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core/src/org/eclipse/tracecompass/incubator/internal/trace/server/jersey/rest/core/model/BookmarkQueryParameters.java @@ -10,6 +10,8 @@ *******************************************************************************/ package org.eclipse.tracecompass.incubator.internal.trace.server.jersey.rest.core.model; +import com.fasterxml.jackson.annotation.JsonProperty; + import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema.RequiredMode; @@ -20,21 +22,35 @@ * @since 10.1 */ public interface BookmarkQueryParameters { - /** - * @return The bookmark name - */ - @Schema(description = "The name to give this bookmark", requiredMode = RequiredMode.REQUIRED) - String getName(); /** - * @return The start time + * @return The bookmark parameters */ - @Schema(description = "The bookmark's start time", requiredMode = RequiredMode.REQUIRED) - long getStart(); + @JsonProperty("parameters") + @Schema(description = "The bookmark parameters", requiredMode = RequiredMode.REQUIRED) + BookmarkParameters getParameters(); - /** - * @return The end time - */ - @Schema(description = "The bookmark's end time", requiredMode = RequiredMode.REQUIRED) - long getEnd(); + + interface BookmarkParameters { + /** + * @return The bookmark name + */ + @JsonProperty("name") + @Schema(description = "The name to give this bookmark", requiredMode = RequiredMode.REQUIRED) + String getName(); + + /** + * @return The start time + */ + @JsonProperty("start") + @Schema(description = "The bookmark's start time", requiredMode = RequiredMode.REQUIRED) + long getStart(); + + /** + * @return The end time + */ + @JsonProperty("end") + @Schema(description = "The bookmark's end time", requiredMode = RequiredMode.REQUIRED) + long getEnd(); + } } \ No newline at end of file