Skip to content

Commit

Permalink
make description optional again in DomainTagModel
Browse files Browse the repository at this point in the history
  • Loading branch information
DC2-DanielKrueger committed Dec 12, 2024
1 parent 7c1320f commit 6bea209
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
1 change: 0 additions & 1 deletion ext/hivemq-edge-openapi-2024.8-SNAPSHOT.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4797,7 +4797,6 @@ components:
minLength: 1
required:
- definition
- description
- name
DomainTagList:
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.JsonNodeFactory;
import com.hivemq.edge.HiveMQEdgeConstants;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import com.hivemq.persistence.domain.DomainTag;
import io.swagger.v3.oas.annotations.media.Schema;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.Objects;

Expand All @@ -38,10 +37,9 @@ public class DomainTagModel {
format = "mqtt-tag")
private final @NotNull String name;

@JsonProperty(value = "description", required = true)
@JsonProperty(value = "description")
@Schema(description = "A user created description for this tag.",
maxLength = 10_000,
requiredMode = Schema.RequiredMode.REQUIRED)
maxLength = 10_000)
private final @NotNull String description;

@JsonProperty(value = "definition", required = true)
Expand All @@ -52,7 +50,7 @@ public class DomainTagModel {
@JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
public DomainTagModel(
@JsonProperty(value = "name", required = true) final @NotNull String name,
@JsonProperty(value = "description", required = true) final @Nullable String description,
@JsonProperty(value = "description") final @Nullable String description,
@JsonProperty(value = "definition", required = true) final @Nullable JsonNode definition) {
this.name = name;
this.description = Objects.requireNonNullElse(description, "");
Expand Down

0 comments on commit 6bea209

Please sign in to comment.