diff --git a/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiActionFeedback.java b/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiActionFeedback.java index 79872b8edb..05c7a9c39e 100644 --- a/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiActionFeedback.java +++ b/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiActionFeedback.java @@ -15,6 +15,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** *

@@ -39,6 +40,7 @@ @JsonIgnoreProperties(ignoreUnknown = true) public class DdiActionFeedback { + @Schema(example = "2023-08-03T12:31:41.890992967Z") private final String time; @NotNull diff --git a/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiActionHistory.java b/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiActionHistory.java index 21d70220dd..b719561e07 100644 --- a/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiActionHistory.java +++ b/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiActionHistory.java @@ -11,6 +11,7 @@ import java.util.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.eclipse.hawkbit.ddi.rest.api.DdiRootControllerRestApi; import com.fasterxml.jackson.annotation.JsonCreator; @@ -32,6 +33,7 @@ public class DdiActionHistory { @JsonProperty("status") + @Schema(example = "RUNNING") private final String actionStatus; @JsonProperty("messages") diff --git a/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiActivateAutoConfirmation.java b/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiActivateAutoConfirmation.java index 2345a78a3e..bafa46c216 100644 --- a/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiActivateAutoConfirmation.java +++ b/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiActivateAutoConfirmation.java @@ -12,14 +12,17 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; @JsonIgnoreProperties(ignoreUnknown = true) public class DdiActivateAutoConfirmation { @JsonProperty(required = false) + @Schema(example = "exampleUser") private final String initiator; @JsonProperty(required = false) + @Schema(example = "exampleRemark") private final String remark; /** diff --git a/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiArtifact.java b/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiArtifact.java index 6b0d9d5a9a..7f88058823 100644 --- a/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiArtifact.java +++ b/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiArtifact.java @@ -11,6 +11,7 @@ import javax.validation.constraints.NotNull; +import io.swagger.v3.oas.annotations.media.Schema; import org.springframework.hateoas.RepresentationModel; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @@ -25,12 +26,14 @@ public class DdiArtifact extends RepresentationModel { @NotNull @JsonProperty + @Schema(example = "binary.tgz") private String filename; @JsonProperty private DdiArtifactHash hashes; @JsonProperty + @Schema(example = "3") private Long size; public DdiArtifactHash getHashes() { diff --git a/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiArtifactHash.java b/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiArtifactHash.java index a00b3181ed..0ee1d3d9ef 100644 --- a/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiArtifactHash.java +++ b/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiArtifactHash.java @@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * Hashes for given Artifact. @@ -21,13 +22,16 @@ public class DdiArtifactHash { @JsonProperty + @Schema(example = "2d86c2a659e364e9abba49ea6ffcd53dd5559f05") private String sha1; @JsonProperty + @Schema(example = "0d1b08c34858921bc7c662b228acb7ba") private String md5; @JsonProperty @JsonInclude(Include.NON_NULL) + @Schema(example = "a03b221c6c6eae7122ca51695d456d5222e524889136394944b2f9763b483615") private String sha256; /** diff --git a/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiAutoConfirmationState.java b/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiAutoConfirmationState.java index 36ab89d8ab..6903b367f5 100644 --- a/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiAutoConfirmationState.java +++ b/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiAutoConfirmationState.java @@ -14,6 +14,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; import org.springframework.hateoas.RepresentationModel; @JsonInclude(JsonInclude.Include.NON_NULL) @@ -22,10 +23,14 @@ public class DdiAutoConfirmationState extends RepresentationModel { @NotNull + @Schema(example = "true") private boolean active; + @Schema(example = "exampleUserId") private String initiator; + @Schema(example = "exampleRemark") private String remark; + @Schema(example = "1691065895439") private Long activatedAt; /** diff --git a/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiCancel.java b/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiCancel.java index 70cda0f29d..faee27afd7 100644 --- a/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiCancel.java +++ b/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiCancel.java @@ -14,6 +14,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * Cancel action to be provided to the target. @@ -21,6 +22,7 @@ @JsonIgnoreProperties(ignoreUnknown = true) public class DdiCancel { + @Schema(example = "11") private final String id; @NotNull diff --git a/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiCancelActionToStop.java b/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiCancelActionToStop.java index 857189f1a3..f192d572bb 100644 --- a/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiCancelActionToStop.java +++ b/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiCancelActionToStop.java @@ -14,6 +14,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * The action that has to be stopped by the target. @@ -22,6 +23,7 @@ public class DdiCancelActionToStop { @NotNull + @Schema(example = "11") private final String stopId; /** diff --git a/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiChunk.java b/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiChunk.java index 96add2d819..d4a7018f75 100644 --- a/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiChunk.java +++ b/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiChunk.java @@ -17,6 +17,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * Deployment chunks. @@ -26,14 +27,17 @@ public class DdiChunk { @JsonProperty("part") @NotNull + @Schema(example = "bApp") private String part; @JsonProperty("version") @NotNull + @Schema(example = "1.2.0") private String version; @JsonProperty("name") @NotNull + @Schema(example = "oneApp") private String name; @JsonProperty("encrypted") diff --git a/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiConfigData.java b/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiConfigData.java index ec97d07560..4eabfca0de 100644 --- a/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiConfigData.java +++ b/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiConfigData.java @@ -7,8 +7,9 @@ * * SPDX-License-Identifier: EPL-2.0 */ -package org.eclipse.hawkbit.ddi.json.model; + package org.eclipse.hawkbit.ddi.json.model; +import java.util.HashMap; import java.util.Map; import javax.validation.constraints.NotEmpty; @@ -16,6 +17,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * Feedback channel for ConfigData action. @@ -26,6 +28,7 @@ public class DdiConfigData { @NotEmpty private final Map data; + @Schema(example = "merge") private final DdiUpdateMode mode; /** diff --git a/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiConfirmationBaseAction.java b/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiConfirmationBaseAction.java index 37c6637cd4..feb20af733 100644 --- a/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiConfirmationBaseAction.java +++ b/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiConfirmationBaseAction.java @@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; import org.springframework.hateoas.RepresentationModel; import javax.validation.constraints.NotNull; @@ -27,6 +28,7 @@ public class DdiConfirmationBaseAction extends RepresentationModel details; diff --git a/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiDeploymentBase.java b/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiDeploymentBase.java index 223baf2b19..37693b5db6 100644 --- a/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiDeploymentBase.java +++ b/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiDeploymentBase.java @@ -11,6 +11,7 @@ import javax.validation.constraints.NotNull; +import io.swagger.v3.oas.annotations.media.Schema; import org.springframework.hateoas.RepresentationModel; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @@ -27,6 +28,7 @@ public class DdiDeploymentBase extends RepresentationModel { @JsonProperty("id") @NotNull + @Schema(example = "8") private String id; @JsonProperty("deployment") diff --git a/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiMetadata.java b/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiMetadata.java index 533df8dc38..9a70dda804 100644 --- a/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiMetadata.java +++ b/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiMetadata.java @@ -14,6 +14,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * Additional metadata to be provided for the target/device. @@ -23,10 +24,12 @@ public class DdiMetadata { @JsonProperty @NotNull + @Schema(example = "aMetadataKey") private final String key; @JsonProperty @NotNull + @Schema(example = "Metadata value as defined in software module") private final String value; @JsonCreator diff --git a/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiPolling.java b/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiPolling.java index d9e31eaf82..3be0353039 100644 --- a/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiPolling.java +++ b/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiPolling.java @@ -13,6 +13,10 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyDescription; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.ExampleObject; +import io.swagger.v3.oas.annotations.media.Schema; /** * Polling interval for the SP target. @@ -22,6 +26,7 @@ public class DdiPolling { @JsonProperty + @Schema(example = "12:00:00") private String sleep; /** diff --git a/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiProgress.java b/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiProgress.java index 25e823f0d8..f9fc0d62b9 100644 --- a/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiProgress.java +++ b/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiProgress.java @@ -14,6 +14,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * Action fulfillment progress by means of gives the achieved amount of maximal @@ -23,8 +24,10 @@ public class DdiProgress { @NotNull + @Schema(example = "2") private final Integer cnt; + @Schema(example = "5") private final Integer of; /** diff --git a/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiResult.java b/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiResult.java index 6fa0f1dae1..4f5df1cf42 100644 --- a/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiResult.java +++ b/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiResult.java @@ -16,6 +16,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; /** * Result information of the action progress which can by an intermediate or diff --git a/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiStatus.java b/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiStatus.java index 68365241bc..aab3f41ce4 100644 --- a/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiStatus.java +++ b/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiStatus.java @@ -19,6 +19,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; /** * Details status information concerning the action processing. @@ -34,6 +35,7 @@ public class DdiStatus { @Valid private final DdiResult result; + @Schema(example = "200") private final Integer code; private final List details; diff --git a/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/rest/api/DdiRootControllerRestApi.java b/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/rest/api/DdiRootControllerRestApi.java index 7bc84394e9..7e8f684495 100644 --- a/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/rest/api/DdiRootControllerRestApi.java +++ b/hawkbit-rest/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/rest/api/DdiRootControllerRestApi.java @@ -449,8 +449,9 @@ ResponseEntity getControllerInstalledAction(@PathVariable("te """) @ApiResponses(value = { @ApiResponse(responseCode = "200", description = """ - - """, content = @Content(schema = @Schema(oneOf = {}))), //TODO: 2 RESPONSES WHEN AUTO CONFIRMATION IS ACTIVE OR NOT + The response body in case auto-confirmation is active is richer - it contains additional information + such as initiator, remark and when the auto-confirmation had been activated. + """), @ApiResponse(responseCode = "400", description = "Bad Request - e.g. invalid parameters", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionInfo.class))), @ApiResponse(responseCode = "401", description = "The request requires user authentication.", content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), @ApiResponse(responseCode = "403", description = "Insufficient permissions, entity is not allowed to be changed (i.e. read-only) or data volume restriction applies.", content = @Content(mediaType = "application/json", schema = @Schema(hidden = true))), diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/MgmtBaseEntity.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/MgmtBaseEntity.java index b20fec2193..3f5c2be7ee 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/MgmtBaseEntity.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/MgmtBaseEntity.java @@ -9,6 +9,7 @@ */ package org.eclipse.hawkbit.mgmt.json.model; +import io.swagger.v3.oas.annotations.media.Schema; import org.springframework.hateoas.Link; import org.springframework.hateoas.RepresentationModel; @@ -22,15 +23,19 @@ public abstract class MgmtBaseEntity extends RepresentationModel { @JsonProperty + @Schema(example = "bumlux") private String createdBy; @JsonProperty + @Schema(example = "1691065905897") private Long createdAt; @JsonProperty + @Schema(example = "bumlux") private String lastModifiedBy; @JsonProperty + @Schema(example = "1691065906407") private Long lastModifiedAt; /** diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/MgmtId.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/MgmtId.java index 540f378c89..5b91ff38d2 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/MgmtId.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/MgmtId.java @@ -11,6 +11,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import io.swagger.v3.oas.annotations.media.Schema; /** * A generic abstract rest model which contains only a ID for use-case e.g. @@ -20,6 +21,7 @@ */ @JsonIgnoreProperties(ignoreUnknown = true) public class MgmtId { + @Schema(example = "108") private Long id; /** diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/MgmtMaintenanceWindowRequestBody.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/MgmtMaintenanceWindowRequestBody.java index 856063f684..aee73842af 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/MgmtMaintenanceWindowRequestBody.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/MgmtMaintenanceWindowRequestBody.java @@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * Request body for maintenance window PUT/POST commands, based on a schedule @@ -24,12 +25,15 @@ @JsonIgnoreProperties(ignoreUnknown = true) public class MgmtMaintenanceWindowRequestBody { @JsonProperty + @Schema(example = "10 12 14 3 8 ? 2023") private String schedule; @JsonProperty + @Schema(example = "00:10:00") private String duration; @JsonProperty + @Schema(example = "+00:00") private String timezone; public String getSchedule() { diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/MgmtMetadata.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/MgmtMetadata.java index 02dd7dbe9f..81129eb2e1 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/MgmtMetadata.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/MgmtMetadata.java @@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * The representation of an meta data in the REST API for POST/Create. @@ -23,8 +24,10 @@ public class MgmtMetadata { @JsonProperty(required = true) + @Schema(example = "someKnownKey") private String key; @JsonProperty + @Schema(example = "someKnownKeyValue") private String value; public String getKey() { diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/MgmtMetadataBodyPut.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/MgmtMetadataBodyPut.java index 5d34d22bd9..9334ba6876 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/MgmtMetadataBodyPut.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/MgmtMetadataBodyPut.java @@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * The representation of an meta data in the REST API for PUT/Update. @@ -23,6 +24,7 @@ public class MgmtMetadataBodyPut { @JsonProperty + @Schema(example = "someValue") private String value; public String getValue() { diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/MgmtNamedEntity.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/MgmtNamedEntity.java index 1f169b46c8..e404051ed3 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/MgmtNamedEntity.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/MgmtNamedEntity.java @@ -10,6 +10,7 @@ package org.eclipse.hawkbit.mgmt.json.model; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * A json annotated rest model for NamedEntity to RESTful API representation. @@ -18,9 +19,11 @@ public abstract class MgmtNamedEntity extends MgmtBaseEntity { @JsonProperty(required = true) + @Schema(example = "Name of entity") private String name; @JsonProperty + @Schema(example = "Description of entity") private String description; /** diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/MgmtPollStatus.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/MgmtPollStatus.java index e00edee9ab..bef85bce79 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/MgmtPollStatus.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/MgmtPollStatus.java @@ -13,6 +13,9 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +import static org.checkerframework.checker.units.qual.Prefix.exa; /** * A json annotated rest model for PollStatus to RESTful API representation. @@ -26,12 +29,15 @@ public class MgmtPollStatus { @JsonProperty + @Schema(example = "1691065941102") private Long lastRequestAt; @JsonProperty + @Schema(example = "1691109141102") private Long nextExpectedRequestAt; @JsonProperty + @Schema(example = "false") private boolean overdue; /** diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/action/MgmtAction.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/action/MgmtAction.java index ff542ad617..980078b6cd 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/action/MgmtAction.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/action/MgmtAction.java @@ -9,6 +9,7 @@ */ package org.eclipse.hawkbit.mgmt.json.model.action; +import io.swagger.v3.oas.annotations.media.Schema; import org.eclipse.hawkbit.mgmt.json.model.MgmtBaseEntity; import org.eclipse.hawkbit.mgmt.json.model.MgmtMaintenanceWindow; import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtActionType; @@ -47,36 +48,46 @@ public class MgmtAction extends MgmtBaseEntity { public static final String ACTION_PENDING = "pending"; @JsonProperty("id") + @Schema(example = "7") private Long actionId; @JsonProperty + @Schema(example = "update") private String type; @JsonProperty + @Schema(example = "finished") private String status; @JsonProperty + @Schema(example = "finished") private String detailStatus; @JsonProperty + @Schema(example = "1691065903238") private Long forceTime; @JsonProperty(value = "forceType") private MgmtActionType actionType; @JsonProperty + @Schema(example = "600") private Integer weight; @JsonProperty + @Schema(hidden = true) private MgmtMaintenanceWindow maintenanceWindow; @JsonProperty + @Schema(example = "1") private Long rollout; @JsonProperty + @Schema(example = "rollout") private String rolloutName; @JsonProperty + @Schema(example = "200") private Integer lastStatusCode; public MgmtMaintenanceWindow getMaintenanceWindow() { diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/action/MgmtActionStatus.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/action/MgmtActionStatus.java index 3d78eb6bec..05405ec9a5 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/action/MgmtActionStatus.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/action/MgmtActionStatus.java @@ -15,6 +15,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * A json annotated rest model for ActionStatus to RESTful API representation. @@ -25,18 +26,22 @@ public class MgmtActionStatus { @JsonProperty("id") + @Schema(example = "21") private Long statusId; @JsonProperty + @Schema(example = "running") private String type; @JsonProperty private List messages; @JsonProperty + @Schema(example = "1691065929524") private Long reportedAt; @JsonProperty + @Schema(example = "200") private Integer code; /** diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/artifact/MgmtArtifact.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/artifact/MgmtArtifact.java index adb6cf26a9..1d8a1edf17 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/artifact/MgmtArtifact.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/artifact/MgmtArtifact.java @@ -9,6 +9,7 @@ */ package org.eclipse.hawkbit.mgmt.json.model.artifact; +import io.swagger.v3.oas.annotations.media.Schema; import org.eclipse.hawkbit.mgmt.json.model.MgmtBaseEntity; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -25,15 +26,18 @@ public class MgmtArtifact extends MgmtBaseEntity { @JsonProperty("id") + @Schema(example = "3") private Long artifactId; @JsonProperty private MgmtArtifactHash hashes; @JsonProperty + @Schema(example = "file1") private String providedFilename; @JsonProperty + @Schema(example = "3") private Long size; public MgmtArtifact() { diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/artifact/MgmtArtifactHash.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/artifact/MgmtArtifactHash.java index 7b01560d8a..37d46d56c3 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/artifact/MgmtArtifactHash.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/artifact/MgmtArtifactHash.java @@ -10,6 +10,7 @@ package org.eclipse.hawkbit.mgmt.json.model.artifact; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * Hashes for given Artifact. @@ -19,12 +20,15 @@ public class MgmtArtifactHash { @JsonProperty + @Schema(example = "2d86c2a659e364e9abba49ea6ffcd53dd5559f05") private String sha1; @JsonProperty + @Schema(example = "0d1b08c34858921bc7c662b228acb7ba") private String md5; @JsonProperty + @Schema(example = "a03b221c6c6eae7122ca51695d456d5222e524889136394944b2f9763b483615") private String sha256; /** diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionset/MgmtDistributionSet.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionset/MgmtDistributionSet.java index 49254f5c56..429be0568c 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionset/MgmtDistributionSet.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionset/MgmtDistributionSet.java @@ -12,6 +12,7 @@ import java.util.ArrayList; import java.util.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.eclipse.hawkbit.mgmt.json.model.MgmtNamedEntity; import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModule; @@ -30,30 +31,38 @@ public class MgmtDistributionSet extends MgmtNamedEntity { @JsonProperty(value = "id", required = true) + @Schema(example = "51") private Long dsId; @JsonProperty + @Schema(example = "1.4.2") private String version; @JsonProperty private List modules = new ArrayList<>(); @JsonProperty + @Schema(example = "false") private boolean requiredMigrationStep; @JsonProperty + @Schema(example = "test_default_ds_type") private String type; @JsonProperty + @Schema(example = "OS (FW) mandatory, runtime (FW) and app (SW) optional") private String typeName; @JsonProperty + @Schema(example = "true") private Boolean complete; @JsonProperty + @Schema(example = "false") private boolean deleted; @JsonProperty + @Schema(example = "true") private boolean valid; public boolean isValid() { diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionset/MgmtDistributionSetRequestBodyPost.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionset/MgmtDistributionSetRequestBodyPost.java index d7c1a8f14f..6a0d1cdaec 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionset/MgmtDistributionSetRequestBodyPost.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionset/MgmtDistributionSetRequestBodyPost.java @@ -11,6 +11,7 @@ import java.util.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModuleAssigment; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @@ -29,12 +30,15 @@ public class MgmtDistributionSetRequestBodyPost extends MgmtDistributionSetReque // deprecated format from the time where os, application and runtime where // statically defined @JsonProperty + @Schema(hidden = true) private MgmtSoftwareModuleAssigment os; @JsonProperty + @Schema(hidden = true) private MgmtSoftwareModuleAssigment runtime; @JsonProperty + @Schema(hidden = true) private MgmtSoftwareModuleAssigment application; // deprecated format - END @@ -42,6 +46,7 @@ public class MgmtDistributionSetRequestBodyPost extends MgmtDistributionSetReque private List modules; @JsonProperty + @Schema(example = "test_default_ds_type") private String type; /** diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionset/MgmtDistributionSetRequestBodyPut.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionset/MgmtDistributionSetRequestBodyPut.java index 1e1ff7f83a..056778a40e 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionset/MgmtDistributionSetRequestBodyPut.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionset/MgmtDistributionSetRequestBodyPut.java @@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * A json annotated rest model for DistributionSet for PUT/POST. @@ -23,15 +24,19 @@ public class MgmtDistributionSetRequestBodyPut { @JsonProperty + @Schema(example = "dsOne") private String name; @JsonProperty + @Schema(example = "Description of the distribution set.") private String description; @JsonProperty + @Schema(example = "1.0.0") private String version; @JsonProperty + @Schema(example = "false") private Boolean requiredMigrationStep; /** diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionset/MgmtDistributionSetStatistics.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionset/MgmtDistributionSetStatistics.java index 958cf2fac9..e23b120bc2 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionset/MgmtDistributionSetStatistics.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionset/MgmtDistributionSetStatistics.java @@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.HashMap; import java.util.Map; diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionset/MgmtInvalidateDistributionSetRequestBody.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionset/MgmtInvalidateDistributionSetRequestBody.java index ed609fd2f4..4ce65b1411 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionset/MgmtInvalidateDistributionSetRequestBody.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionset/MgmtInvalidateDistributionSetRequestBody.java @@ -12,6 +12,7 @@ import javax.validation.constraints.NotNull; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * A json annotated rest model for invalidate DistributionSet requests. @@ -23,6 +24,7 @@ public class MgmtInvalidateDistributionSetRequestBody { @JsonProperty private MgmtCancelationType actionCancelationType; @JsonProperty + @Schema(example = "true") private boolean cancelRollouts; public MgmtCancelationType getActionCancelationType() { diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionset/MgmtTargetAssignmentResponseBody.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionset/MgmtTargetAssignmentResponseBody.java index dfbba9795d..323b625e70 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionset/MgmtTargetAssignmentResponseBody.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionset/MgmtTargetAssignmentResponseBody.java @@ -12,6 +12,7 @@ import java.util.List; import java.util.Objects; +import io.swagger.v3.oas.annotations.media.Schema; import org.springframework.hateoas.RepresentationModel; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionsettype/MgmtDistributionSetType.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionsettype/MgmtDistributionSetType.java index 8b1e169546..bebd7e4c1f 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionsettype/MgmtDistributionSetType.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionsettype/MgmtDistributionSetType.java @@ -9,6 +9,7 @@ */ package org.eclipse.hawkbit.mgmt.json.model.distributionsettype; +import io.swagger.v3.oas.annotations.media.Schema; import org.eclipse.hawkbit.mgmt.json.model.MgmtNamedEntity; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @@ -29,15 +30,19 @@ public class MgmtDistributionSetType extends MgmtNamedEntity { @JsonProperty(value = "id", required = true) + @Schema(example = "99") private Long moduleId; @JsonProperty(required = true) + @Schema(example = "os_app") private String key; @JsonProperty + @Schema(example = "false") private boolean deleted; @JsonProperty + @Schema(example = "black") private String colour; public boolean isDeleted() { diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionsettype/MgmtDistributionSetTypeRequestBodyPost.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionsettype/MgmtDistributionSetTypeRequestBodyPost.java index 5facc0edd2..8119eb506f 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionsettype/MgmtDistributionSetTypeRequestBodyPost.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionsettype/MgmtDistributionSetTypeRequestBodyPost.java @@ -11,6 +11,7 @@ import java.util.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype.MgmtSoftwareModuleTypeAssigment; import com.fasterxml.jackson.annotation.JsonProperty; @@ -22,9 +23,11 @@ public class MgmtDistributionSetTypeRequestBodyPost extends MgmtDistributionSetTypeRequestBodyPut { @JsonProperty(required = true) + @Schema(example = "Example type name") private String name; @JsonProperty(required = true) + @Schema(example = "Example key") private String key; @JsonProperty diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionsettype/MgmtDistributionSetTypeRequestBodyPut.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionsettype/MgmtDistributionSetTypeRequestBodyPut.java index 6f9395c075..3ac0247df1 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionsettype/MgmtDistributionSetTypeRequestBodyPut.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionsettype/MgmtDistributionSetTypeRequestBodyPut.java @@ -10,6 +10,7 @@ package org.eclipse.hawkbit.mgmt.json.model.distributionsettype; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * Request Body for DistributionSetType PUT, i.e. update. @@ -18,9 +19,11 @@ public class MgmtDistributionSetTypeRequestBodyPut { @JsonProperty + @Schema(example = "Example description") private String description; @JsonProperty + @Schema(example = "rgb(86,37,99)") private String colour; public String getDescription() { diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/rollout/MgmtRolloutCondition.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/rollout/MgmtRolloutCondition.java index 68f8730cc4..014d3fd90d 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/rollout/MgmtRolloutCondition.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/rollout/MgmtRolloutCondition.java @@ -12,6 +12,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; +import io.swagger.v3.oas.annotations.media.Schema; /** * @@ -21,6 +22,7 @@ public class MgmtRolloutCondition { private Condition condition = Condition.THRESHOLD; + @Schema(example = "50") private String expression = "100"; /** diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/rollout/MgmtRolloutErrorAction.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/rollout/MgmtRolloutErrorAction.java index 6f66dc0131..1d727faf34 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/rollout/MgmtRolloutErrorAction.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/rollout/MgmtRolloutErrorAction.java @@ -12,6 +12,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; +import io.swagger.v3.oas.annotations.media.Schema; /** * An action that runs when the error condition is met @@ -21,6 +22,7 @@ public class MgmtRolloutErrorAction { private ErrorAction action = ErrorAction.PAUSE; + @Schema(example = "80") private String expression; /** diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/rollout/MgmtRolloutResponseBody.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/rollout/MgmtRolloutResponseBody.java index 95c2f05d4d..3d8d4d4020 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/rollout/MgmtRolloutResponseBody.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/rollout/MgmtRolloutResponseBody.java @@ -12,6 +12,7 @@ import java.util.HashMap; import java.util.Map; +import io.swagger.v3.oas.annotations.media.Schema; import org.eclipse.hawkbit.mgmt.json.model.MgmtNamedEntity; import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtActionType; @@ -27,43 +28,55 @@ @JsonIgnoreProperties(ignoreUnknown = true) public class MgmtRolloutResponseBody extends MgmtNamedEntity { + @Schema(example = "controllerId==exampleTarget*") private String targetFilterQuery; + @Schema(example = "2") private Long distributionSetId; @JsonProperty(value = "id", required = true) + @Schema(example = "2") private Long rolloutId; @JsonProperty(required = true) + @Schema(example = "ready") private String status; @JsonProperty(required = true) + @Schema(example = "20") private Long totalTargets; @JsonProperty private Map totalTargetsPerStatus; @JsonProperty + @Schema(example = "5") private Integer totalGroups; @JsonProperty + @Schema(example = "1691065753136") private Long startAt; @JsonProperty + @Schema(example = "1691065762496") private Long forcetime; @JsonProperty + @Schema(example = "false") private boolean deleted; @JsonProperty private MgmtActionType type; @JsonProperty + @Schema(example = "400") private Integer weight; @JsonProperty + @Schema(example = "Approved remark.") private String approvalRemark; @JsonProperty + @Schema(example = "exampleUsername") private String approveDecidedBy; public boolean isDeleted() { diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/rollout/MgmtRolloutRestRequestBody.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/rollout/MgmtRolloutRestRequestBody.java index db92d8c309..74692acc3e 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/rollout/MgmtRolloutRestRequestBody.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/rollout/MgmtRolloutRestRequestBody.java @@ -12,6 +12,7 @@ import java.util.List; import java.util.Optional; +import io.swagger.v3.oas.annotations.media.Schema; import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtActionType; import org.eclipse.hawkbit.mgmt.json.model.rolloutgroup.MgmtRolloutGroup; @@ -28,19 +29,26 @@ @JsonIgnoreProperties(ignoreUnknown = true) public class MgmtRolloutRestRequestBody extends AbstractMgmtRolloutConditionsEntity { + @Schema(example = "id==targets-*") private String targetFilterQuery; + @Schema(example = "6") private long distributionSetId; + @Schema(example = "5") private Integer amountGroups; + @Schema(example = "1691065781929") private Long forcetime; + @Schema(example = "1691065780929") private Long startAt; @JsonProperty(required = false) + @Schema(example = "400") private Integer weight; @JsonProperty(required = false) + @Schema(example = "false") private Boolean confirmationRequired; private MgmtActionType type; diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/rolloutgroup/MgmtRolloutGroup.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/rolloutgroup/MgmtRolloutGroup.java index f2747d5cb3..378973ac32 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/rolloutgroup/MgmtRolloutGroup.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/rolloutgroup/MgmtRolloutGroup.java @@ -9,6 +9,7 @@ */ package org.eclipse.hawkbit.mgmt.json.model.rolloutgroup; +import io.swagger.v3.oas.annotations.media.Schema; import org.eclipse.hawkbit.mgmt.json.model.rollout.AbstractMgmtRolloutConditionsEntity; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @@ -21,8 +22,11 @@ @JsonIgnoreProperties(ignoreUnknown = true) public class MgmtRolloutGroup extends AbstractMgmtRolloutConditionsEntity { + @Schema(example = "controllerId==exampleTarget*") private String targetFilterQuery; + @Schema(example = "20.0") private Float targetPercentage; + @Schema(example = "false") private Boolean confirmationRequired; public String getTargetFilterQuery() { diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/rolloutgroup/MgmtRolloutGroupResponseBody.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/rolloutgroup/MgmtRolloutGroupResponseBody.java index 51418a8f6f..41ed75a790 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/rolloutgroup/MgmtRolloutGroupResponseBody.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/rolloutgroup/MgmtRolloutGroupResponseBody.java @@ -16,6 +16,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * Model for the rollout group annotated with json-annotations for easier @@ -26,11 +27,14 @@ public class MgmtRolloutGroupResponseBody extends MgmtRolloutGroup { @JsonProperty(value = "id", required = true) + @Schema(example = "63") private Long rolloutGroupId; @JsonProperty(required = true) + @Schema(example = "ready") private String status; + @Schema(example = "4") private int totalTargets; private Map totalTargetsPerStatus; diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremodule/MgmtSoftwareModule.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremodule/MgmtSoftwareModule.java index 8a4791673f..1bbb39e134 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremodule/MgmtSoftwareModule.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremodule/MgmtSoftwareModule.java @@ -9,6 +9,7 @@ */ package org.eclipse.hawkbit.mgmt.json.model.softwaremodule; +import io.swagger.v3.oas.annotations.media.Schema; import org.eclipse.hawkbit.mgmt.json.model.MgmtNamedEntity; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -25,23 +26,30 @@ @JsonIgnoreProperties(ignoreUnknown = true) public class MgmtSoftwareModule extends MgmtNamedEntity { @JsonProperty(value = "id", required = true) + @Schema(example = "6") private Long moduleId; @JsonProperty(required = true) + @Schema(example = "1.0.0") private String version; @JsonProperty(required = true) + @Schema(example = "os") private String type; + @Schema(example = "OS") private String typeName; @JsonProperty + @Schema(example = "Vendor Limited, California") private String vendor; @JsonProperty + @Schema(example = "false") private boolean deleted; @JsonProperty + @Schema(example = "false") private boolean encrypted; public void setDeleted(final boolean deleted) { diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremodule/MgmtSoftwareModuleMetadata.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremodule/MgmtSoftwareModuleMetadata.java index 79c6ec1065..553ca9190e 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremodule/MgmtSoftwareModuleMetadata.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremodule/MgmtSoftwareModuleMetadata.java @@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * The representation of SoftwareModuleMetadata in the REST API for POST/Create. @@ -23,10 +24,13 @@ public class MgmtSoftwareModuleMetadata { @JsonProperty(required = true) + @Schema(example = "someKnownKey") private String key; @JsonProperty + @Schema(example = "someKnownValue") private String value; @JsonProperty + @Schema(example = "false") private boolean targetVisible; public String getKey() { diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremodule/MgmtSoftwareModuleMetadataBodyPut.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremodule/MgmtSoftwareModuleMetadataBodyPut.java index b9dfeaf849..1ea6080f8c 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremodule/MgmtSoftwareModuleMetadataBodyPut.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremodule/MgmtSoftwareModuleMetadataBodyPut.java @@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * The representation of an meta data in the REST API for PUT/Update. @@ -23,8 +24,10 @@ public class MgmtSoftwareModuleMetadataBodyPut { @JsonProperty + @Schema(example = "newValue") private String value; @JsonProperty + @Schema(example = "true") private Boolean targetVisible; public String getValue() { diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremodule/MgmtSoftwareModuleRequestBodyPost.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremodule/MgmtSoftwareModuleRequestBodyPost.java index 55a4e53bfa..11fdd841f9 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremodule/MgmtSoftwareModuleRequestBodyPost.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremodule/MgmtSoftwareModuleRequestBodyPost.java @@ -10,6 +10,7 @@ package org.eclipse.hawkbit.mgmt.json.model.softwaremodule; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * Request Body for SoftwareModule POST. @@ -18,21 +19,27 @@ public class MgmtSoftwareModuleRequestBodyPost { @JsonProperty(required = true) + @Schema(example = "SM Name") private String name; @JsonProperty(required = true) + @Schema(example = "1.0.0") private String version; @JsonProperty(required = true) + @Schema(example = "os") private String type; @JsonProperty + @Schema(example = "SM Description") private String description; @JsonProperty + @Schema(example = "Vendor Limited, California") private String vendor; @JsonProperty + @Schema(example = "false") private boolean encrypted; /** diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremodule/MgmtSoftwareModuleRequestBodyPut.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremodule/MgmtSoftwareModuleRequestBodyPut.java index 7ff3d90fd3..75a1368683 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremodule/MgmtSoftwareModuleRequestBodyPut.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremodule/MgmtSoftwareModuleRequestBodyPut.java @@ -10,6 +10,7 @@ package org.eclipse.hawkbit.mgmt.json.model.softwaremodule; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * Request Body for SoftwareModule PUT. @@ -18,9 +19,11 @@ public class MgmtSoftwareModuleRequestBodyPut { @JsonProperty + @Schema(example = "SM Description") private String description; @JsonProperty + @Schema(example = "SM Vendor Name") private String vendor; /** diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremoduletype/MgmtSoftwareModuleType.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremoduletype/MgmtSoftwareModuleType.java index 01026a1cfe..68af185f43 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremoduletype/MgmtSoftwareModuleType.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremoduletype/MgmtSoftwareModuleType.java @@ -9,6 +9,7 @@ */ package org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype; +import io.swagger.v3.oas.annotations.media.Schema; import org.eclipse.hawkbit.mgmt.json.model.MgmtNamedEntity; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @@ -26,18 +27,23 @@ public class MgmtSoftwareModuleType extends MgmtNamedEntity { @JsonProperty(value = "id", required = true) + @Schema(example = "83") private Long moduleId; @JsonProperty(required = true) + @Schema(example = "OS") private String key; @JsonProperty + @Schema(example = "1") private int maxAssignments; @JsonProperty + @Schema(example = "false") private boolean deleted; @JsonProperty + @Schema(example = "brown") private String colour; public boolean isDeleted() { diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremoduletype/MgmtSoftwareModuleTypeRequestBodyPost.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremoduletype/MgmtSoftwareModuleTypeRequestBodyPost.java index de7b83908c..fcf1cd4247 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremoduletype/MgmtSoftwareModuleTypeRequestBodyPost.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremoduletype/MgmtSoftwareModuleTypeRequestBodyPost.java @@ -10,6 +10,7 @@ package org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * Request Body for SoftwareModuleType POST. @@ -18,12 +19,15 @@ public class MgmtSoftwareModuleTypeRequestBodyPost extends MgmtSoftwareModuleTypeRequestBodyPut { @JsonProperty(required = true) + @Schema(example = "Example name") private String name; @JsonProperty(required = true) + @Schema(example = "Example key") private String key; @JsonProperty + @Schema(example = "1") private int maxAssignments; @Override diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremoduletype/MgmtSoftwareModuleTypeRequestBodyPut.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremoduletype/MgmtSoftwareModuleTypeRequestBodyPut.java index 69da5112f7..a1977eb5b5 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremoduletype/MgmtSoftwareModuleTypeRequestBodyPut.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremoduletype/MgmtSoftwareModuleTypeRequestBodyPut.java @@ -10,6 +10,7 @@ package org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * Request Body for SoftwareModuleType PUT. @@ -18,9 +19,11 @@ public class MgmtSoftwareModuleTypeRequestBodyPut { @JsonProperty + @Schema(example = "Example description") private String description; @JsonProperty + @Schema(example = "rgb(0,0,255") private String colour; public String getDescription() { diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/system/MgmtSystemTenantConfigurationValue.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/system/MgmtSystemTenantConfigurationValue.java index c144c2088c..d513678386 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/system/MgmtSystemTenantConfigurationValue.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/system/MgmtSystemTenantConfigurationValue.java @@ -10,6 +10,7 @@ package org.eclipse.hawkbit.mgmt.json.model.system; +import io.swagger.v3.oas.annotations.media.Schema; import org.springframework.hateoas.RepresentationModel; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @@ -26,14 +27,22 @@ public class MgmtSystemTenantConfigurationValue extends RepresentationModel { @JsonInclude(Include.ALWAYS) + @Schema(example = "true") private Object value; @JsonInclude(Include.ALWAYS) + @Schema(example = "true") private boolean isGlobal = true; + @Schema(example = "1623085150") private Long lastModifiedAt; + + @Schema(example = "example user") private String lastModifiedBy; + + @Schema(example = "1523085150") private Long createdAt; + @Schema(example = "example user") private String createdBy; public Object getValue() { diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/system/MgmtSystemTenantConfigurationValueRequest.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/system/MgmtSystemTenantConfigurationValueRequest.java index b94c9eda31..89912f5b0e 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/system/MgmtSystemTenantConfigurationValueRequest.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/system/MgmtSystemTenantConfigurationValueRequest.java @@ -15,6 +15,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * A json annotated rest model for System Configuration for PUT. @@ -24,6 +25,7 @@ public class MgmtSystemTenantConfigurationValueRequest { @JsonProperty(required = true) + @Schema(example = "exampleToken") private Serializable value; /** diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/tag/MgmtAssignedDistributionSetRequestBody.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/tag/MgmtAssignedDistributionSetRequestBody.java index 008437a6d1..20a406fe61 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/tag/MgmtAssignedDistributionSetRequestBody.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/tag/MgmtAssignedDistributionSetRequestBody.java @@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * Request Body for PUT. @@ -23,6 +24,7 @@ public class MgmtAssignedDistributionSetRequestBody { @JsonProperty(value = "id", required = true) + @Schema(example = "24") private Long distributionSetId; public Long getDistributionSetId() { diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/tag/MgmtAssignedTargetRequestBody.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/tag/MgmtAssignedTargetRequestBody.java index 2da78cbdd9..4879a7a92f 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/tag/MgmtAssignedTargetRequestBody.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/tag/MgmtAssignedTargetRequestBody.java @@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * Request Body for PUT. @@ -23,6 +24,7 @@ public class MgmtAssignedTargetRequestBody { @JsonProperty(required = true) + @Schema(example = "Target1") private String controllerId; public String getControllerId() { diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/tag/MgmtTag.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/tag/MgmtTag.java index d079667cfa..b7a598103a 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/tag/MgmtTag.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/tag/MgmtTag.java @@ -9,6 +9,7 @@ */ package org.eclipse.hawkbit.mgmt.json.model.tag; +import io.swagger.v3.oas.annotations.media.Schema; import org.eclipse.hawkbit.mgmt.json.model.MgmtNamedEntity; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -26,9 +27,11 @@ public class MgmtTag extends MgmtNamedEntity { @JsonProperty(value = "id", required = true) + @Schema(example = "2") private Long tagId; @JsonProperty + @Schema(example = "rgb(255,0,0)") private String colour; @JsonIgnore diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/tag/MgmtTagRequestBodyPut.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/tag/MgmtTagRequestBodyPut.java index c2a2d71cd2..3cef3dfe7c 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/tag/MgmtTagRequestBodyPut.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/tag/MgmtTagRequestBodyPut.java @@ -13,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * Request Body for PUT/POST. @@ -23,12 +24,15 @@ public class MgmtTagRequestBodyPut { @JsonProperty + @Schema(example = "rgb(0,255,0)") private String colour; @JsonProperty + @Schema(example = "Example name") private String name; @JsonProperty + @Schema(example = "Example description") private String description; public String getName() { diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/target/MgmtDistributionSetAssignment.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/target/MgmtDistributionSetAssignment.java index e076213933..f1d5ebab39 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/target/MgmtDistributionSetAssignment.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/target/MgmtDistributionSetAssignment.java @@ -3,6 +3,7 @@ */ package org.eclipse.hawkbit.mgmt.json.model.target; +import io.swagger.v3.oas.annotations.media.Schema; import org.eclipse.hawkbit.mgmt.json.model.MgmtId; import org.eclipse.hawkbit.mgmt.json.model.MgmtMaintenanceWindowRequestBody; import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtActionType; @@ -16,10 +17,13 @@ */ public class MgmtDistributionSetAssignment extends MgmtId { + @Schema(example = "1691065930359") private long forcetime; @JsonProperty(required = false) + @Schema(example = "23") private Integer weight; @JsonProperty(required = false) + @Schema(example = "false") private Boolean confirmationRequired; private MgmtActionType type; private MgmtMaintenanceWindowRequestBody maintenanceWindow; diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/target/MgmtTarget.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/target/MgmtTarget.java index d5e1bcb869..ed7fa7cf80 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/target/MgmtTarget.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/target/MgmtTarget.java @@ -5,6 +5,7 @@ import java.net.URI; +import io.swagger.v3.oas.annotations.media.Schema; import org.eclipse.hawkbit.mgmt.json.model.MgmtNamedEntity; import org.eclipse.hawkbit.mgmt.json.model.MgmtPollStatus; @@ -23,39 +24,50 @@ public class MgmtTarget extends MgmtNamedEntity { @JsonProperty(required = true) + @Schema(example = "123") private String controllerId; @JsonProperty + @Schema(example = "in_sync") private String updateStatus; @JsonProperty + @Schema(example = "1691065941102") private Long lastControllerRequestAt; @JsonProperty + @Schema(example = "1691065941155") private Long installedAt; @JsonProperty + @Schema(example = "192.168.0.1") private String ipAddress; @JsonProperty + @Schema(example = "http://192.168.0.1") private String address; @JsonProperty private MgmtPollStatus pollStatus; @JsonProperty + @Schema(example = "38e6a19932b014040ba061795186514e") private String securityToken; @JsonProperty + @Schema(example = "true") private boolean requestAttributes; @JsonProperty + @Schema(example = "19") private Long targetType; @JsonProperty + @Schema(example = "defaultType") private String targetTypeName; @JsonProperty + @Schema(example = "false") private Boolean autoConfirmActive; /** diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/target/MgmtTargetAutoConfirm.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/target/MgmtTargetAutoConfirm.java index 3c4df5b069..816c9683cf 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/target/MgmtTargetAutoConfirm.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/target/MgmtTargetAutoConfirm.java @@ -12,6 +12,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; import org.springframework.hateoas.RepresentationModel; import javax.validation.constraints.NotNull; @@ -24,9 +25,13 @@ @JsonPropertyOrder({ "active", "initiator", "remark", "activatedAt" }) public class MgmtTargetAutoConfirm extends RepresentationModel { @NotNull + @Schema(example = "true") private boolean active; + @Schema(example = "custom_initiator_value") private String initiator; + @Schema(example = "custom_remark") private String remark; + @Schema(example = "1691065938576") private Long activatedAt; /** diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/target/MgmtTargetAutoConfirmUpdate.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/target/MgmtTargetAutoConfirmUpdate.java index 934b1a02f6..57a0cace8b 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/target/MgmtTargetAutoConfirmUpdate.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/target/MgmtTargetAutoConfirmUpdate.java @@ -11,15 +11,18 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * Payload to activate the auto-confirmation by given initiator and remark. */ public class MgmtTargetAutoConfirmUpdate { @JsonProperty(required = false) + @Schema(example = "custom_initiator_value") private final String initiator; @JsonProperty(required = false) + @Schema(example = "custom_remark") private final String remark; /** diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/target/MgmtTargetRequestBody.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/target/MgmtTargetRequestBody.java index 2c7541f0ff..3ca965bfdf 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/target/MgmtTargetRequestBody.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/target/MgmtTargetRequestBody.java @@ -4,6 +4,7 @@ package org.eclipse.hawkbit.mgmt.json.model.target; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * Request body for target PUT/POST commands. @@ -11,23 +12,30 @@ */ public class MgmtTargetRequestBody { @JsonProperty(required = true) + @Schema(example = "controllerName") private String name; + @Schema(example = "Example description of a target") private String description; @JsonProperty(required = true) + @Schema(example = "12345") private String controllerId; @JsonProperty + @Schema(example = "https://192.168.0.1") private String address; @JsonProperty + @Schema(example = "2345678DGGDGFTDzztgf") private String securityToken; @JsonProperty + @Schema(example = "false") private Boolean requestAttributes; @JsonProperty + @Schema(example = "10") private Long targetType; /** diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/targetfilter/MgmtTargetFilterQuery.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/targetfilter/MgmtTargetFilterQuery.java index 6ce010d778..b5d62c02b6 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/targetfilter/MgmtTargetFilterQuery.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/targetfilter/MgmtTargetFilterQuery.java @@ -9,6 +9,7 @@ */ package org.eclipse.hawkbit.mgmt.json.model.targetfilter; +import io.swagger.v3.oas.annotations.media.Schema; import org.eclipse.hawkbit.mgmt.json.model.MgmtBaseEntity; import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtActionType; @@ -27,24 +28,30 @@ public class MgmtTargetFilterQuery extends MgmtBaseEntity { @JsonProperty(value = "id", required = true) + @Schema(example = "2") private Long filterId; @JsonProperty + @Schema(example = "filterName") private String name; @JsonProperty + @Schema(example = "name==*") private String query; @JsonProperty + @Schema(example = "15") private Long autoAssignDistributionSet; @JsonProperty private MgmtActionType autoAssignActionType; @JsonProperty + @Schema(example = "") private Integer autoAssignWeight; @JsonProperty + @Schema(example = "false") private Boolean confirmationRequired; public Long getFilterId() { diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/targetfilter/MgmtTargetFilterQueryRequestBody.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/targetfilter/MgmtTargetFilterQueryRequestBody.java index d976ec1c3c..a3d2224f7e 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/targetfilter/MgmtTargetFilterQueryRequestBody.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/targetfilter/MgmtTargetFilterQueryRequestBody.java @@ -10,6 +10,7 @@ package org.eclipse.hawkbit.mgmt.json.model.targetfilter; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * Request body for target PUT/POST commands. @@ -17,9 +18,11 @@ */ public class MgmtTargetFilterQueryRequestBody { @JsonProperty(required = true) + @Schema(example = "filterName") private String name; @JsonProperty(required = true) + @Schema(example = "controllerId==example-target-*") private String query; public String getName() { diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/targettype/MgmtTargetType.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/targettype/MgmtTargetType.java index cff8ec2730..0053965985 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/targettype/MgmtTargetType.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/targettype/MgmtTargetType.java @@ -12,6 +12,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.eclipse.hawkbit.mgmt.json.model.MgmtNamedEntity; /** @@ -24,9 +25,11 @@ public class MgmtTargetType extends MgmtNamedEntity { @JsonProperty(value = "id", required = true) + @Schema(example = "26") private Long typeId; @JsonProperty + @Schema(example = "rgb(255,255,255") private String colour; /** diff --git a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/targettype/MgmtTargetTypeRequestBodyPut.java b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/targettype/MgmtTargetTypeRequestBodyPut.java index eb22652427..dae73e45b6 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/targettype/MgmtTargetTypeRequestBodyPut.java +++ b/hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/targettype/MgmtTargetTypeRequestBodyPut.java @@ -10,6 +10,7 @@ package org.eclipse.hawkbit.mgmt.json.model.targettype; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; /** * Request Body for TargetType PUT. @@ -18,12 +19,15 @@ public class MgmtTargetTypeRequestBodyPut { @JsonProperty(required = true) + @Schema(example = "updatedTypeName") private String name; @JsonProperty + @Schema(example = "an updated description") private String description; @JsonProperty + @Schema(example = "#aaafff") private String colour; /**