diff --git a/app/src/main/java/ch/sbb/polarion/extension/generic/rest/model/Context.java b/app/src/main/java/ch/sbb/polarion/extension/generic/rest/model/Context.java index 4c7a1eb..327a698 100644 --- a/app/src/main/java/ch/sbb/polarion/extension/generic/rest/model/Context.java +++ b/app/src/main/java/ch/sbb/polarion/extension/generic/rest/model/Context.java @@ -3,20 +3,21 @@ import io.swagger.v3.oas.annotations.media.Schema; import lombok.Getter; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; @Getter @Schema(description = "Represents the context for building URLs related to Polarion services") public class Context { - @Schema(description = "The extension context used as a base for URL construction", example = "pdf-exporter") + @Schema(description = "The extension context used as a base for URL construction") private final @NotNull String extensionContext; - @Schema(description = "Returns the base URL constructed with the extension context", example = "/polarion/pdf-exporter") + @Schema(description = "Returns the base URL constructed with the extension context") public @NotNull String getBaseUrl() { return "/polarion/" + extensionContext; } - @Schema(description = "Returns the REST API URL constructed with the extension context", example = "/polarion/pdf-exporter/rest") + @Schema(description = "Returns the REST API URL constructed with the extension context") public @NotNull String getRestUrl() { return "/polarion/" + extensionContext + "/rest"; } @@ -26,7 +27,7 @@ public class Context { return getRestUrl() + "/swagger"; } - public Context(String extensionContext) { + public Context(@Nullable String extensionContext) { if (extensionContext == null || extensionContext.isBlank()) { throw new IllegalArgumentException("Extension context must be provided"); }