From 989f4c96d5f2d19786865a210793ded245afb001 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Mon, 26 May 2025 15:29:50 +0200 Subject: [PATCH 001/121] refactor: Add RequestBodyMissingError, TemporaryNotAvailableError --- ext/hivemq-edge-openapi-2025.9.yaml | 39 ++++++++- .../components/schemas/errors/Error2.yaml | 23 +++++ .../common/RequestBodyMissingError.yaml | 7 ++ .../common/TemporaryNotAvailableError.yaml | 2 + ..._v1_data-hub_data-validation_policies.yaml | 4 +- .../java/com/hivemq/api/errors/Error.java | 87 +++++++++++++++++++ .../common/RequestBodyMissingError.java | 33 +++++++ .../common/TemporaryNotAvailableError.java | 14 +++ .../com/hivemq/util/ErrorResponseUtil.java | 9 +- 9 files changed, 212 insertions(+), 6 deletions(-) create mode 100644 ext/openAPI/components/schemas/errors/Error2.yaml create mode 100644 ext/openAPI/components/schemas/errors/common/RequestBodyMissingError.yaml create mode 100644 ext/openAPI/components/schemas/errors/common/TemporaryNotAvailableError.yaml create mode 100644 hivemq-edge/src/main/java/com/hivemq/api/errors/Error.java create mode 100644 hivemq-edge/src/main/java/com/hivemq/api/errors/common/RequestBodyMissingError.java create mode 100644 hivemq-edge/src/main/java/com/hivemq/api/errors/common/TemporaryNotAvailableError.java diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index 562119c64c..b9cfefd2c8 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -1152,7 +1152,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/RequestBodyMissingError' description: DataPolicy creation failed '409': content: @@ -1170,7 +1170,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable '507': content: @@ -4746,6 +4746,41 @@ components: description: List of result items that are returned by this endpoint items: $ref: '#/components/schemas/DataPolicy' + Error2: + type: object + properties: + code: + type: string + description: Correlation id + detail: + type: string + description: A detailed description of the error. + title: + type: string + description: A short, human-readable summary of the error. + type: + type: string + format: uri + description: A URI reference that identifies the error type. + status: + type: integer + format: int32 + description: The HTTP status code associated with the error. + required: + - title + - status + - type + RequestBodyMissingError: + allOf: + - $ref: '#/components/schemas/Error2' + - type: object + properties: + parameterName: + type: string + description: The name of the missing request body parameter. + TemporaryNotAvailableError: + allOf: + - $ref: '#/components/schemas/Error2' Errors: type: object PolicySchema: diff --git a/ext/openAPI/components/schemas/errors/Error2.yaml b/ext/openAPI/components/schemas/errors/Error2.yaml new file mode 100644 index 0000000000..cd0ccd2ba1 --- /dev/null +++ b/ext/openAPI/components/schemas/errors/Error2.yaml @@ -0,0 +1,23 @@ +type: object +properties: + code: + type: string + description: Correlation id + detail: + type: string + description: A detailed description of the error. + title: + type: string + description: A short, human-readable summary of the error. + type: + type: string + format: uri + description: A URI reference that identifies the error type. + status: + type: integer + format: int32 + description: The HTTP status code associated with the error. +required: + - title + - status + - type diff --git a/ext/openAPI/components/schemas/errors/common/RequestBodyMissingError.yaml b/ext/openAPI/components/schemas/errors/common/RequestBodyMissingError.yaml new file mode 100644 index 0000000000..6fcb8d3a8b --- /dev/null +++ b/ext/openAPI/components/schemas/errors/common/RequestBodyMissingError.yaml @@ -0,0 +1,7 @@ +allOf: + - $ref: "../Error2.yaml" + - type: object + properties: + parameterName: + type: string + description: The name of the missing request body parameter. diff --git a/ext/openAPI/components/schemas/errors/common/TemporaryNotAvailableError.yaml b/ext/openAPI/components/schemas/errors/common/TemporaryNotAvailableError.yaml new file mode 100644 index 0000000000..810dece33c --- /dev/null +++ b/ext/openAPI/components/schemas/errors/common/TemporaryNotAvailableError.yaml @@ -0,0 +1,2 @@ +allOf: + - $ref: "../Error2.yaml" diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml index 4e05623e21..bc3c9f109a 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml @@ -399,7 +399,7 @@ post: content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml + $ref: "../components/schemas/errors/common/RequestBodyMissingError.yaml" description: DataPolicy creation failed '409': content: @@ -417,7 +417,7 @@ post: content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml + $ref: "../components/schemas/errors/common/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable '507': content: diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/Error.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/Error.java new file mode 100644 index 0000000000..6269d9123a --- /dev/null +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/Error.java @@ -0,0 +1,87 @@ +package com.hivemq.api.errors; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.Objects; + +public class Error> { + + @JsonProperty("code") + @Schema(description = "Correlation id") + protected @Nullable String code; + + @JsonProperty("detail") + protected @Nullable String detail; + + @JsonProperty("status") + protected int status; + + @JsonProperty(value = "title", required = true) + protected @NotNull String title; + + @JsonProperty(value = "type") + protected @NotNull String type; + + @JsonCreator + public Error( + @JsonProperty(value = "type") final @NotNull String type, + @JsonProperty(value = "title") final @NotNull String title, + @JsonProperty(value = "detail") final @Nullable String detail, + @JsonProperty(value = "status") final int status, + @JsonProperty(value = "code") final @Nullable String code) { + setCode(code); + setDetail(detail); + setStatus(status); + setTitle(title); + setType(type); + } + + public @Nullable String getCode() { + return code; + } + + public @NotNull Error setCode(@Nullable final String code) { + this.code = code; + return this; + } + + public @Nullable String getDetail() { + return detail; + } + + public @NotNull Error setDetail(@Nullable final String detail) { + this.detail = detail; + return this; + } + + public int getStatus() { + return status; + } + + public @NotNull Error setStatus(final int status) { + this.status = status; + return this; + } + + public @NotNull String getTitle() { + return title; + } + + public @NotNull Error setTitle(@NotNull final String title) { + this.title = Objects.requireNonNull(title); + return this; + } + + public @NotNull String getType() { + return type; + } + + public @NotNull Error setType(@NotNull final String type) { + this.type = Objects.requireNonNull(type); + return this; + } +} diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/common/RequestBodyMissingError.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/common/RequestBodyMissingError.java new file mode 100644 index 0000000000..b28e8dbd1f --- /dev/null +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/common/RequestBodyMissingError.java @@ -0,0 +1,33 @@ +package com.hivemq.api.errors.common; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.hivemq.api.errors.Error; +import com.hivemq.http.HttpStatus; +import io.swagger.v3.oas.annotations.media.Schema; +import org.jetbrains.annotations.NotNull; + +import java.util.Objects; + +public class RequestBodyMissingError extends Error { + @JsonProperty("parameterName") + @Schema(description = "Correlation id") + protected @NotNull String parameterName; + + public RequestBodyMissingError(final @NotNull String parameterName) { + super("errors/common/RequestBodyMissingError", + "Required request body parameter " + parameterName + " missing", + "Required request body parameter " + parameterName + " missing", + HttpStatus.BAD_REQUEST_400, + null); + setParameterName(parameterName); + } + + public @NotNull String getParameterName() { + return parameterName; + } + + public @NotNull RequestBodyMissingError setParameterName(final @NotNull String parameterName) { + this.parameterName = Objects.requireNonNull(parameterName); + return this; + } +} diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/common/TemporaryNotAvailableError.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/common/TemporaryNotAvailableError.java new file mode 100644 index 0000000000..3cc0513fe4 --- /dev/null +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/common/TemporaryNotAvailableError.java @@ -0,0 +1,14 @@ +package com.hivemq.api.errors.common; + +import com.hivemq.api.errors.Error; +import com.hivemq.http.HttpStatus; + +public class TemporaryNotAvailableError extends Error { + public TemporaryNotAvailableError() { + super("errors/common/TemporaryNotAvailableError", + "The endpoint is temporarily not available", + "The endpoint is temporarily not available, please try again later", + HttpStatus.SERVICE_UNAVAILABLE_503, + null); + } +} diff --git a/hivemq-edge/src/main/java/com/hivemq/util/ErrorResponseUtil.java b/hivemq-edge/src/main/java/com/hivemq/util/ErrorResponseUtil.java index c0e228389d..2bc12b8597 100644 --- a/hivemq-edge/src/main/java/com/hivemq/util/ErrorResponseUtil.java +++ b/hivemq-edge/src/main/java/com/hivemq/util/ErrorResponseUtil.java @@ -15,6 +15,7 @@ */ package com.hivemq.util; +import com.hivemq.api.errors.Error; import com.hivemq.http.error.ProblemDetails; import org.jetbrains.annotations.NotNull; @@ -24,8 +25,6 @@ * @author Christoph Schäbel */ public class ErrorResponseUtil { - - public static @NotNull Response errorResponse(final @NotNull ProblemDetails errors) { return Response.status(errors.getStatus()) .entity(errors) @@ -33,4 +32,10 @@ public class ErrorResponseUtil { .build(); } + public static @NotNull Response errorResponse(final @NotNull Error error) { + return Response.status(error.getStatus()) + .entity(error) + .header("Content-Type", "application/json;charset=utf-8") + .build(); + } } From d3aed68400debb35e73f70f59983f322fa4076ec Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Mon, 26 May 2025 16:10:53 +0200 Subject: [PATCH 002/121] refactor: Support both behavior and data policies --- ext/hivemq-edge-openapi-2025.9.yaml | 74 +++++++++---------- .../errors/{Error2.yaml => ErrorBase.yaml} | 0 .../common/RequestBodyMissingError.yaml | 2 +- .../common/TemporaryNotAvailableError.yaml | 2 +- ...data-hub_behavior-validation_policies.yaml | 4 +- 5 files changed, 41 insertions(+), 41 deletions(-) rename ext/openAPI/components/schemas/errors/{Error2.yaml => ErrorBase.yaml} (100%) diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index b9cfefd2c8..88f620a3f7 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -444,7 +444,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/RequestBodyMissingError' description: Policy creation failed '409': content: @@ -462,7 +462,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/TemporaryNotAvailableError' description: Temporarily unavailable '507': content: @@ -4625,6 +4625,41 @@ components: description: List of result items that are returned by this endpoint items: $ref: '#/components/schemas/BehaviorPolicy' + ErrorBase: + type: object + properties: + code: + type: string + description: Correlation id + detail: + type: string + description: A detailed description of the error. + title: + type: string + description: A short, human-readable summary of the error. + type: + type: string + format: uri + description: A URI reference that identifies the error type. + status: + type: integer + format: int32 + description: The HTTP status code associated with the error. + required: + - title + - status + - type + RequestBodyMissingError: + allOf: + - $ref: '#/components/schemas/ErrorBase' + - type: object + properties: + parameterName: + type: string + description: The name of the missing request body parameter. + TemporaryNotAvailableError: + allOf: + - $ref: '#/components/schemas/ErrorBase' JsonNode: type: object description: The arguments of the fsm derived from the behavior policy. @@ -4746,41 +4781,6 @@ components: description: List of result items that are returned by this endpoint items: $ref: '#/components/schemas/DataPolicy' - Error2: - type: object - properties: - code: - type: string - description: Correlation id - detail: - type: string - description: A detailed description of the error. - title: - type: string - description: A short, human-readable summary of the error. - type: - type: string - format: uri - description: A URI reference that identifies the error type. - status: - type: integer - format: int32 - description: The HTTP status code associated with the error. - required: - - title - - status - - type - RequestBodyMissingError: - allOf: - - $ref: '#/components/schemas/Error2' - - type: object - properties: - parameterName: - type: string - description: The name of the missing request body parameter. - TemporaryNotAvailableError: - allOf: - - $ref: '#/components/schemas/Error2' Errors: type: object PolicySchema: diff --git a/ext/openAPI/components/schemas/errors/Error2.yaml b/ext/openAPI/components/schemas/errors/ErrorBase.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/Error2.yaml rename to ext/openAPI/components/schemas/errors/ErrorBase.yaml diff --git a/ext/openAPI/components/schemas/errors/common/RequestBodyMissingError.yaml b/ext/openAPI/components/schemas/errors/common/RequestBodyMissingError.yaml index 6fcb8d3a8b..4666645c09 100644 --- a/ext/openAPI/components/schemas/errors/common/RequestBodyMissingError.yaml +++ b/ext/openAPI/components/schemas/errors/common/RequestBodyMissingError.yaml @@ -1,5 +1,5 @@ allOf: - - $ref: "../Error2.yaml" + - $ref: "../ErrorBase.yaml" - type: object properties: parameterName: diff --git a/ext/openAPI/components/schemas/errors/common/TemporaryNotAvailableError.yaml b/ext/openAPI/components/schemas/errors/common/TemporaryNotAvailableError.yaml index 810dece33c..25edc4afdc 100644 --- a/ext/openAPI/components/schemas/errors/common/TemporaryNotAvailableError.yaml +++ b/ext/openAPI/components/schemas/errors/common/TemporaryNotAvailableError.yaml @@ -1,2 +1,2 @@ allOf: - - $ref: "../Error2.yaml" + - $ref: "../ErrorBase.yaml" diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies.yaml index 0ca3ca0e99..d71506682a 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies.yaml @@ -270,7 +270,7 @@ post: content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml + $ref: "../components/schemas/errors/common/RequestBodyMissingError.yaml" description: Policy creation failed '409': content: @@ -288,7 +288,7 @@ post: content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml + $ref: "../components/schemas/errors/common/TemporaryNotAvailableError.yaml" description: Temporarily unavailable '507': content: From ae9c606226bfb73f92079580a563e7e3784bcc93 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Mon, 26 May 2025 16:39:17 +0200 Subject: [PATCH 003/121] feat: Add equals(), hashCode(), toString() --- .../api/errors/{Error.java => ErrorBase.java} | 52 ++++++++++++++++--- .../common/RequestBodyMissingError.java | 44 +++++++++++++++- .../common/TemporaryNotAvailableError.java | 25 ++++++++- .../com/hivemq/util/ErrorResponseUtil.java | 4 +- 4 files changed, 112 insertions(+), 13 deletions(-) rename hivemq-edge/src/main/java/com/hivemq/api/errors/{Error.java => ErrorBase.java} (55%) diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/Error.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/ErrorBase.java similarity index 55% rename from hivemq-edge/src/main/java/com/hivemq/api/errors/Error.java rename to hivemq-edge/src/main/java/com/hivemq/api/errors/ErrorBase.java index 6269d9123a..4ed968c3c0 100644 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/Error.java +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/ErrorBase.java @@ -8,7 +8,7 @@ import java.util.Objects; -public class Error> { +public abstract class ErrorBase> { @JsonProperty("code") @Schema(description = "Correlation id") @@ -27,7 +27,7 @@ public class Error> { protected @NotNull String type; @JsonCreator - public Error( + public ErrorBase( @JsonProperty(value = "type") final @NotNull String type, @JsonProperty(value = "title") final @NotNull String title, @JsonProperty(value = "detail") final @Nullable String detail, @@ -44,7 +44,7 @@ public Error( return code; } - public @NotNull Error setCode(@Nullable final String code) { + public @NotNull ErrorBase setCode(@Nullable final String code) { this.code = code; return this; } @@ -53,7 +53,7 @@ public Error( return detail; } - public @NotNull Error setDetail(@Nullable final String detail) { + public @NotNull ErrorBase setDetail(@Nullable final String detail) { this.detail = detail; return this; } @@ -62,7 +62,7 @@ public int getStatus() { return status; } - public @NotNull Error setStatus(final int status) { + public @NotNull ErrorBase setStatus(final int status) { this.status = status; return this; } @@ -71,7 +71,7 @@ public int getStatus() { return title; } - public @NotNull Error setTitle(@NotNull final String title) { + public @NotNull ErrorBase setTitle(@NotNull final String title) { this.title = Objects.requireNonNull(title); return this; } @@ -80,8 +80,46 @@ public int getStatus() { return type; } - public @NotNull Error setType(@NotNull final String type) { + public @NotNull ErrorBase setType(@NotNull final String type) { this.type = Objects.requireNonNull(type); return this; } + + @Override + public @NotNull String toString() { + return "ErrorBase{" + + "code='" + + code + + '\'' + + ", detail='" + + detail + + '\'' + + ", status=" + + status + + ", title='" + + title + + '\'' + + ", type='" + + type + + '\'' + + '}'; + } + + @Override + public boolean equals(final @Nullable Object o) { + if (o == null || getClass() != o.getClass()) { + return false; + } + final ErrorBase errorBase = (ErrorBase) o; + return status == errorBase.status && + Objects.equals(code, errorBase.code) && + Objects.equals(detail, errorBase.detail) && + Objects.equals(title, errorBase.title) && + Objects.equals(type, errorBase.type); + } + + @Override + public int hashCode() { + return Objects.hash(code, detail, status, title, type); + } } diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/common/RequestBodyMissingError.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/common/RequestBodyMissingError.java index b28e8dbd1f..ae3173f8d9 100644 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/common/RequestBodyMissingError.java +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/common/RequestBodyMissingError.java @@ -1,14 +1,14 @@ package com.hivemq.api.errors.common; import com.fasterxml.jackson.annotation.JsonProperty; -import com.hivemq.api.errors.Error; +import com.hivemq.api.errors.ErrorBase; import com.hivemq.http.HttpStatus; import io.swagger.v3.oas.annotations.media.Schema; import org.jetbrains.annotations.NotNull; import java.util.Objects; -public class RequestBodyMissingError extends Error { +public class RequestBodyMissingError extends ErrorBase { @JsonProperty("parameterName") @Schema(description = "Correlation id") protected @NotNull String parameterName; @@ -30,4 +30,44 @@ public RequestBodyMissingError(final @NotNull String parameterName) { this.parameterName = Objects.requireNonNull(parameterName); return this; } + + @Override + public @NotNull String toString() { + return "RequestBodyMissingError{" + + "parameterName='" + + parameterName + + '\'' + + ", code='" + + code + + '\'' + + ", detail='" + + detail + + '\'' + + ", status=" + + status + + ", title='" + + title + + '\'' + + ", type='" + + type + + '\'' + + '}'; + } + + @Override + public boolean equals(final Object o) { + if (o == null || getClass() != o.getClass()) { + return false; + } + if (!super.equals(o)) { + return false; + } + final RequestBodyMissingError that = (RequestBodyMissingError) o; + return Objects.equals(parameterName, that.parameterName); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), parameterName); + } } diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/common/TemporaryNotAvailableError.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/common/TemporaryNotAvailableError.java index 3cc0513fe4..36bc0c7bec 100644 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/common/TemporaryNotAvailableError.java +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/common/TemporaryNotAvailableError.java @@ -1,9 +1,10 @@ package com.hivemq.api.errors.common; -import com.hivemq.api.errors.Error; +import com.hivemq.api.errors.ErrorBase; import com.hivemq.http.HttpStatus; +import org.jetbrains.annotations.NotNull; -public class TemporaryNotAvailableError extends Error { +public class TemporaryNotAvailableError extends ErrorBase { public TemporaryNotAvailableError() { super("errors/common/TemporaryNotAvailableError", "The endpoint is temporarily not available", @@ -11,4 +12,24 @@ public TemporaryNotAvailableError() { HttpStatus.SERVICE_UNAVAILABLE_503, null); } + + @Override + public @NotNull String toString() { + return "TemporaryNotAvailableError{" + + "code='" + + code + + '\'' + + ", detail='" + + detail + + '\'' + + ", status=" + + status + + ", title='" + + title + + '\'' + + ", type='" + + type + + '\'' + + '}'; + } } diff --git a/hivemq-edge/src/main/java/com/hivemq/util/ErrorResponseUtil.java b/hivemq-edge/src/main/java/com/hivemq/util/ErrorResponseUtil.java index 2bc12b8597..3bb2e5735b 100644 --- a/hivemq-edge/src/main/java/com/hivemq/util/ErrorResponseUtil.java +++ b/hivemq-edge/src/main/java/com/hivemq/util/ErrorResponseUtil.java @@ -15,7 +15,7 @@ */ package com.hivemq.util; -import com.hivemq.api.errors.Error; +import com.hivemq.api.errors.ErrorBase; import com.hivemq.http.error.ProblemDetails; import org.jetbrains.annotations.NotNull; @@ -32,7 +32,7 @@ public class ErrorResponseUtil { .build(); } - public static @NotNull Response errorResponse(final @NotNull Error error) { + public static @NotNull Response errorResponse(final @NotNull ErrorBase error) { return Response.status(error.getStatus()) .entity(error) .header("Content-Type", "application/json;charset=utf-8") From 08a3e98b1e07b90ab60ae971be9e5fc9bfc18822 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Mon, 26 May 2025 16:46:49 +0200 Subject: [PATCH 004/121] refactor: Rename to ApiError --- .../errors/{ErrorBase.yaml => ApiError.yaml} | 0 .../errors/common/RequestBodyMissingError.yaml | 2 +- .../common/TemporaryNotAvailableError.yaml | 2 +- .../api/errors/{ErrorBase.java => ApiError.java} | 16 ++++++++-------- .../errors/common/RequestBodyMissingError.java | 4 ++-- .../common/TemporaryNotAvailableError.java | 4 ++-- .../java/com/hivemq/util/ErrorResponseUtil.java | 4 ++-- 7 files changed, 16 insertions(+), 16 deletions(-) rename ext/openAPI/components/schemas/errors/{ErrorBase.yaml => ApiError.yaml} (100%) rename hivemq-edge/src/main/java/com/hivemq/api/errors/{ErrorBase.java => ApiError.java} (85%) diff --git a/ext/openAPI/components/schemas/errors/ErrorBase.yaml b/ext/openAPI/components/schemas/errors/ApiError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/ErrorBase.yaml rename to ext/openAPI/components/schemas/errors/ApiError.yaml diff --git a/ext/openAPI/components/schemas/errors/common/RequestBodyMissingError.yaml b/ext/openAPI/components/schemas/errors/common/RequestBodyMissingError.yaml index 4666645c09..b2a8ccfc37 100644 --- a/ext/openAPI/components/schemas/errors/common/RequestBodyMissingError.yaml +++ b/ext/openAPI/components/schemas/errors/common/RequestBodyMissingError.yaml @@ -1,5 +1,5 @@ allOf: - - $ref: "../ErrorBase.yaml" + - $ref: "../ApiError.yaml" - type: object properties: parameterName: diff --git a/ext/openAPI/components/schemas/errors/common/TemporaryNotAvailableError.yaml b/ext/openAPI/components/schemas/errors/common/TemporaryNotAvailableError.yaml index 25edc4afdc..1e5857dabc 100644 --- a/ext/openAPI/components/schemas/errors/common/TemporaryNotAvailableError.yaml +++ b/ext/openAPI/components/schemas/errors/common/TemporaryNotAvailableError.yaml @@ -1,2 +1,2 @@ allOf: - - $ref: "../ErrorBase.yaml" + - $ref: "../ApiError.yaml" diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/ErrorBase.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/ApiError.java similarity index 85% rename from hivemq-edge/src/main/java/com/hivemq/api/errors/ErrorBase.java rename to hivemq-edge/src/main/java/com/hivemq/api/errors/ApiError.java index 4ed968c3c0..4f4554f849 100644 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/ErrorBase.java +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/ApiError.java @@ -8,7 +8,7 @@ import java.util.Objects; -public abstract class ErrorBase> { +public abstract class ApiError> { @JsonProperty("code") @Schema(description = "Correlation id") @@ -27,7 +27,7 @@ public abstract class ErrorBase> { protected @NotNull String type; @JsonCreator - public ErrorBase( + public ApiError( @JsonProperty(value = "type") final @NotNull String type, @JsonProperty(value = "title") final @NotNull String title, @JsonProperty(value = "detail") final @Nullable String detail, @@ -44,7 +44,7 @@ public ErrorBase( return code; } - public @NotNull ErrorBase setCode(@Nullable final String code) { + public @NotNull ApiError setCode(@Nullable final String code) { this.code = code; return this; } @@ -53,7 +53,7 @@ public ErrorBase( return detail; } - public @NotNull ErrorBase setDetail(@Nullable final String detail) { + public @NotNull ApiError setDetail(@Nullable final String detail) { this.detail = detail; return this; } @@ -62,7 +62,7 @@ public int getStatus() { return status; } - public @NotNull ErrorBase setStatus(final int status) { + public @NotNull ApiError setStatus(final int status) { this.status = status; return this; } @@ -71,7 +71,7 @@ public int getStatus() { return title; } - public @NotNull ErrorBase setTitle(@NotNull final String title) { + public @NotNull ApiError setTitle(@NotNull final String title) { this.title = Objects.requireNonNull(title); return this; } @@ -80,7 +80,7 @@ public int getStatus() { return type; } - public @NotNull ErrorBase setType(@NotNull final String type) { + public @NotNull ApiError setType(@NotNull final String type) { this.type = Objects.requireNonNull(type); return this; } @@ -110,7 +110,7 @@ public boolean equals(final @Nullable Object o) { if (o == null || getClass() != o.getClass()) { return false; } - final ErrorBase errorBase = (ErrorBase) o; + final ApiError errorBase = (ApiError) o; return status == errorBase.status && Objects.equals(code, errorBase.code) && Objects.equals(detail, errorBase.detail) && diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/common/RequestBodyMissingError.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/common/RequestBodyMissingError.java index ae3173f8d9..c2fb14b24f 100644 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/common/RequestBodyMissingError.java +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/common/RequestBodyMissingError.java @@ -1,14 +1,14 @@ package com.hivemq.api.errors.common; import com.fasterxml.jackson.annotation.JsonProperty; -import com.hivemq.api.errors.ErrorBase; +import com.hivemq.api.errors.ApiError; import com.hivemq.http.HttpStatus; import io.swagger.v3.oas.annotations.media.Schema; import org.jetbrains.annotations.NotNull; import java.util.Objects; -public class RequestBodyMissingError extends ErrorBase { +public class RequestBodyMissingError extends ApiError { @JsonProperty("parameterName") @Schema(description = "Correlation id") protected @NotNull String parameterName; diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/common/TemporaryNotAvailableError.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/common/TemporaryNotAvailableError.java index 36bc0c7bec..ae7dacd850 100644 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/common/TemporaryNotAvailableError.java +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/common/TemporaryNotAvailableError.java @@ -1,10 +1,10 @@ package com.hivemq.api.errors.common; -import com.hivemq.api.errors.ErrorBase; +import com.hivemq.api.errors.ApiError; import com.hivemq.http.HttpStatus; import org.jetbrains.annotations.NotNull; -public class TemporaryNotAvailableError extends ErrorBase { +public class TemporaryNotAvailableError extends ApiError { public TemporaryNotAvailableError() { super("errors/common/TemporaryNotAvailableError", "The endpoint is temporarily not available", diff --git a/hivemq-edge/src/main/java/com/hivemq/util/ErrorResponseUtil.java b/hivemq-edge/src/main/java/com/hivemq/util/ErrorResponseUtil.java index 3bb2e5735b..5a5d8667d9 100644 --- a/hivemq-edge/src/main/java/com/hivemq/util/ErrorResponseUtil.java +++ b/hivemq-edge/src/main/java/com/hivemq/util/ErrorResponseUtil.java @@ -15,7 +15,7 @@ */ package com.hivemq.util; -import com.hivemq.api.errors.ErrorBase; +import com.hivemq.api.errors.ApiError; import com.hivemq.http.error.ProblemDetails; import org.jetbrains.annotations.NotNull; @@ -32,7 +32,7 @@ public class ErrorResponseUtil { .build(); } - public static @NotNull Response errorResponse(final @NotNull ErrorBase error) { + public static @NotNull Response errorResponse(final @NotNull ApiError error) { return Response.status(error.getStatus()) .entity(error) .header("Content-Type", "application/json;charset=utf-8") From 47fa8acd7e6911adcb4e9a0a1daee9afae121058 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Tue, 27 May 2025 09:31:36 +0200 Subject: [PATCH 005/121] refactor: Add type auto-generation --- ext/hivemq-edge-openapi-2025.9.yaml | 58 +++++++++++++-- .../components/schemas/errors/ApiError.yaml | 2 +- .../BehaviorPolicyValidationErrors.yaml | 2 + .../datahub/DataPolicyValidationErrors.yaml | 2 + .../MissingFieldValidationError.yaml | 10 +++ .../errors/validation/ValidationError.yaml | 11 +++ .../errors/validation/ValidationErrors.yaml | 12 ++++ ...data-hub_behavior-validation_policies.yaml | 4 +- ..._v1_data-hub_data-validation_policies.yaml | 4 +- .../java/com/hivemq/api/errors/ApiError.java | 32 ++++++--- .../common/RequestBodyMissingError.java | 46 +++++++----- .../common/TemporaryNotAvailableError.java | 6 +- .../BahaviorPolicyValidationErrors.java | 52 ++++++++++++++ .../datahub/DataPolicyValidationErrors.java | 52 ++++++++++++++ .../errors/validation/ValidationError.java | 61 ++++++++++++++++ .../errors/validation/ValidationErrors.java | 71 +++++++++++++++++++ 16 files changed, 387 insertions(+), 38 deletions(-) create mode 100644 ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyValidationErrors.yaml create mode 100644 ext/openAPI/components/schemas/errors/datahub/DataPolicyValidationErrors.yaml create mode 100644 ext/openAPI/components/schemas/errors/validation/MissingFieldValidationError.yaml create mode 100644 ext/openAPI/components/schemas/errors/validation/ValidationError.yaml create mode 100644 ext/openAPI/components/schemas/errors/validation/ValidationErrors.yaml create mode 100644 hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/BahaviorPolicyValidationErrors.java create mode 100644 hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/DataPolicyValidationErrors.java create mode 100644 hivemq-edge/src/main/java/com/hivemq/api/errors/validation/ValidationError.java create mode 100644 hivemq-edge/src/main/java/com/hivemq/api/errors/validation/ValidationErrors.java diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index 88f620a3f7..f6e412522e 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -444,7 +444,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RequestBodyMissingError' + anyOf: + - $ref: '#/components/schemas/RequestBodyMissingError' + - $ref: '#/components/schemas/BehaviorPolicyValidationErrors' description: Policy creation failed '409': content: @@ -1152,7 +1154,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RequestBodyMissingError' + anyOf: + - $ref: '#/components/schemas/RequestBodyMissingError' + - $ref: '#/components/schemas/DataPolicyValidationErrors' description: DataPolicy creation failed '409': content: @@ -4625,12 +4629,12 @@ components: description: List of result items that are returned by this endpoint items: $ref: '#/components/schemas/BehaviorPolicy' - ErrorBase: + ApiError: type: object properties: code: type: string - description: Correlation id + description: Correlation id. detail: type: string description: A detailed description of the error. @@ -4651,15 +4655,54 @@ components: - type RequestBodyMissingError: allOf: - - $ref: '#/components/schemas/ErrorBase' + - $ref: '#/components/schemas/ApiError' - type: object properties: parameterName: type: string description: The name of the missing request body parameter. + ValidationError: + type: object + properties: + detail: + type: string + description: Detailed contextual description of the validation error. + type: + type: string + description: Type of the validation error. + required: + - detail + - type + MissingFieldValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + field: + type: string + description: The missing field. + required: + - field + - type + ValidationErrors: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + errors: + type: array + description: List of validation errors. + items: + anyOf: + - $ref: '#/components/schemas/MissingFieldValidationError' + required: + - errors + BehaviorPolicyValidationErrors: + allOf: + - $ref: '#/components/schemas/ValidationErrors' TemporaryNotAvailableError: allOf: - - $ref: '#/components/schemas/ErrorBase' + - $ref: '#/components/schemas/ApiError' JsonNode: type: object description: The arguments of the fsm derived from the behavior policy. @@ -4781,6 +4824,9 @@ components: description: List of result items that are returned by this endpoint items: $ref: '#/components/schemas/DataPolicy' + DataPolicyValidationErrors: + allOf: + - $ref: '#/components/schemas/ValidationErrors' Errors: type: object PolicySchema: diff --git a/ext/openAPI/components/schemas/errors/ApiError.yaml b/ext/openAPI/components/schemas/errors/ApiError.yaml index cd0ccd2ba1..c2d9a79b32 100644 --- a/ext/openAPI/components/schemas/errors/ApiError.yaml +++ b/ext/openAPI/components/schemas/errors/ApiError.yaml @@ -2,7 +2,7 @@ type: object properties: code: type: string - description: Correlation id + description: Correlation id. detail: type: string description: A detailed description of the error. diff --git a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyValidationErrors.yaml b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyValidationErrors.yaml new file mode 100644 index 0000000000..edbf113e14 --- /dev/null +++ b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyValidationErrors.yaml @@ -0,0 +1,2 @@ +allOf: + - $ref: "../validation/ValidationErrors.yaml" diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyValidationErrors.yaml b/ext/openAPI/components/schemas/errors/datahub/DataPolicyValidationErrors.yaml new file mode 100644 index 0000000000..edbf113e14 --- /dev/null +++ b/ext/openAPI/components/schemas/errors/datahub/DataPolicyValidationErrors.yaml @@ -0,0 +1,2 @@ +allOf: + - $ref: "../validation/ValidationErrors.yaml" diff --git a/ext/openAPI/components/schemas/errors/validation/MissingFieldValidationError.yaml b/ext/openAPI/components/schemas/errors/validation/MissingFieldValidationError.yaml new file mode 100644 index 0000000000..c18de75101 --- /dev/null +++ b/ext/openAPI/components/schemas/errors/validation/MissingFieldValidationError.yaml @@ -0,0 +1,10 @@ +allOf: + - $ref: "./ValidationError.yaml" + - type: object + properties: + field: + type: string + description: The missing field. + required: + - field + - type diff --git a/ext/openAPI/components/schemas/errors/validation/ValidationError.yaml b/ext/openAPI/components/schemas/errors/validation/ValidationError.yaml new file mode 100644 index 0000000000..a829cdff1a --- /dev/null +++ b/ext/openAPI/components/schemas/errors/validation/ValidationError.yaml @@ -0,0 +1,11 @@ +type: object +properties: + detail: + type: string + description: Detailed contextual description of the validation error. + type: + type: string + description: Type of the validation error. +required: + - detail + - type diff --git a/ext/openAPI/components/schemas/errors/validation/ValidationErrors.yaml b/ext/openAPI/components/schemas/errors/validation/ValidationErrors.yaml new file mode 100644 index 0000000000..672047356d --- /dev/null +++ b/ext/openAPI/components/schemas/errors/validation/ValidationErrors.yaml @@ -0,0 +1,12 @@ +allOf: + - $ref: "../ApiError.yaml" + - type: object + properties: + errors: + type: array + description: List of validation errors. + items: + anyOf: + - $ref: "./MissingFieldValidationError.yaml" + required: + - errors diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies.yaml index d71506682a..91e9c0746e 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies.yaml @@ -270,7 +270,9 @@ post: content: application/json: schema: - $ref: "../components/schemas/errors/common/RequestBodyMissingError.yaml" + anyOf: + - $ref: "../components/schemas/errors/common/RequestBodyMissingError.yaml" + - $ref: "../components/schemas/errors/datahub/BehaviorPolicyValidationErrors.yaml" description: Policy creation failed '409': content: diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml index bc3c9f109a..d166cd521d 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml @@ -399,7 +399,9 @@ post: content: application/json: schema: - $ref: "../components/schemas/errors/common/RequestBodyMissingError.yaml" + anyOf: + - $ref: "../components/schemas/errors/common/RequestBodyMissingError.yaml" + - $ref: "../components/schemas/errors/datahub/DataPolicyValidationErrors.yaml" description: DataPolicy creation failed '409': content: diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/ApiError.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/ApiError.java index 4f4554f849..6bdeceaadd 100644 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/ApiError.java +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/ApiError.java @@ -1,6 +1,5 @@ package com.hivemq.api.errors; -import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.v3.oas.annotations.media.Schema; import org.jetbrains.annotations.NotNull; @@ -9,6 +8,8 @@ import java.util.Objects; public abstract class ApiError> { + private static final String CLASS_PREFIX = "com.hivemq"; + private static final String TYPE_PREFIX = "https://hivemq.com"; @JsonProperty("code") @Schema(description = "Correlation id") @@ -26,13 +27,20 @@ public abstract class ApiError> { @JsonProperty(value = "type") protected @NotNull String type; - @JsonCreator - public ApiError( - @JsonProperty(value = "type") final @NotNull String type, - @JsonProperty(value = "title") final @NotNull String title, - @JsonProperty(value = "detail") final @Nullable String detail, - @JsonProperty(value = "status") final int status, - @JsonProperty(value = "code") final @Nullable String code) { + protected ApiError( + final @NotNull String title, + final @Nullable String detail, + final int status, + final @Nullable String code) { + this(null, title, detail, status, code); + } + + protected ApiError( + final @Nullable String type, + final @NotNull String title, + final @Nullable String detail, + final int status, + final @Nullable String code) { setCode(code); setDetail(detail); setStatus(status); @@ -40,6 +48,10 @@ public ApiError( setType(type); } + public static String getTypeFromClassName(final @NotNull Class clazz) { + return TYPE_PREFIX + clazz.getName().substring(CLASS_PREFIX.length()).replace(".", "/"); + } + public @Nullable String getCode() { return code; } @@ -80,8 +92,8 @@ public int getStatus() { return type; } - public @NotNull ApiError setType(@NotNull final String type) { - this.type = Objects.requireNonNull(type); + public @NotNull ApiError setType(@Nullable final String type) { + this.type = type == null ? getTypeFromClassName(getClass()) : type; return this; } diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/common/RequestBodyMissingError.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/common/RequestBodyMissingError.java index c2fb14b24f..c8a25f565a 100644 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/common/RequestBodyMissingError.java +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/common/RequestBodyMissingError.java @@ -5,37 +5,47 @@ import com.hivemq.http.HttpStatus; import io.swagger.v3.oas.annotations.media.Schema; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import java.util.Objects; public class RequestBodyMissingError extends ApiError { - @JsonProperty("parameterName") - @Schema(description = "Correlation id") - protected @NotNull String parameterName; + @JsonProperty("parameter") + @Schema(description = "Parameter") + protected @Nullable String parameter; - public RequestBodyMissingError(final @NotNull String parameterName) { - super("errors/common/RequestBodyMissingError", - "Required request body parameter " + parameterName + " missing", - "Required request body parameter " + parameterName + " missing", - HttpStatus.BAD_REQUEST_400, - null); - setParameterName(parameterName); + protected RequestBodyMissingError( + final @NotNull String title, + final @Nullable String detail, + final @Nullable String parameter) { + super(title, detail, HttpStatus.BAD_REQUEST_400, null); + setParameter(parameter); } - public @NotNull String getParameterName() { - return parameterName; + public static RequestBodyMissingError of(final @NotNull String parameter) { + return new RequestBodyMissingError("Required request body parameter " + parameter + " missing", + "Required request body parameter " + parameter + " missing", + parameter); } - public @NotNull RequestBodyMissingError setParameterName(final @NotNull String parameterName) { - this.parameterName = Objects.requireNonNull(parameterName); + public static RequestBodyMissingError of() { + return new RequestBodyMissingError("Required request body missing", "Required request body missing", null); + } + + public @Nullable String getParameter() { + return parameter; + } + + public @NotNull RequestBodyMissingError setParameter(final @Nullable String parameter) { + this.parameter = parameter; return this; } @Override public @NotNull String toString() { return "RequestBodyMissingError{" + - "parameterName='" + - parameterName + + "parameter='" + + parameter + '\'' + ", code='" + code + @@ -63,11 +73,11 @@ public boolean equals(final Object o) { return false; } final RequestBodyMissingError that = (RequestBodyMissingError) o; - return Objects.equals(parameterName, that.parameterName); + return Objects.equals(parameter, that.parameter); } @Override public int hashCode() { - return Objects.hash(super.hashCode(), parameterName); + return Objects.hash(super.hashCode(), parameter); } } diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/common/TemporaryNotAvailableError.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/common/TemporaryNotAvailableError.java index ae7dacd850..b9165026cf 100644 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/common/TemporaryNotAvailableError.java +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/common/TemporaryNotAvailableError.java @@ -5,7 +5,7 @@ import org.jetbrains.annotations.NotNull; public class TemporaryNotAvailableError extends ApiError { - public TemporaryNotAvailableError() { + protected TemporaryNotAvailableError() { super("errors/common/TemporaryNotAvailableError", "The endpoint is temporarily not available", "The endpoint is temporarily not available, please try again later", @@ -13,6 +13,10 @@ public TemporaryNotAvailableError() { null); } + public static TemporaryNotAvailableError of() { + return new TemporaryNotAvailableError(); + } + @Override public @NotNull String toString() { return "TemporaryNotAvailableError{" + diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/BahaviorPolicyValidationErrors.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/BahaviorPolicyValidationErrors.java new file mode 100644 index 0000000000..3be7dc5e17 --- /dev/null +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/BahaviorPolicyValidationErrors.java @@ -0,0 +1,52 @@ +package com.hivemq.api.errors.datahub; + +import com.hivemq.api.errors.validation.ValidationError; +import com.hivemq.api.errors.validation.ValidationErrors; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.List; + +public class BahaviorPolicyValidationErrors extends ValidationErrors { + protected BahaviorPolicyValidationErrors( + final @NotNull String title, + final @Nullable String detail, + final @Nullable List> errors, + final int status, + final @Nullable String code) { + super(title, detail, errors, status, code); + } + + public static BahaviorPolicyValidationErrors of(final @NotNull String title, final @Nullable String detail) { + return new BahaviorPolicyValidationErrors(title, detail, null, 400, null); + } + + public static BahaviorPolicyValidationErrors of( + final @NotNull String title, + final @Nullable String detail, + final @Nullable List> errors) { + return new BahaviorPolicyValidationErrors(title, detail, errors, 400, null); + } + + @Override + public @NotNull String toString() { + return "BahaviorPolicyValidationErrors{" + + "errors=" + + errors + + ", code='" + + code + + '\'' + + ", detail='" + + detail + + '\'' + + ", status=" + + status + + ", title='" + + title + + '\'' + + ", type='" + + type + + '\'' + + '}'; + } +} diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/DataPolicyValidationErrors.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/DataPolicyValidationErrors.java new file mode 100644 index 0000000000..32696d45f4 --- /dev/null +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/DataPolicyValidationErrors.java @@ -0,0 +1,52 @@ +package com.hivemq.api.errors.datahub; + +import com.hivemq.api.errors.validation.ValidationError; +import com.hivemq.api.errors.validation.ValidationErrors; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.List; + +public class DataPolicyValidationErrors extends ValidationErrors { + protected DataPolicyValidationErrors( + final @NotNull String title, + final @Nullable String detail, + final @Nullable List> errors, + final int status, + final @Nullable String code) { + super(title, detail, errors, status, code); + } + + public static DataPolicyValidationErrors of(final @NotNull String title, final @Nullable String detail) { + return new DataPolicyValidationErrors(title, detail, null, 400, null); + } + + public static DataPolicyValidationErrors of( + final @NotNull String title, + final @Nullable String detail, + final @Nullable List> errors) { + return new DataPolicyValidationErrors(title, detail, errors, 400, null); + } + + @Override + public @NotNull String toString() { + return "DataPolicyValidationErrors{" + + "errors=" + + errors + + ", code='" + + code + + '\'' + + ", detail='" + + detail + + '\'' + + ", status=" + + status + + ", title='" + + title + + '\'' + + ", type='" + + type + + '\'' + + '}'; + } +} diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/ValidationError.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/ValidationError.java new file mode 100644 index 0000000000..445859aacb --- /dev/null +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/ValidationError.java @@ -0,0 +1,61 @@ +package com.hivemq.api.errors.validation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.hivemq.api.errors.ApiError; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.Objects; + +public abstract class ValidationError> { + @JsonProperty("detail") + protected @NotNull String detail; + @JsonProperty("type") + protected @NotNull String type; + + protected ValidationError(@NotNull final String detail) { + this(detail, null); + } + + protected ValidationError(@NotNull final String detail, final @Nullable String type) { + setDetail(detail); + setType(type); + } + + public @NotNull String getDetail() { + return detail; + } + + public @NotNull ValidationError setDetail(@NotNull final String detail) { + this.detail = Objects.requireNonNull(detail); + return this; + } + + public @NotNull String getType() { + return type; + } + + public @NotNull ValidationError setType(final @Nullable String type) { + this.type = type == null ? ApiError.getTypeFromClassName(getClass()) : type; + return this; + } + + @Override + public @NotNull String toString() { + return "ValidationError{" + "detail='" + detail + '\'' + ", type='" + type + '\'' + '}'; + } + + @Override + public boolean equals(final @Nullable Object o) { + if (o == null || getClass() != o.getClass()) { + return false; + } + final ValidationError that = (ValidationError) o; + return Objects.equals(detail, that.detail) && Objects.equals(type, that.type); + } + + @Override + public int hashCode() { + return Objects.hash(detail, type); + } +} diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/ValidationErrors.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/ValidationErrors.java new file mode 100644 index 0000000000..66180bee38 --- /dev/null +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/ValidationErrors.java @@ -0,0 +1,71 @@ +package com.hivemq.api.errors.validation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.hivemq.api.errors.ApiError; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +public abstract class ValidationErrors extends ApiError> { + @JsonProperty("errors") + protected final @NotNull List> errors; + + protected ValidationErrors( + final @NotNull String title, + final @Nullable String detail, + final @Nullable List> errors, + final int status, + final @Nullable String code) { + super(title, detail, status, code); + this.errors = new ArrayList<>(); + if (errors != null) { + this.errors.addAll(errors); + } + } + + @Override + public @NotNull String toString() { + return "ValidationErrors{" + + "errors=" + + errors + + ", code='" + + code + + '\'' + + ", detail='" + + detail + + '\'' + + ", status=" + + status + + ", title='" + + title + + '\'' + + ", type='" + + type + + '\'' + + '}'; + } + + @Override + public boolean equals(final @Nullable Object o) { + if (o == null || getClass() != o.getClass()) { + return false; + } + if (!super.equals(o)) { + return false; + } + final ValidationErrors that = (ValidationErrors) o; + return Objects.equals(errors, that.errors); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), errors); + } + + public @NotNull List> getErrors() { + return errors; + } +} From ae98dfe386c391c14301c64857bcafbea6262072 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Tue, 27 May 2025 12:00:00 +0200 Subject: [PATCH 006/121] fix: Fix a typo --- ...ava => BehaviorPolicyValidationErrors.java} | 18 ++++++++---------- .../datahub/DataPolicyValidationErrors.java | 8 +------- .../errors/validation/ValidationErrors.java | 2 +- 3 files changed, 10 insertions(+), 18 deletions(-) rename hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/{BahaviorPolicyValidationErrors.java => BehaviorPolicyValidationErrors.java} (66%) diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/BahaviorPolicyValidationErrors.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/BehaviorPolicyValidationErrors.java similarity index 66% rename from hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/BahaviorPolicyValidationErrors.java rename to hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/BehaviorPolicyValidationErrors.java index 3be7dc5e17..df666b9579 100644 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/BahaviorPolicyValidationErrors.java +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/BehaviorPolicyValidationErrors.java @@ -7,8 +7,8 @@ import java.util.List; -public class BahaviorPolicyValidationErrors extends ValidationErrors { - protected BahaviorPolicyValidationErrors( +public class BehaviorPolicyValidationErrors extends ValidationErrors { + protected BehaviorPolicyValidationErrors( final @NotNull String title, final @Nullable String detail, final @Nullable List> errors, @@ -17,15 +17,13 @@ protected BahaviorPolicyValidationErrors( super(title, detail, errors, status, code); } - public static BahaviorPolicyValidationErrors of(final @NotNull String title, final @Nullable String detail) { - return new BahaviorPolicyValidationErrors(title, detail, null, 400, null); - } - - public static BahaviorPolicyValidationErrors of( - final @NotNull String title, - final @Nullable String detail, + public static BehaviorPolicyValidationErrors of( final @Nullable List> errors) { - return new BahaviorPolicyValidationErrors(title, detail, errors, 400, null); + return new BehaviorPolicyValidationErrors("Behavior policy is invalid", + "Behavior policy is invalid", + errors, + 400, + null); } @Override diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/DataPolicyValidationErrors.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/DataPolicyValidationErrors.java index 32696d45f4..0cda166bff 100644 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/DataPolicyValidationErrors.java +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/DataPolicyValidationErrors.java @@ -17,15 +17,9 @@ protected DataPolicyValidationErrors( super(title, detail, errors, status, code); } - public static DataPolicyValidationErrors of(final @NotNull String title, final @Nullable String detail) { - return new DataPolicyValidationErrors(title, detail, null, 400, null); - } - public static DataPolicyValidationErrors of( - final @NotNull String title, - final @Nullable String detail, final @Nullable List> errors) { - return new DataPolicyValidationErrors(title, detail, errors, 400, null); + return new DataPolicyValidationErrors("Data policy is invalid", "Data policy is invalid", errors, 400, null); } @Override diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/ValidationErrors.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/ValidationErrors.java index 66180bee38..ea8f4267ac 100644 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/ValidationErrors.java +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/ValidationErrors.java @@ -21,7 +21,7 @@ protected ValidationErrors( final @Nullable String code) { super(title, detail, status, code); this.errors = new ArrayList<>(); - if (errors != null) { + if (errors != null && !errors.isEmpty()) { this.errors.addAll(errors); } } From f47d750997f574dcee26b9a10447e40842af0bf5 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Wed, 28 May 2025 09:53:12 +0200 Subject: [PATCH 007/121] feat: Add some valication errors for DataHub --- ext/hivemq-edge-openapi-2025.9.yaml | 171 +++++++++++++++++- .../AtMostOneFunctionValidationError.yaml | 19 ++ .../FunctionMustBePairedValidationError.yaml | 13 ++ .../datahub/GeneralPolicyValidationError.yaml | 9 + .../InvalidFunctionOrderValidationError.yaml | 17 ++ .../UnknownVariableValidationError.yaml | 15 ++ .../validation/EmptyFieldValidationError.yaml | 9 + .../InvalidFieldLengthValidationError.yaml | 25 +++ .../InvalidFieldValueValidationError.yaml | 13 ++ .../InvalidIdentifierValidationError.yaml | 13 ++ .../MissingFieldValidationError.yaml | 1 - .../UnsupportedFieldValidationError.yaml | 17 ++ .../errors/validation/ValidationErrors.yaml | 10 + .../java/com/hivemq/api/errors/ApiError.java | 16 ++ .../common/RequestBodyMissingError.java | 22 ++- .../common/TemporaryNotAvailableError.java | 20 +- .../AtMostOneFunctionValidationError.java | 92 ++++++++++ .../BehaviorPolicyValidationErrors.java | 20 +- .../datahub/DataPolicyValidationErrors.java | 20 +- .../FunctionMustBePairedValidationError.java | 75 ++++++++ .../datahub/GeneralPolicyValidationError.java | 78 ++++++++ .../InvalidFunctionOrderValidationError.java | 93 ++++++++++ .../UnknownVariableValidationError.java | 110 +++++++++++ .../validation/EmptyFieldValidationError.java | 81 +++++++++ .../InvalidFieldLengthValidationError.java | 155 ++++++++++++++++ .../InvalidFieldValueValidationError.java | 98 ++++++++++ .../InvalidIdentifierValidationError.java | 107 +++++++++++ .../MissingFieldValidationError.java | 81 +++++++++ .../UnsupportedFieldValidationError.java | 103 +++++++++++ .../errors/validation/ValidationError.java | 16 ++ .../errors/validation/ValidationErrors.java | 16 ++ 31 files changed, 1524 insertions(+), 11 deletions(-) create mode 100644 ext/openAPI/components/schemas/errors/datahub/AtMostOneFunctionValidationError.yaml create mode 100644 ext/openAPI/components/schemas/errors/datahub/FunctionMustBePairedValidationError.yaml create mode 100644 ext/openAPI/components/schemas/errors/datahub/GeneralPolicyValidationError.yaml create mode 100644 ext/openAPI/components/schemas/errors/datahub/InvalidFunctionOrderValidationError.yaml create mode 100644 ext/openAPI/components/schemas/errors/datahub/UnknownVariableValidationError.yaml create mode 100644 ext/openAPI/components/schemas/errors/validation/EmptyFieldValidationError.yaml create mode 100644 ext/openAPI/components/schemas/errors/validation/InvalidFieldLengthValidationError.yaml create mode 100644 ext/openAPI/components/schemas/errors/validation/InvalidFieldValueValidationError.yaml create mode 100644 ext/openAPI/components/schemas/errors/validation/InvalidIdentifierValidationError.yaml create mode 100644 ext/openAPI/components/schemas/errors/validation/UnsupportedFieldValidationError.yaml create mode 100644 hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/AtMostOneFunctionValidationError.java create mode 100644 hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/FunctionMustBePairedValidationError.java create mode 100644 hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/GeneralPolicyValidationError.java create mode 100644 hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/InvalidFunctionOrderValidationError.java create mode 100644 hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/UnknownVariableValidationError.java create mode 100644 hivemq-edge/src/main/java/com/hivemq/api/errors/validation/EmptyFieldValidationError.java create mode 100644 hivemq-edge/src/main/java/com/hivemq/api/errors/validation/InvalidFieldLengthValidationError.java create mode 100644 hivemq-edge/src/main/java/com/hivemq/api/errors/validation/InvalidFieldValueValidationError.java create mode 100644 hivemq-edge/src/main/java/com/hivemq/api/errors/validation/InvalidIdentifierValidationError.java create mode 100644 hivemq-edge/src/main/java/com/hivemq/api/errors/validation/MissingFieldValidationError.java create mode 100644 hivemq-edge/src/main/java/com/hivemq/api/errors/validation/UnsupportedFieldValidationError.java diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index f6e412522e..ebeba02511 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -4673,6 +4673,70 @@ components: required: - detail - type + EmptyFieldValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + field: + type: string + description: The missing field. + required: + - field + InvalidFieldLengthValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + actualLength: + type: integer + description: The actual length of the field value. + expectedMinimumLength: + type: integer + description: The minimum length expected for the field value. + expectedMaximumLength: + type: integer + description: The maximum length expected for the field value. + field: + type: string + description: The invalid field. + value: + type: string + description: The invalid value. + required: + - actualLength + - expectedMinimumLength + - expectedMaximumLength + - field + - value + InvalidFieldValueValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + field: + type: string + description: The invalid field. + value: + type: string + description: The invalid value. + required: + - field + - value + InvalidIdentifierValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + field: + type: string + description: The invalid identifier field. + value: + type: string + description: The invalid identifier value. + required: + - field + - value MissingFieldValidationError: allOf: - $ref: '#/components/schemas/ValidationError' @@ -4683,7 +4747,102 @@ components: description: The missing field. required: - field - - type + UnsupportedFieldValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + actualValue: + type: string + description: The actual value. + expectedValue: + type: string + description: The expected value. + field: + type: string + description: The field. + required: + - actualValue + - expectedValue + - field + AtMostOneFunctionValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + function: + type: string + description: The function. + occurrences: + type: int + description: The occurrences of the function. + paths: + type: array + items: + type: string + description: The paths where the function occurs. + required: + - function + - occurrences + - paths + FunctionMustBePairedValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + existingFunction: + type: string + description: The existing function. + missingFunction: + type: string + description: The missing function. + required: + - existingFunction + - missingFunction + GeneralPolicyValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + title: + type: string + description: The title. + required: + - title + InvalidFunctionOrderValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + field: + type: string + description: The field. + function: + type: string + description: The function. + previousFunction: + type: string + description: The previous function. + required: + - field + - function + - previousFunction + UnknownVariableValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + field: + type: string + description: The field. + variables: + type: array + items: + type: string + description: The unknown variables. + required: + - field + - variables ValidationErrors: allOf: - $ref: '#/components/schemas/ApiError' @@ -4694,7 +4853,17 @@ components: description: List of validation errors. items: anyOf: + - $ref: '#/components/schemas/EmptyFieldValidationError' + - $ref: '#/components/schemas/InvalidFieldLengthValidationError' + - $ref: '#/components/schemas/InvalidFieldValueValidationError' + - $ref: '#/components/schemas/InvalidIdentifierValidationError' - $ref: '#/components/schemas/MissingFieldValidationError' + - $ref: '#/components/schemas/UnsupportedFieldValidationError' + - $ref: '#/components/schemas/AtMostOneFunctionValidationError' + - $ref: '#/components/schemas/FunctionMustBePairedValidationError' + - $ref: '#/components/schemas/GeneralPolicyValidationError' + - $ref: '#/components/schemas/InvalidFunctionOrderValidationError' + - $ref: '#/components/schemas/UnknownVariableValidationError' required: - errors BehaviorPolicyValidationErrors: diff --git a/ext/openAPI/components/schemas/errors/datahub/AtMostOneFunctionValidationError.yaml b/ext/openAPI/components/schemas/errors/datahub/AtMostOneFunctionValidationError.yaml new file mode 100644 index 0000000000..9cf712a8f5 --- /dev/null +++ b/ext/openAPI/components/schemas/errors/datahub/AtMostOneFunctionValidationError.yaml @@ -0,0 +1,19 @@ +allOf: + - $ref: "../validation/ValidationError.yaml" + - type: object + properties: + function: + type: string + description: The function. + occurrences: + type: int + description: The occurrences of the function. + paths: + type: array + items: + type: string + description: The paths where the function occurs. + required: + - function + - occurrences + - paths diff --git a/ext/openAPI/components/schemas/errors/datahub/FunctionMustBePairedValidationError.yaml b/ext/openAPI/components/schemas/errors/datahub/FunctionMustBePairedValidationError.yaml new file mode 100644 index 0000000000..07ff484703 --- /dev/null +++ b/ext/openAPI/components/schemas/errors/datahub/FunctionMustBePairedValidationError.yaml @@ -0,0 +1,13 @@ +allOf: + - $ref: "../validation/ValidationError.yaml" + - type: object + properties: + existingFunction: + type: string + description: The existing function. + missingFunction: + type: string + description: The missing function. + required: + - existingFunction + - missingFunction diff --git a/ext/openAPI/components/schemas/errors/datahub/GeneralPolicyValidationError.yaml b/ext/openAPI/components/schemas/errors/datahub/GeneralPolicyValidationError.yaml new file mode 100644 index 0000000000..45e26077dc --- /dev/null +++ b/ext/openAPI/components/schemas/errors/datahub/GeneralPolicyValidationError.yaml @@ -0,0 +1,9 @@ +allOf: + - $ref: "../validation/ValidationError.yaml" + - type: object + properties: + title: + type: string + description: The title. + required: + - title diff --git a/ext/openAPI/components/schemas/errors/datahub/InvalidFunctionOrderValidationError.yaml b/ext/openAPI/components/schemas/errors/datahub/InvalidFunctionOrderValidationError.yaml new file mode 100644 index 0000000000..ea5adab888 --- /dev/null +++ b/ext/openAPI/components/schemas/errors/datahub/InvalidFunctionOrderValidationError.yaml @@ -0,0 +1,17 @@ +allOf: + - $ref: "../validation/ValidationError.yaml" + - type: object + properties: + field: + type: string + description: The field. + function: + type: string + description: The function. + previousFunction: + type: string + description: The previous function. + required: + - field + - function + - previousFunction diff --git a/ext/openAPI/components/schemas/errors/datahub/UnknownVariableValidationError.yaml b/ext/openAPI/components/schemas/errors/datahub/UnknownVariableValidationError.yaml new file mode 100644 index 0000000000..2718f109be --- /dev/null +++ b/ext/openAPI/components/schemas/errors/datahub/UnknownVariableValidationError.yaml @@ -0,0 +1,15 @@ +allOf: + - $ref: "../validation/ValidationError.yaml" + - type: object + properties: + field: + type: string + description: The field. + variables: + type: array + items: + type: string + description: The unknown variables. + required: + - field + - variables diff --git a/ext/openAPI/components/schemas/errors/validation/EmptyFieldValidationError.yaml b/ext/openAPI/components/schemas/errors/validation/EmptyFieldValidationError.yaml new file mode 100644 index 0000000000..d37e184cd3 --- /dev/null +++ b/ext/openAPI/components/schemas/errors/validation/EmptyFieldValidationError.yaml @@ -0,0 +1,9 @@ +allOf: + - $ref: "./ValidationError.yaml" + - type: object + properties: + field: + type: string + description: The missing field. + required: + - field diff --git a/ext/openAPI/components/schemas/errors/validation/InvalidFieldLengthValidationError.yaml b/ext/openAPI/components/schemas/errors/validation/InvalidFieldLengthValidationError.yaml new file mode 100644 index 0000000000..4e22290c1c --- /dev/null +++ b/ext/openAPI/components/schemas/errors/validation/InvalidFieldLengthValidationError.yaml @@ -0,0 +1,25 @@ +allOf: + - $ref: "./ValidationError.yaml" + - type: object + properties: + actualLength: + type: integer + description: The actual length of the field value. + expectedMinimumLength: + type: integer + description: The minimum length expected for the field value. + expectedMaximumLength: + type: integer + description: The maximum length expected for the field value. + field: + type: string + description: The invalid field. + value: + type: string + description: The invalid value. + required: + - actualLength + - expectedMinimumLength + - expectedMaximumLength + - field + - value diff --git a/ext/openAPI/components/schemas/errors/validation/InvalidFieldValueValidationError.yaml b/ext/openAPI/components/schemas/errors/validation/InvalidFieldValueValidationError.yaml new file mode 100644 index 0000000000..f9dd044216 --- /dev/null +++ b/ext/openAPI/components/schemas/errors/validation/InvalidFieldValueValidationError.yaml @@ -0,0 +1,13 @@ +allOf: + - $ref: "./ValidationError.yaml" + - type: object + properties: + field: + type: string + description: The invalid field. + value: + type: string + description: The invalid value. + required: + - field + - value diff --git a/ext/openAPI/components/schemas/errors/validation/InvalidIdentifierValidationError.yaml b/ext/openAPI/components/schemas/errors/validation/InvalidIdentifierValidationError.yaml new file mode 100644 index 0000000000..621fdbd3eb --- /dev/null +++ b/ext/openAPI/components/schemas/errors/validation/InvalidIdentifierValidationError.yaml @@ -0,0 +1,13 @@ +allOf: + - $ref: "./ValidationError.yaml" + - type: object + properties: + field: + type: string + description: The invalid identifier field. + value: + type: string + description: The invalid identifier value. + required: + - field + - value diff --git a/ext/openAPI/components/schemas/errors/validation/MissingFieldValidationError.yaml b/ext/openAPI/components/schemas/errors/validation/MissingFieldValidationError.yaml index c18de75101..d37e184cd3 100644 --- a/ext/openAPI/components/schemas/errors/validation/MissingFieldValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/validation/MissingFieldValidationError.yaml @@ -7,4 +7,3 @@ allOf: description: The missing field. required: - field - - type diff --git a/ext/openAPI/components/schemas/errors/validation/UnsupportedFieldValidationError.yaml b/ext/openAPI/components/schemas/errors/validation/UnsupportedFieldValidationError.yaml new file mode 100644 index 0000000000..18d411dbd4 --- /dev/null +++ b/ext/openAPI/components/schemas/errors/validation/UnsupportedFieldValidationError.yaml @@ -0,0 +1,17 @@ +allOf: + - $ref: "./ValidationError.yaml" + - type: object + properties: + actualValue: + type: string + description: The actual value. + expectedValue: + type: string + description: The expected value. + field: + type: string + description: The field. + required: + - actualValue + - expectedValue + - field diff --git a/ext/openAPI/components/schemas/errors/validation/ValidationErrors.yaml b/ext/openAPI/components/schemas/errors/validation/ValidationErrors.yaml index 672047356d..8da9a778a9 100644 --- a/ext/openAPI/components/schemas/errors/validation/ValidationErrors.yaml +++ b/ext/openAPI/components/schemas/errors/validation/ValidationErrors.yaml @@ -7,6 +7,16 @@ allOf: description: List of validation errors. items: anyOf: + - $ref: "./EmptyFieldValidationError.yaml" + - $ref: "./InvalidFieldLengthValidationError.yaml" + - $ref: "./InvalidFieldValueValidationError.yaml" + - $ref: "./InvalidIdentifierValidationError.yaml" - $ref: "./MissingFieldValidationError.yaml" + - $ref: "./UnsupportedFieldValidationError.yaml" + - $ref: "../datahub/AtMostOneFunctionValidationError.yaml" + - $ref: "../datahub/FunctionMustBePairedValidationError.yaml" + - $ref: "../datahub/GeneralPolicyValidationError.yaml" + - $ref: "../datahub/InvalidFunctionOrderValidationError.yaml" + - $ref: "../datahub/UnknownVariableValidationError.yaml" required: - errors diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/ApiError.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/ApiError.java index 6bdeceaadd..0190124e84 100644 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/ApiError.java +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/ApiError.java @@ -1,3 +1,19 @@ +/* + * Copyright 2019-present HiveMQ GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.hivemq.api.errors; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/common/RequestBodyMissingError.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/common/RequestBodyMissingError.java index c8a25f565a..ff54099fd8 100644 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/common/RequestBodyMissingError.java +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/common/RequestBodyMissingError.java @@ -1,3 +1,19 @@ +/* + * Copyright 2019-present HiveMQ GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.hivemq.api.errors.common; import com.fasterxml.jackson.annotation.JsonProperty; @@ -9,12 +25,12 @@ import java.util.Objects; -public class RequestBodyMissingError extends ApiError { +public final class RequestBodyMissingError extends ApiError { @JsonProperty("parameter") @Schema(description = "Parameter") - protected @Nullable String parameter; + private @Nullable String parameter; - protected RequestBodyMissingError( + private RequestBodyMissingError( final @NotNull String title, final @Nullable String detail, final @Nullable String parameter) { diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/common/TemporaryNotAvailableError.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/common/TemporaryNotAvailableError.java index b9165026cf..a394de854a 100644 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/common/TemporaryNotAvailableError.java +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/common/TemporaryNotAvailableError.java @@ -1,11 +1,27 @@ +/* + * Copyright 2019-present HiveMQ GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.hivemq.api.errors.common; import com.hivemq.api.errors.ApiError; import com.hivemq.http.HttpStatus; import org.jetbrains.annotations.NotNull; -public class TemporaryNotAvailableError extends ApiError { - protected TemporaryNotAvailableError() { +public final class TemporaryNotAvailableError extends ApiError { + private TemporaryNotAvailableError() { super("errors/common/TemporaryNotAvailableError", "The endpoint is temporarily not available", "The endpoint is temporarily not available, please try again later", diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/AtMostOneFunctionValidationError.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/AtMostOneFunctionValidationError.java new file mode 100644 index 0000000000..c4d55c3ac9 --- /dev/null +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/AtMostOneFunctionValidationError.java @@ -0,0 +1,92 @@ +/* + * Copyright 2019-present HiveMQ GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.hivemq.api.errors.datahub; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.hivemq.api.errors.validation.ValidationError; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +public final class AtMostOneFunctionValidationError extends ValidationError { + @JsonProperty("paths") + private final @NotNull List paths; + @JsonProperty("function") + private @NotNull String function; + @JsonProperty("occurrences") + private int occurrences; + + private AtMostOneFunctionValidationError( + final @NotNull String detail, + final @NotNull String function, + final int occurrences, + final @Nullable List paths) { + super(detail); + setFunction(function); + setOccurrences(occurrences); + this.paths = new ArrayList<>(); + if (paths != null && !paths.isEmpty()) { + this.paths.addAll(paths); + } + } + + public static @NotNull AtMostOneFunctionValidationError of( + final @NotNull String function, + final int occurrences, + final @Nullable List paths) { + return new AtMostOneFunctionValidationError("The pipeline must contain at most one '" + + function + + "' function, but " + + occurrences + + " were found at " + + paths + + ".", function, occurrences, paths); + } + + public static @NotNull AtMostOneFunctionValidationError of( + final @NotNull String detail, + final @NotNull String function, + final int occurrences, + final @Nullable List paths) { + return new AtMostOneFunctionValidationError(detail, function, occurrences, paths); + } + + public int getOccurrences() { + return occurrences; + } + + public @NotNull AtMostOneFunctionValidationError setOccurrences(final int occurrences) { + this.occurrences = occurrences; + return this; + } + + public @NotNull List getPaths() { + return paths; + } + + public @NotNull String getFunction() { + return function; + } + + public @NotNull AtMostOneFunctionValidationError setFunction(@NotNull final String function) { + this.function = Objects.requireNonNull(function); + return this; + } +} diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/BehaviorPolicyValidationErrors.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/BehaviorPolicyValidationErrors.java index df666b9579..8de7127e63 100644 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/BehaviorPolicyValidationErrors.java +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/BehaviorPolicyValidationErrors.java @@ -1,3 +1,19 @@ +/* + * Copyright 2019-present HiveMQ GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.hivemq.api.errors.datahub; import com.hivemq.api.errors.validation.ValidationError; @@ -7,8 +23,8 @@ import java.util.List; -public class BehaviorPolicyValidationErrors extends ValidationErrors { - protected BehaviorPolicyValidationErrors( +public final class BehaviorPolicyValidationErrors extends ValidationErrors { + private BehaviorPolicyValidationErrors( final @NotNull String title, final @Nullable String detail, final @Nullable List> errors, diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/DataPolicyValidationErrors.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/DataPolicyValidationErrors.java index 0cda166bff..4768a0be97 100644 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/DataPolicyValidationErrors.java +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/DataPolicyValidationErrors.java @@ -1,3 +1,19 @@ +/* + * Copyright 2019-present HiveMQ GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.hivemq.api.errors.datahub; import com.hivemq.api.errors.validation.ValidationError; @@ -7,8 +23,8 @@ import java.util.List; -public class DataPolicyValidationErrors extends ValidationErrors { - protected DataPolicyValidationErrors( +public final class DataPolicyValidationErrors extends ValidationErrors { + private DataPolicyValidationErrors( final @NotNull String title, final @Nullable String detail, final @Nullable List> errors, diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/FunctionMustBePairedValidationError.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/FunctionMustBePairedValidationError.java new file mode 100644 index 0000000000..d9263d724c --- /dev/null +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/FunctionMustBePairedValidationError.java @@ -0,0 +1,75 @@ +/* + * Copyright 2019-present HiveMQ GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.hivemq.api.errors.datahub; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.hivemq.api.errors.validation.ValidationError; +import org.jetbrains.annotations.NotNull; + +import java.util.Objects; + +public final class FunctionMustBePairedValidationError extends ValidationError { + @JsonProperty("existingFunction") + private @NotNull String existingFunction; + + @JsonProperty("missingFunction") + private @NotNull String missingFunction; + + private FunctionMustBePairedValidationError( + final @NotNull String detail, + final @NotNull String existingFunction, + final @NotNull String missingFunction) { + super(detail); + setExistingFunction(existingFunction); + setMissingFunction(missingFunction); + } + + public static @NotNull FunctionMustBePairedValidationError of( + final @NotNull String existingFunction, + final @NotNull String missingFunction) { + return new FunctionMustBePairedValidationError("If '" + + existingFunction + + "' function is present in the pipeline, '" + + missingFunction + + "' function must be present as well.", existingFunction, missingFunction); + } + + public static @NotNull FunctionMustBePairedValidationError of( + final @NotNull String detail, + final @NotNull String existingFunction, + final @NotNull String missingFunction) { + return new FunctionMustBePairedValidationError(detail, existingFunction, missingFunction); + } + + public @NotNull String getMissingFunction() { + return missingFunction; + } + + public @NotNull FunctionMustBePairedValidationError setMissingFunction(@NotNull final String missingFunction) { + this.missingFunction = Objects.requireNonNull(missingFunction); + return this; + } + + public @NotNull String getExistingFunction() { + return existingFunction; + } + + public @NotNull FunctionMustBePairedValidationError setExistingFunction(@NotNull final String existingFunction) { + this.existingFunction = Objects.requireNonNull(existingFunction); + return this; + } +} diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/GeneralPolicyValidationError.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/GeneralPolicyValidationError.java new file mode 100644 index 0000000000..2f7eeeb902 --- /dev/null +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/GeneralPolicyValidationError.java @@ -0,0 +1,78 @@ +/* + * Copyright 2019-present HiveMQ GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.hivemq.api.errors.datahub; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.hivemq.api.errors.validation.ValidationError; +import org.jetbrains.annotations.NotNull; + +import java.util.Objects; + +public final class GeneralPolicyValidationError extends ValidationError { + @JsonProperty("title") + private @NotNull String title; + + private GeneralPolicyValidationError(final @NotNull String detail, final @NotNull String title) { + super(detail); + setTitle(title); + } + + public static @NotNull GeneralPolicyValidationError of(final @NotNull String detail, final @NotNull String title) { + return new GeneralPolicyValidationError(detail, title); + } + + public @NotNull String getTitle() { + return title; + } + + public @NotNull GeneralPolicyValidationError setTitle(@NotNull final String title) { + this.title = Objects.requireNonNull(title); + return this; + } + + @Override + public @NotNull String toString() { + return "GeneralPolicyValidationError{" + + "title='" + + title + + '\'' + + ", detail='" + + detail + + '\'' + + ", type='" + + type + + '\'' + + '}'; + } + + @Override + public boolean equals(final Object o) { + if (o == null || getClass() != o.getClass()) { + return false; + } + if (!super.equals(o)) { + return false; + } + final GeneralPolicyValidationError that = (GeneralPolicyValidationError) o; + return Objects.equals(title, that.title); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), title); + } +} diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/InvalidFunctionOrderValidationError.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/InvalidFunctionOrderValidationError.java new file mode 100644 index 0000000000..e95d2a486d --- /dev/null +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/InvalidFunctionOrderValidationError.java @@ -0,0 +1,93 @@ +/* + * Copyright 2019-present HiveMQ GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.hivemq.api.errors.datahub; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.hivemq.api.errors.validation.ValidationError; +import org.jetbrains.annotations.NotNull; + +import java.util.Objects; + +public final class InvalidFunctionOrderValidationError extends ValidationError { + @JsonProperty("field") + private @NotNull String field; + + @JsonProperty("function") + private @NotNull String function; + + @JsonProperty("previousFunction") + private @NotNull String previousFunction; + + private InvalidFunctionOrderValidationError( + final @NotNull String detail, + final @NotNull String field, + final @NotNull String function, + final @NotNull String previousFunction) { + super(detail); + setField(field); + setFunction(function); + setPreviousFunction(previousFunction); + } + + public static @NotNull InvalidFunctionOrderValidationError of( + final @NotNull String field, + final @NotNull String function, + final @NotNull String previousFunction) { + return new InvalidFunctionOrderValidationError("The operation at '" + + field + + "' with the functionId '" + + function + + "' must be after a '" + + previousFunction + + "' operation.", field, function, previousFunction); + } + + public static @NotNull InvalidFunctionOrderValidationError of( + final @NotNull String detail, + final @NotNull String field, + final @NotNull String function, + final @NotNull String previousFunction) { + return new InvalidFunctionOrderValidationError(detail, field, function, previousFunction); + } + + public @NotNull String getField() { + return field; + } + + public @NotNull InvalidFunctionOrderValidationError setField(@NotNull final String field) { + this.field = Objects.requireNonNull(field); + return this; + } + + public @NotNull String getPreviousFunction() { + return previousFunction; + } + + public @NotNull InvalidFunctionOrderValidationError setPreviousFunction(@NotNull final String previousFunction) { + this.previousFunction = Objects.requireNonNull(previousFunction); + return this; + } + + public @NotNull String getFunction() { + return function; + } + + public @NotNull InvalidFunctionOrderValidationError setFunction(@NotNull final String function) { + this.function = Objects.requireNonNull(function); + return this; + } +} diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/UnknownVariableValidationError.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/UnknownVariableValidationError.java new file mode 100644 index 0000000000..2516504991 --- /dev/null +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/UnknownVariableValidationError.java @@ -0,0 +1,110 @@ +/* + * Copyright 2019-present HiveMQ GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.hivemq.api.errors.datahub; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.hivemq.api.errors.validation.ValidationError; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +public final class UnknownVariableValidationError extends ValidationError { + @JsonProperty("variables") + private final @NotNull List variables; + + @JsonProperty("field") + private @NotNull String field; + + private UnknownVariableValidationError( + final @NotNull String detail, + final @NotNull String field, + final @Nullable List variables) { + super(detail); + setField(field); + this.variables = new ArrayList<>(); + if (variables != null && !variables.isEmpty()) { + this.variables.addAll(variables); + } + } + + public static @NotNull UnknownVariableValidationError of( + final @NotNull String field, + final @Nullable List variables) { + return new UnknownVariableValidationError("Field '" + + field + + "' contains unknown variables: [" + + variables + + "].", field, variables); + } + + public static @NotNull UnknownVariableValidationError of( + final @NotNull String detail, + final @NotNull String field, + final @Nullable List variables) { + return new UnknownVariableValidationError(detail, field, variables); + } + + public @NotNull String getField() { + return field; + } + + public @NotNull UnknownVariableValidationError setField(@NotNull final String field) { + this.field = Objects.requireNonNull(field); + return this; + } + + @Override + public @NotNull String toString() { + return "UnknownVariableValidationError{" + + "variables=" + + variables + + ", field='" + + field + + '\'' + + ", detail='" + + detail + + '\'' + + ", type='" + + type + + '\'' + + '}'; + } + + @Override + public boolean equals(final Object o) { + if (o == null || getClass() != o.getClass()) { + return false; + } + if (!super.equals(o)) { + return false; + } + final UnknownVariableValidationError that = (UnknownVariableValidationError) o; + return Objects.equals(variables, that.variables) && Objects.equals(field, that.field); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), variables, field); + } + + public @NotNull List getVariables() { + return variables; + } +} diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/EmptyFieldValidationError.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/EmptyFieldValidationError.java new file mode 100644 index 0000000000..a611e7b50c --- /dev/null +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/EmptyFieldValidationError.java @@ -0,0 +1,81 @@ +/* + * Copyright 2019-present HiveMQ GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.hivemq.api.errors.validation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import org.jetbrains.annotations.NotNull; + +import java.util.Objects; + +public final class EmptyFieldValidationError extends ValidationError { + @JsonProperty("field") + private @NotNull String field; + + private EmptyFieldValidationError(final @NotNull String detail, @NotNull final String field) { + super(detail); + setField(field); + } + + public static @NotNull EmptyFieldValidationError of(final @NotNull String field) { + return new EmptyFieldValidationError("Required field '" + field + "' is empty", field); + } + + public static @NotNull EmptyFieldValidationError of(final @NotNull String detail, final @NotNull String field) { + return new EmptyFieldValidationError(detail, field); + } + + public @NotNull String getField() { + return field; + } + + public @NotNull EmptyFieldValidationError setField(@NotNull final String field) { + this.field = Objects.requireNonNull(field); + return this; + } + + @Override + public @NotNull String toString() { + return "EmptyFieldValidationError{" + + "field='" + + field + + '\'' + + ", detail='" + + detail + + '\'' + + ", type='" + + type + + '\'' + + '}'; + } + + @Override + public boolean equals(final Object o) { + if (o == null || getClass() != o.getClass()) { + return false; + } + if (!super.equals(o)) { + return false; + } + final EmptyFieldValidationError that = (EmptyFieldValidationError) o; + return Objects.equals(field, that.field); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), field); + } +} diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/InvalidFieldLengthValidationError.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/InvalidFieldLengthValidationError.java new file mode 100644 index 0000000000..abf41d4a1d --- /dev/null +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/InvalidFieldLengthValidationError.java @@ -0,0 +1,155 @@ +/* + * Copyright 2019-present HiveMQ GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.hivemq.api.errors.validation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import org.jetbrains.annotations.NotNull; + +import java.util.Objects; + +public final class InvalidFieldLengthValidationError extends ValidationError { + @JsonProperty("actualLength") + private int actualLength; + @JsonProperty("expectedMinimumLength") + private int expectedMinimumLength; + @JsonProperty("expectedMaximumLength") + private int expectedMaximumLength; + @JsonProperty("field") + private @NotNull String field; + @JsonProperty("value") + private @NotNull String value; + + private InvalidFieldLengthValidationError( + final @NotNull String detail, + final @NotNull String field, + final @NotNull String value, + final int actualLength, + final int expectedMinimumLength, + final int expectedMaximumLength) { + super(detail); + setActualLength(actualLength); + setExpectedMinimumLength(expectedMinimumLength); + setExpectedMaximumLength(expectedMaximumLength); + setField(field); + setValue(value); + } + + public static @NotNull InvalidFieldLengthValidationError of( + final @NotNull String detail, + final @NotNull String field, + final @NotNull String value, + final int actualLength, + final int expectedMinimumLength, + final int expectedMaximumLength) { + return new InvalidFieldLengthValidationError(detail, + field, + value, + actualLength, + expectedMinimumLength, + expectedMaximumLength); + } + + @Override + public @NotNull String toString() { + return "InvalidFieldLengthValidationError{" + + "actualLength=" + + actualLength + + ", expectedMinimumLength=" + + expectedMinimumLength + + ", expectedMaximumLength=" + + expectedMaximumLength + + ", field='" + + field + + '\'' + + ", value='" + + value + + '\'' + + ", detail='" + + detail + + '\'' + + ", type='" + + type + + '\'' + + '}'; + } + + @Override + public boolean equals(final Object o) { + if (o == null || getClass() != o.getClass()) { + return false; + } + if (!super.equals(o)) { + return false; + } + final InvalidFieldLengthValidationError that = (InvalidFieldLengthValidationError) o; + return actualLength == that.actualLength && + expectedMinimumLength == that.expectedMinimumLength && + expectedMaximumLength == that.expectedMaximumLength && + Objects.equals(field, that.field) && + Objects.equals(value, that.value); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), actualLength, expectedMinimumLength, expectedMaximumLength, field, value); + } + + public int getActualLength() { + return actualLength; + } + + public @NotNull InvalidFieldLengthValidationError setActualLength(final int actualLength) { + this.actualLength = actualLength; + return this; + } + + public int getExpectedMinimumLength() { + return expectedMinimumLength; + } + + public @NotNull InvalidFieldLengthValidationError setExpectedMinimumLength(final int expectedMinimumLength) { + this.expectedMinimumLength = expectedMinimumLength; + return this; + } + + public int getExpectedMaximumLength() { + return expectedMaximumLength; + } + + public @NotNull InvalidFieldLengthValidationError setExpectedMaximumLength(final int expectedMaximumLength) { + this.expectedMaximumLength = expectedMaximumLength; + return this; + } + + public @NotNull String getValue() { + return value; + } + + public @NotNull InvalidFieldLengthValidationError setValue(final @NotNull String value) { + this.value = Objects.requireNonNull(value); + return this; + } + + public @NotNull String getField() { + return field; + } + + public @NotNull InvalidFieldLengthValidationError setField(final @NotNull String field) { + this.field = Objects.requireNonNull(field); + return this; + } +} diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/InvalidFieldValueValidationError.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/InvalidFieldValueValidationError.java new file mode 100644 index 0000000000..83ec93a299 --- /dev/null +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/InvalidFieldValueValidationError.java @@ -0,0 +1,98 @@ +/* + * Copyright 2019-present HiveMQ GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.hivemq.api.errors.validation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import org.jetbrains.annotations.NotNull; + +import java.util.Objects; + +public final class InvalidFieldValueValidationError extends ValidationError { + @JsonProperty("field") + private @NotNull String field; + @JsonProperty("value") + private @NotNull String value; + + private InvalidFieldValueValidationError( + final @NotNull String detail, + final @NotNull String field, + final @NotNull String value) { + super(detail); + setField(field); + setValue(value); + } + + public static @NotNull InvalidFieldValueValidationError of( + final @NotNull String detail, + final @NotNull String field, + final @NotNull String value) { + return new InvalidFieldValueValidationError(detail, field, value); + } + + @Override + public @NotNull String toString() { + return "InvalidFieldValueValidationError{" + + "field='" + + field + + '\'' + + ", value='" + + value + + '\'' + + ", detail='" + + detail + + '\'' + + ", type='" + + type + + '\'' + + '}'; + } + + @Override + public boolean equals(final Object o) { + if (o == null || getClass() != o.getClass()) { + return false; + } + if (!super.equals(o)) { + return false; + } + final InvalidFieldValueValidationError that = (InvalidFieldValueValidationError) o; + return Objects.equals(field, that.field) && Objects.equals(value, that.value); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), field, value); + } + + public @NotNull String getValue() { + return value; + } + + public @NotNull InvalidFieldValueValidationError setValue(final @NotNull String value) { + this.value = Objects.requireNonNull(value); + return this; + } + + public @NotNull String getField() { + return field; + } + + public @NotNull InvalidFieldValueValidationError setField(final @NotNull String field) { + this.field = Objects.requireNonNull(field); + return this; + } +} diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/InvalidIdentifierValidationError.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/InvalidIdentifierValidationError.java new file mode 100644 index 0000000000..ac12e06a87 --- /dev/null +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/InvalidIdentifierValidationError.java @@ -0,0 +1,107 @@ +/* + * Copyright 2019-present HiveMQ GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.hivemq.api.errors.validation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import org.jetbrains.annotations.NotNull; + +import java.util.Objects; + +public final class InvalidIdentifierValidationError extends ValidationError { + @JsonProperty("field") + private @NotNull String field; + @JsonProperty("value") + private @NotNull String value; + + private InvalidIdentifierValidationError( + final @NotNull String detail, + final @NotNull String field, + final @NotNull String value) { + super(detail); + setField(field); + setValue(value); + } + + public static @NotNull InvalidIdentifierValidationError of( + final @NotNull String field, + final @NotNull String value) { + return new InvalidIdentifierValidationError("Identifier " + + field + + " must begin with a letter and may only consist of lowercase letters," + + " uppercase letters, numbers, periods, hyphens, and underscores", field, value); + } + + public static @NotNull InvalidIdentifierValidationError of( + final @NotNull String detail, + final @NotNull String field, + final @NotNull String value) { + return new InvalidIdentifierValidationError(detail, field, value); + } + + @Override + public @NotNull String toString() { + return "InvalidIdentifierValidationError{" + + "field='" + + field + + '\'' + + ", value='" + + value + + '\'' + + ", detail='" + + detail + + '\'' + + ", type='" + + type + + '\'' + + '}'; + } + + @Override + public boolean equals(final Object o) { + if (o == null || getClass() != o.getClass()) { + return false; + } + if (!super.equals(o)) { + return false; + } + final InvalidIdentifierValidationError that = (InvalidIdentifierValidationError) o; + return Objects.equals(field, that.field) && Objects.equals(value, that.value); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), field, value); + } + + public @NotNull String getValue() { + return value; + } + + public @NotNull InvalidIdentifierValidationError setValue(final @NotNull String value) { + this.value = Objects.requireNonNull(value); + return this; + } + + public @NotNull String getField() { + return field; + } + + public @NotNull InvalidIdentifierValidationError setField(final @NotNull String field) { + this.field = Objects.requireNonNull(field); + return this; + } +} diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/MissingFieldValidationError.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/MissingFieldValidationError.java new file mode 100644 index 0000000000..03bbbd6b7e --- /dev/null +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/MissingFieldValidationError.java @@ -0,0 +1,81 @@ +/* + * Copyright 2019-present HiveMQ GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.hivemq.api.errors.validation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import org.jetbrains.annotations.NotNull; + +import java.util.Objects; + +public final class MissingFieldValidationError extends ValidationError { + @JsonProperty("field") + private @NotNull String field; + + private MissingFieldValidationError(final @NotNull String detail, @NotNull final String field) { + super(detail); + setField(field); + } + + public static @NotNull MissingFieldValidationError of(final @NotNull String field) { + return new MissingFieldValidationError("Required field '" + field + "' is missing", field); + } + + public static @NotNull MissingFieldValidationError of(final @NotNull String detail, final @NotNull String field) { + return new MissingFieldValidationError(detail, field); + } + + public @NotNull String getField() { + return field; + } + + public @NotNull MissingFieldValidationError setField(@NotNull final String field) { + this.field = Objects.requireNonNull(field); + return this; + } + + @Override + public @NotNull String toString() { + return "MissingFieldValidationError{" + + "field='" + + field + + '\'' + + ", detail='" + + detail + + '\'' + + ", type='" + + type + + '\'' + + '}'; + } + + @Override + public boolean equals(final Object o) { + if (o == null || getClass() != o.getClass()) { + return false; + } + if (!super.equals(o)) { + return false; + } + final MissingFieldValidationError that = (MissingFieldValidationError) o; + return Objects.equals(field, that.field); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), field); + } +} diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/UnsupportedFieldValidationError.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/UnsupportedFieldValidationError.java new file mode 100644 index 0000000000..c703513b3a --- /dev/null +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/UnsupportedFieldValidationError.java @@ -0,0 +1,103 @@ +/* + * Copyright 2019-present HiveMQ GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.hivemq.api.errors.validation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import org.jetbrains.annotations.NotNull; + +import java.util.Objects; + +public final class UnsupportedFieldValidationError extends ValidationError { + @JsonProperty("actualValue") + private @NotNull String actualValue; + @JsonProperty("expectedValue") + private @NotNull String expectedValue; + @JsonProperty("field") + private @NotNull String field; + + private UnsupportedFieldValidationError( + final @NotNull String detail, + final @NotNull String field, + final @NotNull String actualValue, + final @NotNull String expectedValue) { + super(detail); + setActualValue(actualValue); + setExpectedValue(expectedValue); + setField(field); + } + + public static @NotNull UnsupportedFieldValidationError of( + final @NotNull String detail, + final @NotNull String field, + final @NotNull String actualValue, + final @NotNull String expectedValue) { + return new UnsupportedFieldValidationError(detail, field, actualValue, expectedValue); + } + + public static @NotNull UnsupportedFieldValidationError ofType( + final @NotNull String field, + final @NotNull String actualType, + final @NotNull String expectedType) { + return new UnsupportedFieldValidationError("Unsupported type '" + + actualType + + " for field '" + + field + + "'. Expected type is '" + + expectedType + + "'.", field, actualType, expectedType); + } + + public static @NotNull UnsupportedFieldValidationError ofValue( + final @NotNull String field, + final @NotNull String actualValue, + final @NotNull String expectedValue) { + return new UnsupportedFieldValidationError("Unsupported value '" + + actualValue + + " for field '" + + field + + "'. Expected value is '" + + expectedValue + + "'.", field, actualValue, expectedValue); + } + + public @NotNull String getExpectedValue() { + return expectedValue; + } + + public @NotNull UnsupportedFieldValidationError setExpectedValue(@NotNull final String expectedValue) { + this.expectedValue = Objects.requireNonNull(expectedValue); + return this; + } + + public @NotNull String getActualValue() { + return actualValue; + } + + public @NotNull UnsupportedFieldValidationError setActualValue(final @NotNull String actualValue) { + this.actualValue = Objects.requireNonNull(actualValue); + return this; + } + + public @NotNull String getField() { + return field; + } + + public @NotNull UnsupportedFieldValidationError setField(final @NotNull String field) { + this.field = Objects.requireNonNull(field); + return this; + } +} diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/ValidationError.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/ValidationError.java index 445859aacb..e327c34f54 100644 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/ValidationError.java +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/ValidationError.java @@ -1,3 +1,19 @@ +/* + * Copyright 2019-present HiveMQ GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.hivemq.api.errors.validation; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/ValidationErrors.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/ValidationErrors.java index ea8f4267ac..41bb7f9141 100644 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/ValidationErrors.java +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/ValidationErrors.java @@ -1,3 +1,19 @@ +/* + * Copyright 2019-present HiveMQ GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.hivemq.api.errors.validation; import com.fasterxml.jackson.annotation.JsonProperty; From 3bcd582d62808a1ab8b2091e9ffdb1a7812777b8 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Wed, 28 May 2025 10:22:55 +0200 Subject: [PATCH 008/121] refactor: Move DataHub errors --- ext/hivemq-edge-openapi-2025.9.yaml | 82 +++++++++++++ .../AtMostOneFunctionValidationError.java | 92 --------------- .../BehaviorPolicyValidationErrors.java | 66 ----------- .../datahub/DataPolicyValidationErrors.java | 62 ---------- .../FunctionMustBePairedValidationError.java | 75 ------------ .../datahub/GeneralPolicyValidationError.java | 78 ------------- .../InvalidFunctionOrderValidationError.java | 93 --------------- .../UnknownVariableValidationError.java | 110 ------------------ 8 files changed, 82 insertions(+), 576 deletions(-) delete mode 100644 hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/AtMostOneFunctionValidationError.java delete mode 100644 hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/BehaviorPolicyValidationErrors.java delete mode 100644 hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/DataPolicyValidationErrors.java delete mode 100644 hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/FunctionMustBePairedValidationError.java delete mode 100644 hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/GeneralPolicyValidationError.java delete mode 100644 hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/InvalidFunctionOrderValidationError.java delete mode 100644 hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/UnknownVariableValidationError.java diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index ebeba02511..10200dd72f 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -1545,6 +1545,7 @@ paths: - Data Hub - FSM /api/v1/data-hub/functions: get: + deprecated: true description: This endpoints provides the means to get information on the available Functions for the HiveMQ Data Hub. The information is provided in form of a Json Schema. operationId: getFunctions responses: @@ -1704,6 +1705,26 @@ paths: summary: Get all functions as a JSON Schema tags: - Data Hub - Functions + /api/v1/data-hub/function-specs: + get: + description: This endpoints provides the means to get information on the available Functions for the HiveMQ Data Hub. + operationId: getFunctionSpecs + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/FunctionSpecsList' + description: Success + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: Internal server error + summary: Get all functions as a list of function specifications + tags: + - Data Hub - Functions /api/v1/data-hub/schemas: get: description: |- @@ -4998,6 +5019,67 @@ components: - $ref: '#/components/schemas/ValidationErrors' Errors: type: object + BehaviorPolicyTransitionEvent: + type: string + description: Accepted event in transition + enum: + - Event.OnAny + - Connection.OnDisconnect + - Mqtt.OnInboundConnect + - Mqtt.OnInboundDisconnect + - Mqtt.OnInboundPublish + - Mqtt.OnInboundSubscribe + FunctionMetadata: + description: Metadata for operation functions + type: object + properties: + isTerminal: + type: boolean + description: The function is a terminal element of a pipeline + isDataOnly: + type: boolean + description: The function is only available for Data Policies + hasArguments: + type: boolean + description: The function has extra arguments + inLicenseAllowed: + type: boolean + description: The function can be used with the current user's license + supportedEvents: + type: array + items: + $ref: '#/components/schemas/BehaviorPolicyTransitionEvent' + FunctionSpecs: + description: The configuration of a DataHub operation function + type: object + properties: + functionId: + type: string + description: The unique name of the function + metadata: + $ref: '#/components/schemas/FunctionMetadata' + description: The metadata associated with the function + schema: + $ref: '#/components/schemas/JsonNode' + description: the full JSON-Schema describimng the function and its arguments + uiSchema: + $ref: '#/components/schemas/JsonNode' + description: An optional UI Schema to customise the rendering of the configuraton form + required: + - functionId + - metadata + - schema + FunctionSpecsList: + type: object + description: List of function configurations + properties: + items: + type: array + description: List of function configurations + items: + $ref: '#/components/schemas/FunctionSpecs' + required: + - items PolicySchema: type: object properties: diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/AtMostOneFunctionValidationError.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/AtMostOneFunctionValidationError.java deleted file mode 100644 index c4d55c3ac9..0000000000 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/AtMostOneFunctionValidationError.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright 2019-present HiveMQ GmbH - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.hivemq.api.errors.datahub; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.hivemq.api.errors.validation.ValidationError; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -public final class AtMostOneFunctionValidationError extends ValidationError { - @JsonProperty("paths") - private final @NotNull List paths; - @JsonProperty("function") - private @NotNull String function; - @JsonProperty("occurrences") - private int occurrences; - - private AtMostOneFunctionValidationError( - final @NotNull String detail, - final @NotNull String function, - final int occurrences, - final @Nullable List paths) { - super(detail); - setFunction(function); - setOccurrences(occurrences); - this.paths = new ArrayList<>(); - if (paths != null && !paths.isEmpty()) { - this.paths.addAll(paths); - } - } - - public static @NotNull AtMostOneFunctionValidationError of( - final @NotNull String function, - final int occurrences, - final @Nullable List paths) { - return new AtMostOneFunctionValidationError("The pipeline must contain at most one '" + - function + - "' function, but " + - occurrences + - " were found at " + - paths + - ".", function, occurrences, paths); - } - - public static @NotNull AtMostOneFunctionValidationError of( - final @NotNull String detail, - final @NotNull String function, - final int occurrences, - final @Nullable List paths) { - return new AtMostOneFunctionValidationError(detail, function, occurrences, paths); - } - - public int getOccurrences() { - return occurrences; - } - - public @NotNull AtMostOneFunctionValidationError setOccurrences(final int occurrences) { - this.occurrences = occurrences; - return this; - } - - public @NotNull List getPaths() { - return paths; - } - - public @NotNull String getFunction() { - return function; - } - - public @NotNull AtMostOneFunctionValidationError setFunction(@NotNull final String function) { - this.function = Objects.requireNonNull(function); - return this; - } -} diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/BehaviorPolicyValidationErrors.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/BehaviorPolicyValidationErrors.java deleted file mode 100644 index 8de7127e63..0000000000 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/BehaviorPolicyValidationErrors.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 2019-present HiveMQ GmbH - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.hivemq.api.errors.datahub; - -import com.hivemq.api.errors.validation.ValidationError; -import com.hivemq.api.errors.validation.ValidationErrors; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import java.util.List; - -public final class BehaviorPolicyValidationErrors extends ValidationErrors { - private BehaviorPolicyValidationErrors( - final @NotNull String title, - final @Nullable String detail, - final @Nullable List> errors, - final int status, - final @Nullable String code) { - super(title, detail, errors, status, code); - } - - public static BehaviorPolicyValidationErrors of( - final @Nullable List> errors) { - return new BehaviorPolicyValidationErrors("Behavior policy is invalid", - "Behavior policy is invalid", - errors, - 400, - null); - } - - @Override - public @NotNull String toString() { - return "BahaviorPolicyValidationErrors{" + - "errors=" + - errors + - ", code='" + - code + - '\'' + - ", detail='" + - detail + - '\'' + - ", status=" + - status + - ", title='" + - title + - '\'' + - ", type='" + - type + - '\'' + - '}'; - } -} diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/DataPolicyValidationErrors.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/DataPolicyValidationErrors.java deleted file mode 100644 index 4768a0be97..0000000000 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/DataPolicyValidationErrors.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2019-present HiveMQ GmbH - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.hivemq.api.errors.datahub; - -import com.hivemq.api.errors.validation.ValidationError; -import com.hivemq.api.errors.validation.ValidationErrors; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import java.util.List; - -public final class DataPolicyValidationErrors extends ValidationErrors { - private DataPolicyValidationErrors( - final @NotNull String title, - final @Nullable String detail, - final @Nullable List> errors, - final int status, - final @Nullable String code) { - super(title, detail, errors, status, code); - } - - public static DataPolicyValidationErrors of( - final @Nullable List> errors) { - return new DataPolicyValidationErrors("Data policy is invalid", "Data policy is invalid", errors, 400, null); - } - - @Override - public @NotNull String toString() { - return "DataPolicyValidationErrors{" + - "errors=" + - errors + - ", code='" + - code + - '\'' + - ", detail='" + - detail + - '\'' + - ", status=" + - status + - ", title='" + - title + - '\'' + - ", type='" + - type + - '\'' + - '}'; - } -} diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/FunctionMustBePairedValidationError.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/FunctionMustBePairedValidationError.java deleted file mode 100644 index d9263d724c..0000000000 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/FunctionMustBePairedValidationError.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2019-present HiveMQ GmbH - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.hivemq.api.errors.datahub; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.hivemq.api.errors.validation.ValidationError; -import org.jetbrains.annotations.NotNull; - -import java.util.Objects; - -public final class FunctionMustBePairedValidationError extends ValidationError { - @JsonProperty("existingFunction") - private @NotNull String existingFunction; - - @JsonProperty("missingFunction") - private @NotNull String missingFunction; - - private FunctionMustBePairedValidationError( - final @NotNull String detail, - final @NotNull String existingFunction, - final @NotNull String missingFunction) { - super(detail); - setExistingFunction(existingFunction); - setMissingFunction(missingFunction); - } - - public static @NotNull FunctionMustBePairedValidationError of( - final @NotNull String existingFunction, - final @NotNull String missingFunction) { - return new FunctionMustBePairedValidationError("If '" + - existingFunction + - "' function is present in the pipeline, '" + - missingFunction + - "' function must be present as well.", existingFunction, missingFunction); - } - - public static @NotNull FunctionMustBePairedValidationError of( - final @NotNull String detail, - final @NotNull String existingFunction, - final @NotNull String missingFunction) { - return new FunctionMustBePairedValidationError(detail, existingFunction, missingFunction); - } - - public @NotNull String getMissingFunction() { - return missingFunction; - } - - public @NotNull FunctionMustBePairedValidationError setMissingFunction(@NotNull final String missingFunction) { - this.missingFunction = Objects.requireNonNull(missingFunction); - return this; - } - - public @NotNull String getExistingFunction() { - return existingFunction; - } - - public @NotNull FunctionMustBePairedValidationError setExistingFunction(@NotNull final String existingFunction) { - this.existingFunction = Objects.requireNonNull(existingFunction); - return this; - } -} diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/GeneralPolicyValidationError.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/GeneralPolicyValidationError.java deleted file mode 100644 index 2f7eeeb902..0000000000 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/GeneralPolicyValidationError.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright 2019-present HiveMQ GmbH - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.hivemq.api.errors.datahub; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.hivemq.api.errors.validation.ValidationError; -import org.jetbrains.annotations.NotNull; - -import java.util.Objects; - -public final class GeneralPolicyValidationError extends ValidationError { - @JsonProperty("title") - private @NotNull String title; - - private GeneralPolicyValidationError(final @NotNull String detail, final @NotNull String title) { - super(detail); - setTitle(title); - } - - public static @NotNull GeneralPolicyValidationError of(final @NotNull String detail, final @NotNull String title) { - return new GeneralPolicyValidationError(detail, title); - } - - public @NotNull String getTitle() { - return title; - } - - public @NotNull GeneralPolicyValidationError setTitle(@NotNull final String title) { - this.title = Objects.requireNonNull(title); - return this; - } - - @Override - public @NotNull String toString() { - return "GeneralPolicyValidationError{" + - "title='" + - title + - '\'' + - ", detail='" + - detail + - '\'' + - ", type='" + - type + - '\'' + - '}'; - } - - @Override - public boolean equals(final Object o) { - if (o == null || getClass() != o.getClass()) { - return false; - } - if (!super.equals(o)) { - return false; - } - final GeneralPolicyValidationError that = (GeneralPolicyValidationError) o; - return Objects.equals(title, that.title); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), title); - } -} diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/InvalidFunctionOrderValidationError.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/InvalidFunctionOrderValidationError.java deleted file mode 100644 index e95d2a486d..0000000000 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/InvalidFunctionOrderValidationError.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright 2019-present HiveMQ GmbH - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.hivemq.api.errors.datahub; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.hivemq.api.errors.validation.ValidationError; -import org.jetbrains.annotations.NotNull; - -import java.util.Objects; - -public final class InvalidFunctionOrderValidationError extends ValidationError { - @JsonProperty("field") - private @NotNull String field; - - @JsonProperty("function") - private @NotNull String function; - - @JsonProperty("previousFunction") - private @NotNull String previousFunction; - - private InvalidFunctionOrderValidationError( - final @NotNull String detail, - final @NotNull String field, - final @NotNull String function, - final @NotNull String previousFunction) { - super(detail); - setField(field); - setFunction(function); - setPreviousFunction(previousFunction); - } - - public static @NotNull InvalidFunctionOrderValidationError of( - final @NotNull String field, - final @NotNull String function, - final @NotNull String previousFunction) { - return new InvalidFunctionOrderValidationError("The operation at '" + - field + - "' with the functionId '" + - function + - "' must be after a '" + - previousFunction + - "' operation.", field, function, previousFunction); - } - - public static @NotNull InvalidFunctionOrderValidationError of( - final @NotNull String detail, - final @NotNull String field, - final @NotNull String function, - final @NotNull String previousFunction) { - return new InvalidFunctionOrderValidationError(detail, field, function, previousFunction); - } - - public @NotNull String getField() { - return field; - } - - public @NotNull InvalidFunctionOrderValidationError setField(@NotNull final String field) { - this.field = Objects.requireNonNull(field); - return this; - } - - public @NotNull String getPreviousFunction() { - return previousFunction; - } - - public @NotNull InvalidFunctionOrderValidationError setPreviousFunction(@NotNull final String previousFunction) { - this.previousFunction = Objects.requireNonNull(previousFunction); - return this; - } - - public @NotNull String getFunction() { - return function; - } - - public @NotNull InvalidFunctionOrderValidationError setFunction(@NotNull final String function) { - this.function = Objects.requireNonNull(function); - return this; - } -} diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/UnknownVariableValidationError.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/UnknownVariableValidationError.java deleted file mode 100644 index 2516504991..0000000000 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/datahub/UnknownVariableValidationError.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright 2019-present HiveMQ GmbH - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.hivemq.api.errors.datahub; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.hivemq.api.errors.validation.ValidationError; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -public final class UnknownVariableValidationError extends ValidationError { - @JsonProperty("variables") - private final @NotNull List variables; - - @JsonProperty("field") - private @NotNull String field; - - private UnknownVariableValidationError( - final @NotNull String detail, - final @NotNull String field, - final @Nullable List variables) { - super(detail); - setField(field); - this.variables = new ArrayList<>(); - if (variables != null && !variables.isEmpty()) { - this.variables.addAll(variables); - } - } - - public static @NotNull UnknownVariableValidationError of( - final @NotNull String field, - final @Nullable List variables) { - return new UnknownVariableValidationError("Field '" + - field + - "' contains unknown variables: [" + - variables + - "].", field, variables); - } - - public static @NotNull UnknownVariableValidationError of( - final @NotNull String detail, - final @NotNull String field, - final @Nullable List variables) { - return new UnknownVariableValidationError(detail, field, variables); - } - - public @NotNull String getField() { - return field; - } - - public @NotNull UnknownVariableValidationError setField(@NotNull final String field) { - this.field = Objects.requireNonNull(field); - return this; - } - - @Override - public @NotNull String toString() { - return "UnknownVariableValidationError{" + - "variables=" + - variables + - ", field='" + - field + - '\'' + - ", detail='" + - detail + - '\'' + - ", type='" + - type + - '\'' + - '}'; - } - - @Override - public boolean equals(final Object o) { - if (o == null || getClass() != o.getClass()) { - return false; - } - if (!super.equals(o)) { - return false; - } - final UnknownVariableValidationError that = (UnknownVariableValidationError) o; - return Objects.equals(variables, that.variables) && Objects.equals(field, that.field); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), variables, field); - } - - public @NotNull List getVariables() { - return variables; - } -} From 300b7135913acdf183460c692e30c447ac6ae729 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Wed, 28 May 2025 14:19:18 +0200 Subject: [PATCH 009/121] feat: Add more common errors --- ext/hivemq-edge-openapi-2025.9.yaml | 85 +++++++++++++-- .../common/InsufficientStorageError.yaml | 7 ++ .../errors/common/InternalServerError.yaml | 7 ++ .../common/UrlParameterMissingError.yaml | 9 ++ .../DataPolicyAlreadyPresentError.yaml | 9 ++ .../DataPolicyCreationFailureError.yaml | 9 ++ .../datahub/DataPolicyRejectedError.yaml | 2 + .../errors/datahub/PolicyIdMismatchError.yaml | 13 +++ ..._v1_data-hub_data-validation_policies.yaml | 10 +- ...b_data-validation_policies_{policyId}.yaml | 12 ++- .../common/InsufficientStorageError.java | 100 ++++++++++++++++++ .../errors/common/InternalServerError.java | 100 ++++++++++++++++++ .../common/TemporaryNotAvailableError.java | 18 ++-- .../common/UrlParameterMissingError.java | 56 ++++++++++ 14 files changed, 416 insertions(+), 21 deletions(-) create mode 100644 ext/openAPI/components/schemas/errors/common/InsufficientStorageError.yaml create mode 100644 ext/openAPI/components/schemas/errors/common/InternalServerError.yaml create mode 100644 ext/openAPI/components/schemas/errors/common/UrlParameterMissingError.yaml create mode 100644 ext/openAPI/components/schemas/errors/datahub/DataPolicyAlreadyPresentError.yaml create mode 100644 ext/openAPI/components/schemas/errors/datahub/DataPolicyCreationFailureError.yaml create mode 100644 ext/openAPI/components/schemas/errors/datahub/DataPolicyRejectedError.yaml create mode 100644 ext/openAPI/components/schemas/errors/datahub/PolicyIdMismatchError.yaml create mode 100644 hivemq-edge/src/main/java/com/hivemq/api/errors/common/InsufficientStorageError.java create mode 100644 hivemq-edge/src/main/java/com/hivemq/api/errors/common/InternalServerError.java create mode 100644 hivemq-edge/src/main/java/com/hivemq/api/errors/common/UrlParameterMissingError.java diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index 10200dd72f..d45201c02e 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -1155,20 +1155,24 @@ paths: application/json: schema: anyOf: + - $ref: '#/components/schemas/InternalServerError' - $ref: '#/components/schemas/RequestBodyMissingError' + - $ref: '#/components/schemas/DataPolicyCreationFailureError' + - $ref: '#/components/schemas/DataPolicyRejectedError' - $ref: '#/components/schemas/DataPolicyValidationErrors' description: DataPolicy creation failed '409': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + anyOf: + - $ref: '#/components/schemas/DataPolicyAlreadyPresentError' description: DataPolicy already present '500': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: @@ -1180,7 +1184,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InsufficientStorageError' description: Insufficient storage summary: Create a new data policy tags: @@ -1426,7 +1430,11 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + anyOf: + - $ref: '#/components/schemas/RequestBodyMissingError' + - $ref: '#/components/schemas/UrlParameterMissingError' + - $ref: '#/components/schemas/DataPolicyValidationErrors' + - $ref: '#/components/schemas/PolicyIdMismatchError' description: DataPolicy creation failed '404': content: @@ -1438,19 +1446,19 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable '507': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InsufficientStorageError' description: Insufficient storage summary: Update an existing data policy tags: @@ -5014,9 +5022,72 @@ components: description: List of result items that are returned by this endpoint items: $ref: '#/components/schemas/DataPolicy' + InternalServerError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + reason: + type: string + description: The actual reason. + DataPolicyCreationFailureError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + reason: + type: string + description: The actual reason. + required: + - reason + DataPolicyRejectedError: + allOf: + - $ref: '#/components/schemas/ApiError' DataPolicyValidationErrors: allOf: - $ref: '#/components/schemas/ValidationErrors' + DataPolicyAlreadyPresentError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The policy id. + required: + - id + InsufficientStorageError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + reason: + type: string + description: The actual reason. + UrlParameterMissingError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + parameter: + type: string + description: The name of the missing parameter. + required: + - parameter + PolicyIdMismatchError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + actualId: + type: string + description: The actual id. + expectedId: + type: string + description: The expected id. + required: + - actualId + - expectedId Errors: type: object BehaviorPolicyTransitionEvent: diff --git a/ext/openAPI/components/schemas/errors/common/InsufficientStorageError.yaml b/ext/openAPI/components/schemas/errors/common/InsufficientStorageError.yaml new file mode 100644 index 0000000000..10ec6cc097 --- /dev/null +++ b/ext/openAPI/components/schemas/errors/common/InsufficientStorageError.yaml @@ -0,0 +1,7 @@ +allOf: + - $ref: "../ApiError.yaml" + - type: object + properties: + reason: + type: string + description: The actual reason. diff --git a/ext/openAPI/components/schemas/errors/common/InternalServerError.yaml b/ext/openAPI/components/schemas/errors/common/InternalServerError.yaml new file mode 100644 index 0000000000..10ec6cc097 --- /dev/null +++ b/ext/openAPI/components/schemas/errors/common/InternalServerError.yaml @@ -0,0 +1,7 @@ +allOf: + - $ref: "../ApiError.yaml" + - type: object + properties: + reason: + type: string + description: The actual reason. diff --git a/ext/openAPI/components/schemas/errors/common/UrlParameterMissingError.yaml b/ext/openAPI/components/schemas/errors/common/UrlParameterMissingError.yaml new file mode 100644 index 0000000000..7a9c0e2836 --- /dev/null +++ b/ext/openAPI/components/schemas/errors/common/UrlParameterMissingError.yaml @@ -0,0 +1,9 @@ +allOf: + - $ref: "../ApiError.yaml" + - type: object + properties: + parameter: + type: string + description: The name of the missing parameter. + required: + - parameter diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyAlreadyPresentError.yaml b/ext/openAPI/components/schemas/errors/datahub/DataPolicyAlreadyPresentError.yaml new file mode 100644 index 0000000000..229810520b --- /dev/null +++ b/ext/openAPI/components/schemas/errors/datahub/DataPolicyAlreadyPresentError.yaml @@ -0,0 +1,9 @@ +allOf: + - $ref: "../ApiError.yaml" + - type: object + properties: + id: + type: string + description: The policy id. + required: + - id diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyCreationFailureError.yaml b/ext/openAPI/components/schemas/errors/datahub/DataPolicyCreationFailureError.yaml new file mode 100644 index 0000000000..ea854eb9cc --- /dev/null +++ b/ext/openAPI/components/schemas/errors/datahub/DataPolicyCreationFailureError.yaml @@ -0,0 +1,9 @@ +allOf: + - $ref: "../ApiError.yaml" + - type: object + properties: + reason: + type: string + description: The actual reason. + required: + - reason diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyRejectedError.yaml b/ext/openAPI/components/schemas/errors/datahub/DataPolicyRejectedError.yaml new file mode 100644 index 0000000000..1e5857dabc --- /dev/null +++ b/ext/openAPI/components/schemas/errors/datahub/DataPolicyRejectedError.yaml @@ -0,0 +1,2 @@ +allOf: + - $ref: "../ApiError.yaml" diff --git a/ext/openAPI/components/schemas/errors/datahub/PolicyIdMismatchError.yaml b/ext/openAPI/components/schemas/errors/datahub/PolicyIdMismatchError.yaml new file mode 100644 index 0000000000..bddc51a565 --- /dev/null +++ b/ext/openAPI/components/schemas/errors/datahub/PolicyIdMismatchError.yaml @@ -0,0 +1,13 @@ +allOf: + - $ref: "../ApiError.yaml" + - type: object + properties: + actualId: + type: string + description: The actual id. + expectedId: + type: string + description: The expected id. + required: + - actualId + - expectedId diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml index d166cd521d..58e0ae08fa 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml @@ -400,20 +400,24 @@ post: application/json: schema: anyOf: + - $ref: "../components/schemas/errors/common/InternalServerError.yaml" - $ref: "../components/schemas/errors/common/RequestBodyMissingError.yaml" + - $ref: "../components/schemas/errors/datahub/DataPolicyCreationFailureError.yaml" + - $ref: "../components/schemas/errors/datahub/DataPolicyRejectedError.yaml" - $ref: "../components/schemas/errors/datahub/DataPolicyValidationErrors.yaml" description: DataPolicy creation failed '409': content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml + anyOf: + - $ref: "../components/schemas/errors/datahub/DataPolicyAlreadyPresentError.yaml" description: DataPolicy already present '500': content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml + $ref: "../components/schemas/errors/common/InternalServerError.yaml" description: Internal server error '503': content: @@ -425,7 +429,7 @@ post: content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml + $ref: "../components/schemas/errors/common/InsufficientStorageError.yaml" description: Insufficient storage summary: Create a new data policy tags: diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml index 9b83209505..ca7566869a 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml @@ -255,7 +255,11 @@ put: content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml + anyOf: + - $ref: "../components/schemas/errors/common/RequestBodyMissingError.yaml" + - $ref: "../components/schemas/errors/common/UrlParameterMissingError.yaml" + - $ref: "../components/schemas/errors/datahub/DataPolicyValidationErrors.yaml" + - $ref: "../components/schemas/errors/datahub/PolicyIdMismatchError.yaml" description: DataPolicy creation failed '404': content: @@ -267,19 +271,19 @@ put: content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml + $ref: "../components/schemas/errors/common/InternalServerError.yaml" description: Internal server error '503': content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml + $ref: "../components/schemas/errors/common/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable '507': content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml + $ref: "../components/schemas/errors/common/InsufficientStorageError.yaml" description: Insufficient storage summary: Update an existing data policy tags: diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/common/InsufficientStorageError.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/common/InsufficientStorageError.java new file mode 100644 index 0000000000..9bf301176f --- /dev/null +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/common/InsufficientStorageError.java @@ -0,0 +1,100 @@ +/* + * Copyright 2019-present HiveMQ GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.hivemq.api.errors.common; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.hivemq.api.errors.ApiError; +import com.hivemq.http.HttpStatus; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.Objects; + +public final class InsufficientStorageError extends ApiError { + @JsonProperty("reason") + private @Nullable String reason; + + private InsufficientStorageError( + final @NotNull String title, + final @Nullable String detail, + final @Nullable String reason, + final int status, + final @Nullable String code) { + super(title, detail, status, code); + setReason(reason); + } + + public static InsufficientStorageError of() { + return of(null); + } + + public static InsufficientStorageError of(final @Nullable String reason) { + return new InsufficientStorageError("Insufficient Storage", + reason == null ? "Insufficient Storage." : "Insufficient Storage: " + reason, + reason, + HttpStatus.INSUFFICIENT_STORAGE_507, + null); + } + + @Override + public @NotNull String toString() { + return "InternalServerError{" + + "reason='" + + reason + + '\'' + + ", code='" + + code + + '\'' + + ", detail='" + + detail + + '\'' + + ", status=" + + status + + ", title='" + + title + + '\'' + + ", type='" + + type + + '\'' + + '}'; + } + + @Override + public boolean equals(final Object o) { + if (o == null || getClass() != o.getClass()) { + return false; + } + if (!super.equals(o)) { + return false; + } + final InsufficientStorageError that = (InsufficientStorageError) o; + return Objects.equals(reason, that.reason); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), reason); + } + + public @Nullable String getReason() { + return reason; + } + + public @NotNull InsufficientStorageError setReason(final @Nullable String reason) { + this.reason = reason; + return this; + } +} diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/common/InternalServerError.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/common/InternalServerError.java new file mode 100644 index 0000000000..818bb155fc --- /dev/null +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/common/InternalServerError.java @@ -0,0 +1,100 @@ +/* + * Copyright 2019-present HiveMQ GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.hivemq.api.errors.common; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.hivemq.api.errors.ApiError; +import com.hivemq.http.HttpStatus; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.Objects; + +public final class InternalServerError extends ApiError { + @JsonProperty("reason") + private @Nullable String reason; + + private InternalServerError( + final @NotNull String title, + final @Nullable String detail, + final @Nullable String reason, + final int status, + final @Nullable String code) { + super(title, detail, status, code); + setReason(reason); + } + + public static InternalServerError of() { + return of(null); + } + + public static InternalServerError of(final @Nullable String reason) { + return new InternalServerError("InternalError", + reason == null ? "An unexpected error occurred, check the logs." : reason, + reason, + HttpStatus.INTERNAL_SERVER_ERROR_500, + null); + } + + @Override + public @NotNull String toString() { + return "InternalServerError{" + + "reason='" + + reason + + '\'' + + ", code='" + + code + + '\'' + + ", detail='" + + detail + + '\'' + + ", status=" + + status + + ", title='" + + title + + '\'' + + ", type='" + + type + + '\'' + + '}'; + } + + @Override + public boolean equals(final Object o) { + if (o == null || getClass() != o.getClass()) { + return false; + } + if (!super.equals(o)) { + return false; + } + final InternalServerError that = (InternalServerError) o; + return Objects.equals(reason, that.reason); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), reason); + } + + public @Nullable String getReason() { + return reason; + } + + public @NotNull InternalServerError setReason(final @Nullable String reason) { + this.reason = reason; + return this; + } +} diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/common/TemporaryNotAvailableError.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/common/TemporaryNotAvailableError.java index a394de854a..afe00a99b4 100644 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/common/TemporaryNotAvailableError.java +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/common/TemporaryNotAvailableError.java @@ -19,18 +19,22 @@ import com.hivemq.api.errors.ApiError; import com.hivemq.http.HttpStatus; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; public final class TemporaryNotAvailableError extends ApiError { - private TemporaryNotAvailableError() { - super("errors/common/TemporaryNotAvailableError", - "The endpoint is temporarily not available", - "The endpoint is temporarily not available, please try again later", - HttpStatus.SERVICE_UNAVAILABLE_503, - null); + private TemporaryNotAvailableError( + final @NotNull String title, + final @Nullable String detail, + final int status, + final @Nullable String code) { + super(title, detail, status, code); } public static TemporaryNotAvailableError of() { - return new TemporaryNotAvailableError(); + return new TemporaryNotAvailableError("The endpoint is temporarily not available", + "The endpoint is temporarily not available, please try again later", + HttpStatus.SERVICE_UNAVAILABLE_503, + null); } @Override diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/common/UrlParameterMissingError.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/common/UrlParameterMissingError.java new file mode 100644 index 0000000000..50aabe768f --- /dev/null +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/common/UrlParameterMissingError.java @@ -0,0 +1,56 @@ +/* + * Copyright 2019-present HiveMQ GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.hivemq.api.errors.common; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.hivemq.api.errors.ApiError; +import com.hivemq.http.HttpStatus; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.Objects; + +public final class UrlParameterMissingError extends ApiError { + @JsonProperty("parameter") + private @NotNull String parameter; + + private UrlParameterMissingError( + final @NotNull String title, + final @Nullable String detail, + final @NotNull String parameter, + final int status, + final @Nullable String code) { + super(title, detail, status, code); + setParameter(parameter); + } + + public static UrlParameterMissingError of(final @NotNull String parameter) { + return new UrlParameterMissingError("Required url parameter missing", + "Required url parameter '" + parameter + "' missing", + parameter, + HttpStatus.BAD_REQUEST_400, + null); + } + + public @NotNull String getParameter() { + return parameter; + } + + public @NotNull UrlParameterMissingError setParameter(@NotNull final String parameter) { + this.parameter = Objects.requireNonNull(parameter); + return this; + } +} From d23fde2a1c330b18d4341189e829f06317667dab Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Wed, 28 May 2025 16:48:34 +0200 Subject: [PATCH 010/121] refactor: Replace common errors with generated ones --- ext/hivemq-edge-openapi-2025.9.yaml | 128 ++++++++++++++---- .../components/schemas/errors/ApiError.yaml | 2 + .../common/InsufficientStorageError.yaml | 2 + .../errors/common/InternalServerError.yaml | 2 + .../common/InvalidQueryParameterError.yaml | 15 ++ .../common/PreconditionFailedError.yaml | 11 ++ .../common/RequestBodyMissingError.yaml | 6 +- .../common/TemporaryNotAvailableError.yaml | 2 + .../common/UrlParameterMissingError.yaml | 2 + .../AtMostOneFunctionValidationError.yaml | 3 +- .../BehaviorPolicyValidationErrors.yaml | 2 + .../DataPolicyAlreadyPresentError.yaml | 2 + .../DataPolicyCreationFailureError.yaml | 2 + .../datahub/DataPolicyRejectedError.yaml | 2 + .../datahub/DataPolicyValidationErrors.yaml | 2 + .../errors/datahub/PolicyIdMismatchError.yaml | 2 + .../errors/datahub/PolicyNotFoundError.yaml | 11 ++ .../InvalidFieldLengthValidationError.yaml | 3 + .../errors/validation/ValidationErrors.yaml | 2 + ..._v1_data-hub_data-validation_policies.yaml | 18 +-- ...b_data-validation_policies_{policyId}.yaml | 30 +++- .../hivemq/api/errors/CommonErrorFactory.java | 128 ++++++++++++++++++ .../com/hivemq/api/errors/OpenApiError.java | 44 ++++++ .../common/InsufficientStorageError.java | 100 -------------- .../errors/common/InternalServerError.java | 100 -------------- .../common/RequestBodyMissingError.java | 99 -------------- .../common/TemporaryNotAvailableError.java | 59 -------- .../common/UrlParameterMissingError.java | 56 -------- .../com/hivemq/util/ErrorResponseUtil.java | 8 ++ 29 files changed, 377 insertions(+), 466 deletions(-) create mode 100644 ext/openAPI/components/schemas/errors/common/InvalidQueryParameterError.yaml create mode 100644 ext/openAPI/components/schemas/errors/common/PreconditionFailedError.yaml create mode 100644 ext/openAPI/components/schemas/errors/datahub/PolicyNotFoundError.yaml create mode 100644 hivemq-edge/src/main/java/com/hivemq/api/errors/CommonErrorFactory.java create mode 100644 hivemq-edge/src/main/java/com/hivemq/api/errors/OpenApiError.java delete mode 100644 hivemq-edge/src/main/java/com/hivemq/api/errors/common/InsufficientStorageError.java delete mode 100644 hivemq-edge/src/main/java/com/hivemq/api/errors/common/InternalServerError.java delete mode 100644 hivemq-edge/src/main/java/com/hivemq/api/errors/common/RequestBodyMissingError.java delete mode 100644 hivemq-edge/src/main/java/com/hivemq/api/errors/common/TemporaryNotAvailableError.java delete mode 100644 hivemq-edge/src/main/java/com/hivemq/api/errors/common/UrlParameterMissingError.java diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index d45201c02e..411ad58b91 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -1050,25 +1050,14 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + anyOf: + - $ref: '#/components/schemas/InvalidQueryParameterError' description: URL parameter missing - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/ProblemDetails' - description: DataPolicy not found - '500': - content: - application/json: - schema: - $ref: '#/components/schemas/ProblemDetails' - description: Internal server error '503': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable summary: Get all data policies tags: @@ -1155,7 +1144,6 @@ paths: application/json: schema: anyOf: - - $ref: '#/components/schemas/InternalServerError' - $ref: '#/components/schemas/RequestBodyMissingError' - $ref: '#/components/schemas/DataPolicyCreationFailureError' - $ref: '#/components/schemas/DataPolicyRejectedError' @@ -1217,25 +1205,27 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + anyOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + - $ref: '#/components/schemas/PolicyNotFoundError' description: URL parameter missing - '404': + '412': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: DataPolicy not found + $ref: '#/components/schemas/PreconditionFailedError' + description: Internal server error '500': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable summary: Delete a data policy tags: @@ -1313,7 +1303,9 @@ paths: - title: Required parameter missing detail: Required URL parameter 'parameterName' is missing schema: - $ref: '#/components/schemas/ProblemDetails' + anyOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + - $ref: '#/components/schemas/PolicyNotFoundError' description: Bad request '404': content: @@ -1329,6 +1321,18 @@ paths: schema: $ref: '#/components/schemas/ProblemDetails' description: Resource not found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerError' + description: Internal server error + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Get a data policy tags: - Data Hub - Data Policies @@ -4660,6 +4664,8 @@ components: $ref: '#/components/schemas/BehaviorPolicy' ApiError: type: object + x-implements: + - com.hivemq.api.errors.OpenApiError properties: code: type: string @@ -4683,13 +4689,15 @@ components: - status - type RequestBodyMissingError: + x-implements: + - com.hivemq.api.errors.OpenApiError allOf: - $ref: '#/components/schemas/ApiError' - type: object properties: - parameterName: + parameter: type: string - description: The name of the missing request body parameter. + description: The the missing request body parameter. ValidationError: type: object properties: @@ -4719,12 +4727,15 @@ components: properties: actualLength: type: integer + format: int32 description: The actual length of the field value. expectedMinimumLength: type: integer + format: int32 description: The minimum length expected for the field value. expectedMaximumLength: type: integer + format: int32 description: The maximum length expected for the field value. field: type: string @@ -4803,7 +4814,8 @@ components: type: string description: The function. occurrences: - type: int + type: integer + format: int32 description: The occurrences of the function. paths: type: array @@ -4873,6 +4885,8 @@ components: - field - variables ValidationErrors: + x-implements: + - com.hivemq.api.errors.OpenApiError allOf: - $ref: '#/components/schemas/ApiError' - type: object @@ -4896,9 +4910,13 @@ components: required: - errors BehaviorPolicyValidationErrors: + x-implements: + - com.hivemq.api.errors.OpenApiError allOf: - $ref: '#/components/schemas/ValidationErrors' TemporaryNotAvailableError: + x-implements: + - com.hivemq.api.errors.OpenApiError allOf: - $ref: '#/components/schemas/ApiError' JsonNode: @@ -5022,15 +5040,25 @@ components: description: List of result items that are returned by this endpoint items: $ref: '#/components/schemas/DataPolicy' - InternalServerError: + InvalidQueryParameterError: + x-implements: + - com.hivemq.api.errors.OpenApiError allOf: - $ref: '#/components/schemas/ApiError' - type: object properties: + parameter: + type: string + description: The query parameter. reason: type: string - description: The actual reason. + description: The reason. + required: + - parameter + - reason DataPolicyCreationFailureError: + x-implements: + - com.hivemq.api.errors.OpenApiError allOf: - $ref: '#/components/schemas/ApiError' - type: object @@ -5041,12 +5069,18 @@ components: required: - reason DataPolicyRejectedError: + x-implements: + - com.hivemq.api.errors.OpenApiError allOf: - $ref: '#/components/schemas/ApiError' DataPolicyValidationErrors: + x-implements: + - com.hivemq.api.errors.OpenApiError allOf: - $ref: '#/components/schemas/ValidationErrors' DataPolicyAlreadyPresentError: + x-implements: + - com.hivemq.api.errors.OpenApiError allOf: - $ref: '#/components/schemas/ApiError' - type: object @@ -5056,7 +5090,19 @@ components: description: The policy id. required: - id + InternalServerError: + x-implements: + - com.hivemq.api.errors.OpenApiError + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + reason: + type: string + description: The actual reason. InsufficientStorageError: + x-implements: + - com.hivemq.api.errors.OpenApiError allOf: - $ref: '#/components/schemas/ApiError' - type: object @@ -5065,6 +5111,8 @@ components: type: string description: The actual reason. UrlParameterMissingError: + x-implements: + - com.hivemq.api.errors.OpenApiError allOf: - $ref: '#/components/schemas/ApiError' - type: object @@ -5074,7 +5122,21 @@ components: description: The name of the missing parameter. required: - parameter + PolicyNotFoundError: + x-implements: + - com.hivemq.api.errors.OpenApiError + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The policy id. + required: + - id PolicyIdMismatchError: + x-implements: + - com.hivemq.api.errors.OpenApiError allOf: - $ref: '#/components/schemas/ApiError' - type: object @@ -5088,6 +5150,18 @@ components: required: - actualId - expectedId + PreconditionFailedError: + x-implements: + - com.hivemq.api.errors.OpenApiError + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + reason: + type: string + description: The actual reason. + required: + - reason Errors: type: object BehaviorPolicyTransitionEvent: diff --git a/ext/openAPI/components/schemas/errors/ApiError.yaml b/ext/openAPI/components/schemas/errors/ApiError.yaml index c2d9a79b32..d1a9c0f705 100644 --- a/ext/openAPI/components/schemas/errors/ApiError.yaml +++ b/ext/openAPI/components/schemas/errors/ApiError.yaml @@ -1,4 +1,6 @@ type: object +x-implements: + - com.hivemq.api.errors.OpenApiError properties: code: type: string diff --git a/ext/openAPI/components/schemas/errors/common/InsufficientStorageError.yaml b/ext/openAPI/components/schemas/errors/common/InsufficientStorageError.yaml index 10ec6cc097..0776b7f456 100644 --- a/ext/openAPI/components/schemas/errors/common/InsufficientStorageError.yaml +++ b/ext/openAPI/components/schemas/errors/common/InsufficientStorageError.yaml @@ -1,3 +1,5 @@ +x-implements: + - com.hivemq.api.errors.OpenApiError allOf: - $ref: "../ApiError.yaml" - type: object diff --git a/ext/openAPI/components/schemas/errors/common/InternalServerError.yaml b/ext/openAPI/components/schemas/errors/common/InternalServerError.yaml index 10ec6cc097..0776b7f456 100644 --- a/ext/openAPI/components/schemas/errors/common/InternalServerError.yaml +++ b/ext/openAPI/components/schemas/errors/common/InternalServerError.yaml @@ -1,3 +1,5 @@ +x-implements: + - com.hivemq.api.errors.OpenApiError allOf: - $ref: "../ApiError.yaml" - type: object diff --git a/ext/openAPI/components/schemas/errors/common/InvalidQueryParameterError.yaml b/ext/openAPI/components/schemas/errors/common/InvalidQueryParameterError.yaml new file mode 100644 index 0000000000..eb973b62fc --- /dev/null +++ b/ext/openAPI/components/schemas/errors/common/InvalidQueryParameterError.yaml @@ -0,0 +1,15 @@ +x-implements: + - com.hivemq.api.errors.OpenApiError +allOf: + - $ref: "../ApiError.yaml" + - type: object + properties: + parameter: + type: string + description: The query parameter. + reason: + type: string + description: The reason. + required: + - parameter + - reason diff --git a/ext/openAPI/components/schemas/errors/common/PreconditionFailedError.yaml b/ext/openAPI/components/schemas/errors/common/PreconditionFailedError.yaml new file mode 100644 index 0000000000..3028b6deb3 --- /dev/null +++ b/ext/openAPI/components/schemas/errors/common/PreconditionFailedError.yaml @@ -0,0 +1,11 @@ +x-implements: + - com.hivemq.api.errors.OpenApiError +allOf: + - $ref: "../ApiError.yaml" + - type: object + properties: + reason: + type: string + description: The actual reason. + required: + - reason diff --git a/ext/openAPI/components/schemas/errors/common/RequestBodyMissingError.yaml b/ext/openAPI/components/schemas/errors/common/RequestBodyMissingError.yaml index b2a8ccfc37..2c7d08b95b 100644 --- a/ext/openAPI/components/schemas/errors/common/RequestBodyMissingError.yaml +++ b/ext/openAPI/components/schemas/errors/common/RequestBodyMissingError.yaml @@ -1,7 +1,9 @@ +x-implements: + - com.hivemq.api.errors.OpenApiError allOf: - $ref: "../ApiError.yaml" - type: object properties: - parameterName: + parameter: type: string - description: The name of the missing request body parameter. + description: The the missing request body parameter. diff --git a/ext/openAPI/components/schemas/errors/common/TemporaryNotAvailableError.yaml b/ext/openAPI/components/schemas/errors/common/TemporaryNotAvailableError.yaml index 1e5857dabc..60375f8936 100644 --- a/ext/openAPI/components/schemas/errors/common/TemporaryNotAvailableError.yaml +++ b/ext/openAPI/components/schemas/errors/common/TemporaryNotAvailableError.yaml @@ -1,2 +1,4 @@ +x-implements: + - com.hivemq.api.errors.OpenApiError allOf: - $ref: "../ApiError.yaml" diff --git a/ext/openAPI/components/schemas/errors/common/UrlParameterMissingError.yaml b/ext/openAPI/components/schemas/errors/common/UrlParameterMissingError.yaml index 7a9c0e2836..9955ab2f16 100644 --- a/ext/openAPI/components/schemas/errors/common/UrlParameterMissingError.yaml +++ b/ext/openAPI/components/schemas/errors/common/UrlParameterMissingError.yaml @@ -1,3 +1,5 @@ +x-implements: + - com.hivemq.api.errors.OpenApiError allOf: - $ref: "../ApiError.yaml" - type: object diff --git a/ext/openAPI/components/schemas/errors/datahub/AtMostOneFunctionValidationError.yaml b/ext/openAPI/components/schemas/errors/datahub/AtMostOneFunctionValidationError.yaml index 9cf712a8f5..680f975ccd 100644 --- a/ext/openAPI/components/schemas/errors/datahub/AtMostOneFunctionValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/AtMostOneFunctionValidationError.yaml @@ -6,7 +6,8 @@ allOf: type: string description: The function. occurrences: - type: int + type: integer + format: int32 description: The occurrences of the function. paths: type: array diff --git a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyValidationErrors.yaml b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyValidationErrors.yaml index edbf113e14..f737385842 100644 --- a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyValidationErrors.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyValidationErrors.yaml @@ -1,2 +1,4 @@ +x-implements: + - com.hivemq.api.errors.OpenApiError allOf: - $ref: "../validation/ValidationErrors.yaml" diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyAlreadyPresentError.yaml b/ext/openAPI/components/schemas/errors/datahub/DataPolicyAlreadyPresentError.yaml index 229810520b..60efe37123 100644 --- a/ext/openAPI/components/schemas/errors/datahub/DataPolicyAlreadyPresentError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/DataPolicyAlreadyPresentError.yaml @@ -1,3 +1,5 @@ +x-implements: + - com.hivemq.api.errors.OpenApiError allOf: - $ref: "../ApiError.yaml" - type: object diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyCreationFailureError.yaml b/ext/openAPI/components/schemas/errors/datahub/DataPolicyCreationFailureError.yaml index ea854eb9cc..3028b6deb3 100644 --- a/ext/openAPI/components/schemas/errors/datahub/DataPolicyCreationFailureError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/DataPolicyCreationFailureError.yaml @@ -1,3 +1,5 @@ +x-implements: + - com.hivemq.api.errors.OpenApiError allOf: - $ref: "../ApiError.yaml" - type: object diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyRejectedError.yaml b/ext/openAPI/components/schemas/errors/datahub/DataPolicyRejectedError.yaml index 1e5857dabc..60375f8936 100644 --- a/ext/openAPI/components/schemas/errors/datahub/DataPolicyRejectedError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/DataPolicyRejectedError.yaml @@ -1,2 +1,4 @@ +x-implements: + - com.hivemq.api.errors.OpenApiError allOf: - $ref: "../ApiError.yaml" diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyValidationErrors.yaml b/ext/openAPI/components/schemas/errors/datahub/DataPolicyValidationErrors.yaml index edbf113e14..f737385842 100644 --- a/ext/openAPI/components/schemas/errors/datahub/DataPolicyValidationErrors.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/DataPolicyValidationErrors.yaml @@ -1,2 +1,4 @@ +x-implements: + - com.hivemq.api.errors.OpenApiError allOf: - $ref: "../validation/ValidationErrors.yaml" diff --git a/ext/openAPI/components/schemas/errors/datahub/PolicyIdMismatchError.yaml b/ext/openAPI/components/schemas/errors/datahub/PolicyIdMismatchError.yaml index bddc51a565..f1c86078a3 100644 --- a/ext/openAPI/components/schemas/errors/datahub/PolicyIdMismatchError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/PolicyIdMismatchError.yaml @@ -1,3 +1,5 @@ +x-implements: + - com.hivemq.api.errors.OpenApiError allOf: - $ref: "../ApiError.yaml" - type: object diff --git a/ext/openAPI/components/schemas/errors/datahub/PolicyNotFoundError.yaml b/ext/openAPI/components/schemas/errors/datahub/PolicyNotFoundError.yaml new file mode 100644 index 0000000000..60efe37123 --- /dev/null +++ b/ext/openAPI/components/schemas/errors/datahub/PolicyNotFoundError.yaml @@ -0,0 +1,11 @@ +x-implements: + - com.hivemq.api.errors.OpenApiError +allOf: + - $ref: "../ApiError.yaml" + - type: object + properties: + id: + type: string + description: The policy id. + required: + - id diff --git a/ext/openAPI/components/schemas/errors/validation/InvalidFieldLengthValidationError.yaml b/ext/openAPI/components/schemas/errors/validation/InvalidFieldLengthValidationError.yaml index 4e22290c1c..1ea6096d7e 100644 --- a/ext/openAPI/components/schemas/errors/validation/InvalidFieldLengthValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/validation/InvalidFieldLengthValidationError.yaml @@ -4,12 +4,15 @@ allOf: properties: actualLength: type: integer + format: int32 description: The actual length of the field value. expectedMinimumLength: type: integer + format: int32 description: The minimum length expected for the field value. expectedMaximumLength: type: integer + format: int32 description: The maximum length expected for the field value. field: type: string diff --git a/ext/openAPI/components/schemas/errors/validation/ValidationErrors.yaml b/ext/openAPI/components/schemas/errors/validation/ValidationErrors.yaml index 8da9a778a9..03ac94cbf1 100644 --- a/ext/openAPI/components/schemas/errors/validation/ValidationErrors.yaml +++ b/ext/openAPI/components/schemas/errors/validation/ValidationErrors.yaml @@ -1,3 +1,5 @@ +x-implements: + - com.hivemq.api.errors.OpenApiError allOf: - $ref: "../ApiError.yaml" - type: object diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml index 58e0ae08fa..d37284d428 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml @@ -287,25 +287,14 @@ get: content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml + anyOf: + - $ref: "../components/schemas/errors/common/InvalidQueryParameterError.yaml" description: URL parameter missing - '404': - content: - application/json: - schema: - $ref: ../components/schemas/ProblemDetails.yaml - description: DataPolicy not found - '500': - content: - application/json: - schema: - $ref: ../components/schemas/ProblemDetails.yaml - description: Internal server error '503': content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml + $ref: "../components/schemas/errors/common/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable summary: Get all data policies tags: @@ -400,7 +389,6 @@ post: application/json: schema: anyOf: - - $ref: "../components/schemas/errors/common/InternalServerError.yaml" - $ref: "../components/schemas/errors/common/RequestBodyMissingError.yaml" - $ref: "../components/schemas/errors/datahub/DataPolicyCreationFailureError.yaml" - $ref: "../components/schemas/errors/datahub/DataPolicyRejectedError.yaml" diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml index ca7566869a..5a92642512 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml @@ -25,25 +25,27 @@ delete: content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml + anyOf: + - $ref: "../components/schemas/errors/common/UrlParameterMissingError.yaml" + - $ref: "../components/schemas/errors/datahub/PolicyNotFoundError.yaml" description: URL parameter missing - '404': + '412': content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml - description: DataPolicy not found + $ref: "../components/schemas/errors/common/PreconditionFailedError.yaml" + description: Internal server error '500': content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml + $ref: "../components/schemas/errors/common/InternalServerError.yaml" description: Internal server error '503': content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml + $ref: "../components/schemas/errors/common/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable summary: Delete a data policy tags: @@ -128,7 +130,9 @@ get: - title: Required parameter missing detail: Required URL parameter 'parameterName' is missing schema: - $ref: ../components/schemas/ProblemDetails.yaml + anyOf: + - $ref: "../components/schemas/errors/common/UrlParameterMissingError.yaml" + - $ref: "../components/schemas/errors/datahub/PolicyNotFoundError.yaml" description: Bad request '404': content: @@ -144,6 +148,18 @@ get: schema: $ref: ../components/schemas/ProblemDetails.yaml description: Resource not found + '500': + content: + application/json: + schema: + $ref: "../components/schemas/errors/common/InternalServerError.yaml" + description: Internal server error + '503': + content: + application/json: + schema: + $ref: "../components/schemas/errors/common/TemporaryNotAvailableError.yaml" + description: Request resource temporary unavailable summary: Get a data policy tags: - Data Hub - Data Policies diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/CommonErrorFactory.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/CommonErrorFactory.java new file mode 100644 index 0000000000..c46f3d3435 --- /dev/null +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/CommonErrorFactory.java @@ -0,0 +1,128 @@ +/* + * Copyright 2019-present HiveMQ GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.hivemq.api.errors; + +import com.hivemq.edge.api.model.InsufficientStorageError; +import com.hivemq.edge.api.model.InternalServerError; +import com.hivemq.edge.api.model.InvalidQueryParameterError; +import com.hivemq.edge.api.model.PreconditionFailedError; +import com.hivemq.edge.api.model.RequestBodyMissingError; +import com.hivemq.edge.api.model.TemporaryNotAvailableError; +import com.hivemq.edge.api.model.UrlParameterMissingError; +import com.hivemq.http.HttpStatus; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.net.URI; + +public final class CommonErrorFactory { + private static final String CLASS_PREFIX = "com.hivemq"; + private static final String TYPE_PREFIX = "https://hivemq.com"; + + private CommonErrorFactory() { + } + + public static @NotNull URI type(final @NotNull Class clazz) { + return URI.create(TYPE_PREFIX + clazz.getName().substring(CLASS_PREFIX.length()).replace(".", "/")); + } + + public static @NotNull InsufficientStorageError insufficientStorageError() { + return insufficientStorageError(null); + } + + public static @NotNull InsufficientStorageError insufficientStorageError(final @Nullable String reason) { + return InsufficientStorageError.builder() + .type(type(InsufficientStorageError.class)) + .title("Insufficient Storage") + .detail(reason == null ? "Insufficient Storage." : "Insufficient Storage: " + reason) + .reason(reason) + .status(HttpStatus.INSUFFICIENT_STORAGE_507) + .build(); + } + + public static @NotNull InternalServerError internalServerError(final @Nullable String reason) { + return InternalServerError.builder() + .type(type(InternalServerError.class)) + .title("Internal Error") + .detail(reason == null ? "An unexpected error occurred, check the logs." : reason) + .reason(reason) + .status(HttpStatus.INTERNAL_SERVER_ERROR_500) + .build(); + } + + public static @NotNull InvalidQueryParameterError invalidQueryParameterError( + final @NotNull String parameter, + final @NotNull String reason) { + return InvalidQueryParameterError.builder() + .type(type(InvalidQueryParameterError.class)) + .title("Query parameter is invalid") + .detail("Query parameter '" + parameter + "' is invalid: " + reason) + .parameter(parameter) + .reason(reason) + .status(HttpStatus.BAD_REQUEST_400) + .build(); + } + + public static @NotNull PreconditionFailedError preconditionFailedError( + final @NotNull String reason) { + return PreconditionFailedError.builder() + .type(type(PreconditionFailedError.class)) + .title("Precondition Failed") + .detail("A precondition required for fulfilling the request was not fulfilled: " + reason) + .reason(reason) + .status(HttpStatus.PRECONDITION_FAILED_412) + .build(); + } + + public static @NotNull RequestBodyMissingError requestBodyMissingError() { + return RequestBodyMissingError.builder() + .type(type(RequestBodyMissingError.class)) + .title("Required request body missing") + .detail("Required request body missing") + .status(HttpStatus.BAD_REQUEST_400) + .build(); + } + + public static @NotNull RequestBodyMissingError requestBodyMissingError(final @NotNull String parameter) { + return RequestBodyMissingError.builder() + .type(type(RequestBodyMissingError.class)) + .title("Required request body parameter " + parameter + " missing") + .detail("Required request body parameter " + parameter + " missing") + .parameter(parameter) + .status(HttpStatus.BAD_REQUEST_400) + .build(); + } + + public static @NotNull TemporaryNotAvailableError temporaryNotAvailableError() { + return TemporaryNotAvailableError.builder() + .type(type(TemporaryNotAvailableError.class)) + .title("The endpoint is temporarily not available") + .detail("The endpoint is temporarily not available, please try again later") + .status(HttpStatus.SERVICE_UNAVAILABLE_503) + .build(); + } + + public static @NotNull UrlParameterMissingError urlParameterMissingError(final @NotNull String parameter) { + return UrlParameterMissingError.builder() + .type(type(UrlParameterMissingError.class)) + .title("Required url parameter missing") + .detail("Required url parameter '" + parameter + "' missing") + .parameter(parameter) + .status(HttpStatus.BAD_REQUEST_400) + .build(); + } +} diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/OpenApiError.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/OpenApiError.java new file mode 100644 index 0000000000..de3f4f98e7 --- /dev/null +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/OpenApiError.java @@ -0,0 +1,44 @@ +/* + * Copyright 2019-present HiveMQ GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.hivemq.api.errors; + +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.net.URI; + +public interface OpenApiError { + @Nullable String getCode(); + + void setCode(@Nullable String code); + + @Nullable String getDetail(); + + void setDetail(@Nullable String detail); + + @NotNull String getTitle(); + + void setTitle(@NotNull String title); + + @NotNull URI getType(); + + void setType(@NotNull URI type); + + @NotNull Integer getStatus(); + + void setStatus(@NotNull Integer status); +} diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/common/InsufficientStorageError.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/common/InsufficientStorageError.java deleted file mode 100644 index 9bf301176f..0000000000 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/common/InsufficientStorageError.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright 2019-present HiveMQ GmbH - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.hivemq.api.errors.common; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.hivemq.api.errors.ApiError; -import com.hivemq.http.HttpStatus; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import java.util.Objects; - -public final class InsufficientStorageError extends ApiError { - @JsonProperty("reason") - private @Nullable String reason; - - private InsufficientStorageError( - final @NotNull String title, - final @Nullable String detail, - final @Nullable String reason, - final int status, - final @Nullable String code) { - super(title, detail, status, code); - setReason(reason); - } - - public static InsufficientStorageError of() { - return of(null); - } - - public static InsufficientStorageError of(final @Nullable String reason) { - return new InsufficientStorageError("Insufficient Storage", - reason == null ? "Insufficient Storage." : "Insufficient Storage: " + reason, - reason, - HttpStatus.INSUFFICIENT_STORAGE_507, - null); - } - - @Override - public @NotNull String toString() { - return "InternalServerError{" + - "reason='" + - reason + - '\'' + - ", code='" + - code + - '\'' + - ", detail='" + - detail + - '\'' + - ", status=" + - status + - ", title='" + - title + - '\'' + - ", type='" + - type + - '\'' + - '}'; - } - - @Override - public boolean equals(final Object o) { - if (o == null || getClass() != o.getClass()) { - return false; - } - if (!super.equals(o)) { - return false; - } - final InsufficientStorageError that = (InsufficientStorageError) o; - return Objects.equals(reason, that.reason); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), reason); - } - - public @Nullable String getReason() { - return reason; - } - - public @NotNull InsufficientStorageError setReason(final @Nullable String reason) { - this.reason = reason; - return this; - } -} diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/common/InternalServerError.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/common/InternalServerError.java deleted file mode 100644 index 818bb155fc..0000000000 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/common/InternalServerError.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright 2019-present HiveMQ GmbH - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.hivemq.api.errors.common; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.hivemq.api.errors.ApiError; -import com.hivemq.http.HttpStatus; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import java.util.Objects; - -public final class InternalServerError extends ApiError { - @JsonProperty("reason") - private @Nullable String reason; - - private InternalServerError( - final @NotNull String title, - final @Nullable String detail, - final @Nullable String reason, - final int status, - final @Nullable String code) { - super(title, detail, status, code); - setReason(reason); - } - - public static InternalServerError of() { - return of(null); - } - - public static InternalServerError of(final @Nullable String reason) { - return new InternalServerError("InternalError", - reason == null ? "An unexpected error occurred, check the logs." : reason, - reason, - HttpStatus.INTERNAL_SERVER_ERROR_500, - null); - } - - @Override - public @NotNull String toString() { - return "InternalServerError{" + - "reason='" + - reason + - '\'' + - ", code='" + - code + - '\'' + - ", detail='" + - detail + - '\'' + - ", status=" + - status + - ", title='" + - title + - '\'' + - ", type='" + - type + - '\'' + - '}'; - } - - @Override - public boolean equals(final Object o) { - if (o == null || getClass() != o.getClass()) { - return false; - } - if (!super.equals(o)) { - return false; - } - final InternalServerError that = (InternalServerError) o; - return Objects.equals(reason, that.reason); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), reason); - } - - public @Nullable String getReason() { - return reason; - } - - public @NotNull InternalServerError setReason(final @Nullable String reason) { - this.reason = reason; - return this; - } -} diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/common/RequestBodyMissingError.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/common/RequestBodyMissingError.java deleted file mode 100644 index ff54099fd8..0000000000 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/common/RequestBodyMissingError.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright 2019-present HiveMQ GmbH - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.hivemq.api.errors.common; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.hivemq.api.errors.ApiError; -import com.hivemq.http.HttpStatus; -import io.swagger.v3.oas.annotations.media.Schema; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import java.util.Objects; - -public final class RequestBodyMissingError extends ApiError { - @JsonProperty("parameter") - @Schema(description = "Parameter") - private @Nullable String parameter; - - private RequestBodyMissingError( - final @NotNull String title, - final @Nullable String detail, - final @Nullable String parameter) { - super(title, detail, HttpStatus.BAD_REQUEST_400, null); - setParameter(parameter); - } - - public static RequestBodyMissingError of(final @NotNull String parameter) { - return new RequestBodyMissingError("Required request body parameter " + parameter + " missing", - "Required request body parameter " + parameter + " missing", - parameter); - } - - public static RequestBodyMissingError of() { - return new RequestBodyMissingError("Required request body missing", "Required request body missing", null); - } - - public @Nullable String getParameter() { - return parameter; - } - - public @NotNull RequestBodyMissingError setParameter(final @Nullable String parameter) { - this.parameter = parameter; - return this; - } - - @Override - public @NotNull String toString() { - return "RequestBodyMissingError{" + - "parameter='" + - parameter + - '\'' + - ", code='" + - code + - '\'' + - ", detail='" + - detail + - '\'' + - ", status=" + - status + - ", title='" + - title + - '\'' + - ", type='" + - type + - '\'' + - '}'; - } - - @Override - public boolean equals(final Object o) { - if (o == null || getClass() != o.getClass()) { - return false; - } - if (!super.equals(o)) { - return false; - } - final RequestBodyMissingError that = (RequestBodyMissingError) o; - return Objects.equals(parameter, that.parameter); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), parameter); - } -} diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/common/TemporaryNotAvailableError.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/common/TemporaryNotAvailableError.java deleted file mode 100644 index afe00a99b4..0000000000 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/common/TemporaryNotAvailableError.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2019-present HiveMQ GmbH - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.hivemq.api.errors.common; - -import com.hivemq.api.errors.ApiError; -import com.hivemq.http.HttpStatus; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -public final class TemporaryNotAvailableError extends ApiError { - private TemporaryNotAvailableError( - final @NotNull String title, - final @Nullable String detail, - final int status, - final @Nullable String code) { - super(title, detail, status, code); - } - - public static TemporaryNotAvailableError of() { - return new TemporaryNotAvailableError("The endpoint is temporarily not available", - "The endpoint is temporarily not available, please try again later", - HttpStatus.SERVICE_UNAVAILABLE_503, - null); - } - - @Override - public @NotNull String toString() { - return "TemporaryNotAvailableError{" + - "code='" + - code + - '\'' + - ", detail='" + - detail + - '\'' + - ", status=" + - status + - ", title='" + - title + - '\'' + - ", type='" + - type + - '\'' + - '}'; - } -} diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/common/UrlParameterMissingError.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/common/UrlParameterMissingError.java deleted file mode 100644 index 50aabe768f..0000000000 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/common/UrlParameterMissingError.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2019-present HiveMQ GmbH - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.hivemq.api.errors.common; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.hivemq.api.errors.ApiError; -import com.hivemq.http.HttpStatus; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import java.util.Objects; - -public final class UrlParameterMissingError extends ApiError { - @JsonProperty("parameter") - private @NotNull String parameter; - - private UrlParameterMissingError( - final @NotNull String title, - final @Nullable String detail, - final @NotNull String parameter, - final int status, - final @Nullable String code) { - super(title, detail, status, code); - setParameter(parameter); - } - - public static UrlParameterMissingError of(final @NotNull String parameter) { - return new UrlParameterMissingError("Required url parameter missing", - "Required url parameter '" + parameter + "' missing", - parameter, - HttpStatus.BAD_REQUEST_400, - null); - } - - public @NotNull String getParameter() { - return parameter; - } - - public @NotNull UrlParameterMissingError setParameter(@NotNull final String parameter) { - this.parameter = Objects.requireNonNull(parameter); - return this; - } -} diff --git a/hivemq-edge/src/main/java/com/hivemq/util/ErrorResponseUtil.java b/hivemq-edge/src/main/java/com/hivemq/util/ErrorResponseUtil.java index 5a5d8667d9..25f74ebac7 100644 --- a/hivemq-edge/src/main/java/com/hivemq/util/ErrorResponseUtil.java +++ b/hivemq-edge/src/main/java/com/hivemq/util/ErrorResponseUtil.java @@ -16,6 +16,7 @@ package com.hivemq.util; import com.hivemq.api.errors.ApiError; +import com.hivemq.api.errors.OpenApiError; import com.hivemq.http.error.ProblemDetails; import org.jetbrains.annotations.NotNull; @@ -25,6 +26,13 @@ * @author Christoph Schäbel */ public class ErrorResponseUtil { + public static @NotNull Response errorResponse(final @NotNull OpenApiError error) { + return Response.status(error.getStatus()) + .entity(error) + .header("Content-Type", "application/json;charset=utf-8") + .build(); + } + public static @NotNull Response errorResponse(final @NotNull ProblemDetails errors) { return Response.status(errors.getStatus()) .entity(errors) From ed24af7175ee6111a36e08f857c6a0fd623aaa2a Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Fri, 30 May 2025 09:16:50 +0200 Subject: [PATCH 011/121] refactor: Refactor validation errors 1 --- ext/hivemq-edge-openapi-2025.9.yaml | 71 +++++++++++++++---- .../components/schemas/errors/ApiError.yaml | 1 + .../common/InsufficientStorageError.yaml | 4 ++ .../errors/common/InternalServerError.yaml | 4 ++ .../common/PreconditionFailedError.yaml | 4 ++ .../common/TemporaryNotAvailableError.yaml | 6 ++ .../AtMostOneFunctionValidationError.yaml | 2 + .../FunctionMustBePairedValidationError.yaml | 2 + .../datahub/GeneralPolicyValidationError.yaml | 2 + .../InvalidFunctionOrderValidationError.yaml | 2 + .../UnknownVariableValidationError.yaml | 2 + .../validation/EmptyFieldValidationError.yaml | 2 + .../InvalidFieldLengthValidationError.yaml | 2 + .../InvalidFieldValueValidationError.yaml | 2 + .../InvalidIdentifierValidationError.yaml | 2 + .../MissingFieldValidationError.yaml | 2 + .../UnsupportedFieldValidationError.yaml | 2 + .../errors/validation/ValidationError.yaml | 17 +++++ .../errors/validation/ValidationErrors.yaml | 13 +--- .../com/hivemq/api/errors/ErrorFactory.java | 33 +++++++++ ...rrorFactory.java => HttpErrorFactory.java} | 25 ++----- .../api/errors/OpenApiValidationError.java | 31 ++++++++ 22 files changed, 186 insertions(+), 45 deletions(-) create mode 100644 hivemq-edge/src/main/java/com/hivemq/api/errors/ErrorFactory.java rename hivemq-edge/src/main/java/com/hivemq/api/errors/{CommonErrorFactory.java => HttpErrorFactory.java} (82%) create mode 100644 hivemq-edge/src/main/java/com/hivemq/api/errors/OpenApiValidationError.java diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index 411ad58b91..bc60dd0fad 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -4682,6 +4682,7 @@ components: description: A URI reference that identifies the error type. status: type: integer + default: 400 format: int32 description: The HTTP status code associated with the error. required: @@ -4699,6 +4700,8 @@ components: type: string description: The the missing request body parameter. ValidationError: + x-implements: + - com.hivemq.api.errors.OpenApiValidationError type: object properties: detail: @@ -4706,11 +4709,28 @@ components: description: Detailed contextual description of the validation error. type: type: string + format: uri description: Type of the validation error. required: - detail - type + discriminator: + propertyName: type + mapping: + EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' + InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' + InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' + InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' + MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' + UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' + AtMostOneFunctionValidationError: '#/components/schemas/AtMostOneFunctionValidationError' + FunctionMustBePairedValidationError: '#/components/schemas/FunctionMustBePairedValidationError' + GeneralPolicyValidationError: '#/components/schemas/GeneralPolicyValidationError' + InvalidFunctionOrderValidationError: '#/components/schemas/InvalidFunctionOrderValidationError' + UnknownVariableValidationError: '#/components/schemas/UnknownVariableValidationError' EmptyFieldValidationError: + x-implements: + - com.hivemq.api.errors.OpenApiValidationError allOf: - $ref: '#/components/schemas/ValidationError' - type: object @@ -4721,6 +4741,8 @@ components: required: - field InvalidFieldLengthValidationError: + x-implements: + - com.hivemq.api.errors.OpenApiValidationError allOf: - $ref: '#/components/schemas/ValidationError' - type: object @@ -4750,6 +4772,8 @@ components: - field - value InvalidFieldValueValidationError: + x-implements: + - com.hivemq.api.errors.OpenApiValidationError allOf: - $ref: '#/components/schemas/ValidationError' - type: object @@ -4764,6 +4788,8 @@ components: - field - value InvalidIdentifierValidationError: + x-implements: + - com.hivemq.api.errors.OpenApiValidationError allOf: - $ref: '#/components/schemas/ValidationError' - type: object @@ -4778,6 +4804,8 @@ components: - field - value MissingFieldValidationError: + x-implements: + - com.hivemq.api.errors.OpenApiValidationError allOf: - $ref: '#/components/schemas/ValidationError' - type: object @@ -4788,6 +4816,8 @@ components: required: - field UnsupportedFieldValidationError: + x-implements: + - com.hivemq.api.errors.OpenApiValidationError allOf: - $ref: '#/components/schemas/ValidationError' - type: object @@ -4806,6 +4836,8 @@ components: - expectedValue - field AtMostOneFunctionValidationError: + x-implements: + - com.hivemq.api.errors.OpenApiValidationError allOf: - $ref: '#/components/schemas/ValidationError' - type: object @@ -4827,6 +4859,8 @@ components: - occurrences - paths FunctionMustBePairedValidationError: + x-implements: + - com.hivemq.api.errors.OpenApiValidationError allOf: - $ref: '#/components/schemas/ValidationError' - type: object @@ -4841,6 +4875,8 @@ components: - existingFunction - missingFunction GeneralPolicyValidationError: + x-implements: + - com.hivemq.api.errors.OpenApiValidationError allOf: - $ref: '#/components/schemas/ValidationError' - type: object @@ -4851,6 +4887,8 @@ components: required: - title InvalidFunctionOrderValidationError: + x-implements: + - com.hivemq.api.errors.OpenApiValidationError allOf: - $ref: '#/components/schemas/ValidationError' - type: object @@ -4869,6 +4907,8 @@ components: - function - previousFunction UnknownVariableValidationError: + x-implements: + - com.hivemq.api.errors.OpenApiValidationError allOf: - $ref: '#/components/schemas/ValidationError' - type: object @@ -4895,18 +4935,7 @@ components: type: array description: List of validation errors. items: - anyOf: - - $ref: '#/components/schemas/EmptyFieldValidationError' - - $ref: '#/components/schemas/InvalidFieldLengthValidationError' - - $ref: '#/components/schemas/InvalidFieldValueValidationError' - - $ref: '#/components/schemas/InvalidIdentifierValidationError' - - $ref: '#/components/schemas/MissingFieldValidationError' - - $ref: '#/components/schemas/UnsupportedFieldValidationError' - - $ref: '#/components/schemas/AtMostOneFunctionValidationError' - - $ref: '#/components/schemas/FunctionMustBePairedValidationError' - - $ref: '#/components/schemas/GeneralPolicyValidationError' - - $ref: '#/components/schemas/InvalidFunctionOrderValidationError' - - $ref: '#/components/schemas/UnknownVariableValidationError' + $ref: '#/components/schemas/ValidationError' required: - errors BehaviorPolicyValidationErrors: @@ -4919,6 +4948,12 @@ components: - com.hivemq.api.errors.OpenApiError allOf: - $ref: '#/components/schemas/ApiError' + - type: object + properties: + status: + type: integer + default: 503 + description: The HTTP status code. JsonNode: type: object description: The arguments of the fsm derived from the behavior policy. @@ -5100,6 +5135,10 @@ components: reason: type: string description: The actual reason. + status: + type: integer + default: 500 + description: The HTTP status code. InsufficientStorageError: x-implements: - com.hivemq.api.errors.OpenApiError @@ -5110,6 +5149,10 @@ components: reason: type: string description: The actual reason. + status: + type: integer + default: 507 + description: The HTTP status code. UrlParameterMissingError: x-implements: - com.hivemq.api.errors.OpenApiError @@ -5160,6 +5203,10 @@ components: reason: type: string description: The actual reason. + status: + type: integer + default: 412 + description: The HTTP status code. required: - reason Errors: diff --git a/ext/openAPI/components/schemas/errors/ApiError.yaml b/ext/openAPI/components/schemas/errors/ApiError.yaml index d1a9c0f705..f156edce1d 100644 --- a/ext/openAPI/components/schemas/errors/ApiError.yaml +++ b/ext/openAPI/components/schemas/errors/ApiError.yaml @@ -17,6 +17,7 @@ properties: description: A URI reference that identifies the error type. status: type: integer + default: 400 format: int32 description: The HTTP status code associated with the error. required: diff --git a/ext/openAPI/components/schemas/errors/common/InsufficientStorageError.yaml b/ext/openAPI/components/schemas/errors/common/InsufficientStorageError.yaml index 0776b7f456..ba3c24c702 100644 --- a/ext/openAPI/components/schemas/errors/common/InsufficientStorageError.yaml +++ b/ext/openAPI/components/schemas/errors/common/InsufficientStorageError.yaml @@ -7,3 +7,7 @@ allOf: reason: type: string description: The actual reason. + status: + type: integer + default: 507 + description: The HTTP status code. diff --git a/ext/openAPI/components/schemas/errors/common/InternalServerError.yaml b/ext/openAPI/components/schemas/errors/common/InternalServerError.yaml index 0776b7f456..a9d240d66d 100644 --- a/ext/openAPI/components/schemas/errors/common/InternalServerError.yaml +++ b/ext/openAPI/components/schemas/errors/common/InternalServerError.yaml @@ -7,3 +7,7 @@ allOf: reason: type: string description: The actual reason. + status: + type: integer + default: 500 + description: The HTTP status code. diff --git a/ext/openAPI/components/schemas/errors/common/PreconditionFailedError.yaml b/ext/openAPI/components/schemas/errors/common/PreconditionFailedError.yaml index 3028b6deb3..04e6429a2d 100644 --- a/ext/openAPI/components/schemas/errors/common/PreconditionFailedError.yaml +++ b/ext/openAPI/components/schemas/errors/common/PreconditionFailedError.yaml @@ -7,5 +7,9 @@ allOf: reason: type: string description: The actual reason. + status: + type: integer + default: 412 + description: The HTTP status code. required: - reason diff --git a/ext/openAPI/components/schemas/errors/common/TemporaryNotAvailableError.yaml b/ext/openAPI/components/schemas/errors/common/TemporaryNotAvailableError.yaml index 60375f8936..46322b7c85 100644 --- a/ext/openAPI/components/schemas/errors/common/TemporaryNotAvailableError.yaml +++ b/ext/openAPI/components/schemas/errors/common/TemporaryNotAvailableError.yaml @@ -2,3 +2,9 @@ x-implements: - com.hivemq.api.errors.OpenApiError allOf: - $ref: "../ApiError.yaml" + - type: object + properties: + status: + type: integer + default: 503 + description: The HTTP status code. diff --git a/ext/openAPI/components/schemas/errors/datahub/AtMostOneFunctionValidationError.yaml b/ext/openAPI/components/schemas/errors/datahub/AtMostOneFunctionValidationError.yaml index 680f975ccd..d09c8fd473 100644 --- a/ext/openAPI/components/schemas/errors/datahub/AtMostOneFunctionValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/AtMostOneFunctionValidationError.yaml @@ -1,3 +1,5 @@ +x-implements: + - com.hivemq.api.errors.OpenApiValidationError allOf: - $ref: "../validation/ValidationError.yaml" - type: object diff --git a/ext/openAPI/components/schemas/errors/datahub/FunctionMustBePairedValidationError.yaml b/ext/openAPI/components/schemas/errors/datahub/FunctionMustBePairedValidationError.yaml index 07ff484703..904a2d5d04 100644 --- a/ext/openAPI/components/schemas/errors/datahub/FunctionMustBePairedValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/FunctionMustBePairedValidationError.yaml @@ -1,3 +1,5 @@ +x-implements: + - com.hivemq.api.errors.OpenApiValidationError allOf: - $ref: "../validation/ValidationError.yaml" - type: object diff --git a/ext/openAPI/components/schemas/errors/datahub/GeneralPolicyValidationError.yaml b/ext/openAPI/components/schemas/errors/datahub/GeneralPolicyValidationError.yaml index 45e26077dc..c3e175b50d 100644 --- a/ext/openAPI/components/schemas/errors/datahub/GeneralPolicyValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/GeneralPolicyValidationError.yaml @@ -1,3 +1,5 @@ +x-implements: + - com.hivemq.api.errors.OpenApiValidationError allOf: - $ref: "../validation/ValidationError.yaml" - type: object diff --git a/ext/openAPI/components/schemas/errors/datahub/InvalidFunctionOrderValidationError.yaml b/ext/openAPI/components/schemas/errors/datahub/InvalidFunctionOrderValidationError.yaml index ea5adab888..49011d1ead 100644 --- a/ext/openAPI/components/schemas/errors/datahub/InvalidFunctionOrderValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/InvalidFunctionOrderValidationError.yaml @@ -1,3 +1,5 @@ +x-implements: + - com.hivemq.api.errors.OpenApiValidationError allOf: - $ref: "../validation/ValidationError.yaml" - type: object diff --git a/ext/openAPI/components/schemas/errors/datahub/UnknownVariableValidationError.yaml b/ext/openAPI/components/schemas/errors/datahub/UnknownVariableValidationError.yaml index 2718f109be..e07aa564c3 100644 --- a/ext/openAPI/components/schemas/errors/datahub/UnknownVariableValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/UnknownVariableValidationError.yaml @@ -1,3 +1,5 @@ +x-implements: + - com.hivemq.api.errors.OpenApiValidationError allOf: - $ref: "../validation/ValidationError.yaml" - type: object diff --git a/ext/openAPI/components/schemas/errors/validation/EmptyFieldValidationError.yaml b/ext/openAPI/components/schemas/errors/validation/EmptyFieldValidationError.yaml index d37e184cd3..bc8b7c7a4c 100644 --- a/ext/openAPI/components/schemas/errors/validation/EmptyFieldValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/validation/EmptyFieldValidationError.yaml @@ -1,3 +1,5 @@ +x-implements: + - com.hivemq.api.errors.OpenApiValidationError allOf: - $ref: "./ValidationError.yaml" - type: object diff --git a/ext/openAPI/components/schemas/errors/validation/InvalidFieldLengthValidationError.yaml b/ext/openAPI/components/schemas/errors/validation/InvalidFieldLengthValidationError.yaml index 1ea6096d7e..6137ed45ff 100644 --- a/ext/openAPI/components/schemas/errors/validation/InvalidFieldLengthValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/validation/InvalidFieldLengthValidationError.yaml @@ -1,3 +1,5 @@ +x-implements: + - com.hivemq.api.errors.OpenApiValidationError allOf: - $ref: "./ValidationError.yaml" - type: object diff --git a/ext/openAPI/components/schemas/errors/validation/InvalidFieldValueValidationError.yaml b/ext/openAPI/components/schemas/errors/validation/InvalidFieldValueValidationError.yaml index f9dd044216..6be8643a82 100644 --- a/ext/openAPI/components/schemas/errors/validation/InvalidFieldValueValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/validation/InvalidFieldValueValidationError.yaml @@ -1,3 +1,5 @@ +x-implements: + - com.hivemq.api.errors.OpenApiValidationError allOf: - $ref: "./ValidationError.yaml" - type: object diff --git a/ext/openAPI/components/schemas/errors/validation/InvalidIdentifierValidationError.yaml b/ext/openAPI/components/schemas/errors/validation/InvalidIdentifierValidationError.yaml index 621fdbd3eb..3e2ba46bf5 100644 --- a/ext/openAPI/components/schemas/errors/validation/InvalidIdentifierValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/validation/InvalidIdentifierValidationError.yaml @@ -1,3 +1,5 @@ +x-implements: + - com.hivemq.api.errors.OpenApiValidationError allOf: - $ref: "./ValidationError.yaml" - type: object diff --git a/ext/openAPI/components/schemas/errors/validation/MissingFieldValidationError.yaml b/ext/openAPI/components/schemas/errors/validation/MissingFieldValidationError.yaml index d37e184cd3..bc8b7c7a4c 100644 --- a/ext/openAPI/components/schemas/errors/validation/MissingFieldValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/validation/MissingFieldValidationError.yaml @@ -1,3 +1,5 @@ +x-implements: + - com.hivemq.api.errors.OpenApiValidationError allOf: - $ref: "./ValidationError.yaml" - type: object diff --git a/ext/openAPI/components/schemas/errors/validation/UnsupportedFieldValidationError.yaml b/ext/openAPI/components/schemas/errors/validation/UnsupportedFieldValidationError.yaml index 18d411dbd4..b480122de4 100644 --- a/ext/openAPI/components/schemas/errors/validation/UnsupportedFieldValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/validation/UnsupportedFieldValidationError.yaml @@ -1,3 +1,5 @@ +x-implements: + - com.hivemq.api.errors.OpenApiValidationError allOf: - $ref: "./ValidationError.yaml" - type: object diff --git a/ext/openAPI/components/schemas/errors/validation/ValidationError.yaml b/ext/openAPI/components/schemas/errors/validation/ValidationError.yaml index a829cdff1a..e9281c52b3 100644 --- a/ext/openAPI/components/schemas/errors/validation/ValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/validation/ValidationError.yaml @@ -1,3 +1,5 @@ +x-implements: + - com.hivemq.api.errors.OpenApiValidationError type: object properties: detail: @@ -5,7 +7,22 @@ properties: description: Detailed contextual description of the validation error. type: type: string + format: uri description: Type of the validation error. required: - detail - type +discriminator: + propertyName: type + mapping: + EmptyFieldValidationError: "./EmptyFieldValidationError.yaml" + InvalidFieldLengthValidationError: "./InvalidFieldLengthValidationError.yaml" + InvalidFieldValueValidationError: "./InvalidFieldValueValidationError.yaml" + InvalidIdentifierValidationError: "./InvalidIdentifierValidationError.yaml" + MissingFieldValidationError: "./MissingFieldValidationError.yaml" + UnsupportedFieldValidationError: "./UnsupportedFieldValidationError.yaml" + AtMostOneFunctionValidationError: "../datahub/AtMostOneFunctionValidationError.yaml" + FunctionMustBePairedValidationError: "../datahub/FunctionMustBePairedValidationError.yaml" + GeneralPolicyValidationError: "../datahub/GeneralPolicyValidationError.yaml" + InvalidFunctionOrderValidationError: "../datahub/InvalidFunctionOrderValidationError.yaml" + UnknownVariableValidationError: "../datahub/UnknownVariableValidationError.yaml" diff --git a/ext/openAPI/components/schemas/errors/validation/ValidationErrors.yaml b/ext/openAPI/components/schemas/errors/validation/ValidationErrors.yaml index 03ac94cbf1..7ff4bdf10c 100644 --- a/ext/openAPI/components/schemas/errors/validation/ValidationErrors.yaml +++ b/ext/openAPI/components/schemas/errors/validation/ValidationErrors.yaml @@ -8,17 +8,6 @@ allOf: type: array description: List of validation errors. items: - anyOf: - - $ref: "./EmptyFieldValidationError.yaml" - - $ref: "./InvalidFieldLengthValidationError.yaml" - - $ref: "./InvalidFieldValueValidationError.yaml" - - $ref: "./InvalidIdentifierValidationError.yaml" - - $ref: "./MissingFieldValidationError.yaml" - - $ref: "./UnsupportedFieldValidationError.yaml" - - $ref: "../datahub/AtMostOneFunctionValidationError.yaml" - - $ref: "../datahub/FunctionMustBePairedValidationError.yaml" - - $ref: "../datahub/GeneralPolicyValidationError.yaml" - - $ref: "../datahub/InvalidFunctionOrderValidationError.yaml" - - $ref: "../datahub/UnknownVariableValidationError.yaml" + $ref: "./ValidationError.yaml" required: - errors diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/ErrorFactory.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/ErrorFactory.java new file mode 100644 index 0000000000..5d8152f7c5 --- /dev/null +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/ErrorFactory.java @@ -0,0 +1,33 @@ +/* + * Copyright 2019-present HiveMQ GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.hivemq.api.errors; + +import org.jetbrains.annotations.NotNull; + +import java.net.URI; + +public abstract class ErrorFactory { + private static final String CLASS_PREFIX = "com.hivemq"; + private static final String TYPE_PREFIX = "https://hivemq.com"; + + protected ErrorFactory() { + } + + protected static @NotNull URI type(final @NotNull Class clazz) { + return URI.create(TYPE_PREFIX + clazz.getName().substring(CLASS_PREFIX.length()).replace(".", "/")); + } +} diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/CommonErrorFactory.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java similarity index 82% rename from hivemq-edge/src/main/java/com/hivemq/api/errors/CommonErrorFactory.java rename to hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java index c46f3d3435..e086c4a1b1 100644 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/CommonErrorFactory.java +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java @@ -23,21 +23,12 @@ import com.hivemq.edge.api.model.RequestBodyMissingError; import com.hivemq.edge.api.model.TemporaryNotAvailableError; import com.hivemq.edge.api.model.UrlParameterMissingError; -import com.hivemq.http.HttpStatus; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.net.URI; - -public final class CommonErrorFactory { - private static final String CLASS_PREFIX = "com.hivemq"; - private static final String TYPE_PREFIX = "https://hivemq.com"; - - private CommonErrorFactory() { - } - - public static @NotNull URI type(final @NotNull Class clazz) { - return URI.create(TYPE_PREFIX + clazz.getName().substring(CLASS_PREFIX.length()).replace(".", "/")); +public final class HttpErrorFactory extends ErrorFactory { + private HttpErrorFactory() { + super(); } public static @NotNull InsufficientStorageError insufficientStorageError() { @@ -50,7 +41,6 @@ private CommonErrorFactory() { .title("Insufficient Storage") .detail(reason == null ? "Insufficient Storage." : "Insufficient Storage: " + reason) .reason(reason) - .status(HttpStatus.INSUFFICIENT_STORAGE_507) .build(); } @@ -60,7 +50,6 @@ private CommonErrorFactory() { .title("Internal Error") .detail(reason == null ? "An unexpected error occurred, check the logs." : reason) .reason(reason) - .status(HttpStatus.INTERNAL_SERVER_ERROR_500) .build(); } @@ -73,7 +62,6 @@ private CommonErrorFactory() { .detail("Query parameter '" + parameter + "' is invalid: " + reason) .parameter(parameter) .reason(reason) - .status(HttpStatus.BAD_REQUEST_400) .build(); } @@ -84,7 +72,6 @@ private CommonErrorFactory() { .title("Precondition Failed") .detail("A precondition required for fulfilling the request was not fulfilled: " + reason) .reason(reason) - .status(HttpStatus.PRECONDITION_FAILED_412) .build(); } @@ -92,8 +79,7 @@ private CommonErrorFactory() { return RequestBodyMissingError.builder() .type(type(RequestBodyMissingError.class)) .title("Required request body missing") - .detail("Required request body missing") - .status(HttpStatus.BAD_REQUEST_400) + .detail("Required request body missing.") .build(); } @@ -103,7 +89,6 @@ private CommonErrorFactory() { .title("Required request body parameter " + parameter + " missing") .detail("Required request body parameter " + parameter + " missing") .parameter(parameter) - .status(HttpStatus.BAD_REQUEST_400) .build(); } @@ -112,7 +97,6 @@ private CommonErrorFactory() { .type(type(TemporaryNotAvailableError.class)) .title("The endpoint is temporarily not available") .detail("The endpoint is temporarily not available, please try again later") - .status(HttpStatus.SERVICE_UNAVAILABLE_503) .build(); } @@ -122,7 +106,6 @@ private CommonErrorFactory() { .title("Required url parameter missing") .detail("Required url parameter '" + parameter + "' missing") .parameter(parameter) - .status(HttpStatus.BAD_REQUEST_400) .build(); } } diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/OpenApiValidationError.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/OpenApiValidationError.java new file mode 100644 index 0000000000..23c0e729c2 --- /dev/null +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/OpenApiValidationError.java @@ -0,0 +1,31 @@ +/* + * Copyright 2019-present HiveMQ GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.hivemq.api.errors; + +import org.jetbrains.annotations.NotNull; + +import java.net.URI; + +public interface OpenApiValidationError { + @NotNull String getDetail(); + + void setDetail(@NotNull String detail); + + @NotNull URI getType(); + + void setType(@NotNull URI type); +} From da95c0861ae3ce423b0dae2e478ff4c5d9462dd2 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Fri, 30 May 2025 10:03:35 +0200 Subject: [PATCH 012/121] refactor: Refactor DataHub errors 1 --- ext/hivemq-edge-openapi-2025.9.yaml | 47 ++++++++++++++++++- .../DataPolicyAlreadyPresentError.yaml | 4 ++ .../datahub/DataPolicyNotFoundError.yaml | 15 ++++++ .../datahub/TopicFilterMismatchError.yaml | 14 ++++++ .../InsufficientStorageError.yaml | 0 .../{common => http}/InternalServerError.yaml | 0 .../InvalidQueryParameterError.yaml | 0 .../PreconditionFailedError.yaml | 0 .../RequestBodyMissingError.yaml | 0 .../TemporaryNotAvailableError.yaml | 0 .../UrlParameterMissingError.yaml | 0 ...data-hub_behavior-validation_policies.yaml | 4 +- ..._v1_data-hub_data-validation_policies.yaml | 12 ++--- ...b_data-validation_policies_{policyId}.yaml | 36 ++++++++------ .../api/errors/PreconditionFailedError.java | 35 -------------- 15 files changed, 108 insertions(+), 59 deletions(-) create mode 100644 ext/openAPI/components/schemas/errors/datahub/DataPolicyNotFoundError.yaml create mode 100644 ext/openAPI/components/schemas/errors/datahub/TopicFilterMismatchError.yaml rename ext/openAPI/components/schemas/errors/{common => http}/InsufficientStorageError.yaml (100%) rename ext/openAPI/components/schemas/errors/{common => http}/InternalServerError.yaml (100%) rename ext/openAPI/components/schemas/errors/{common => http}/InvalidQueryParameterError.yaml (100%) rename ext/openAPI/components/schemas/errors/{common => http}/PreconditionFailedError.yaml (100%) rename ext/openAPI/components/schemas/errors/{common => http}/RequestBodyMissingError.yaml (100%) rename ext/openAPI/components/schemas/errors/{common => http}/TemporaryNotAvailableError.yaml (100%) rename ext/openAPI/components/schemas/errors/{common => http}/UrlParameterMissingError.yaml (100%) delete mode 100644 hivemq-edge/src/main/java/com/hivemq/api/errors/PreconditionFailedError.java diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index bc60dd0fad..9abaad05f2 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -1214,7 +1214,7 @@ paths: application/json: schema: $ref: '#/components/schemas/PreconditionFailedError' - description: Internal server error + description: Precondition failed '500': content: application/json: @@ -1437,15 +1437,23 @@ paths: anyOf: - $ref: '#/components/schemas/RequestBodyMissingError' - $ref: '#/components/schemas/UrlParameterMissingError' + - $ref: '#/components/schemas/DataPolicyCreationFailureError' - $ref: '#/components/schemas/DataPolicyValidationErrors' - $ref: '#/components/schemas/PolicyIdMismatchError' + - $ref: '#/components/schemas/TopicFilterMismatchError' description: DataPolicy creation failed '404': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/DataPolicyNotFoundError' description: DataPolicy not found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/PreconditionFailedError' + description: Precondition failed '500': content: application/json: @@ -5123,6 +5131,10 @@ components: id: type: string description: The policy id. + status: + type: integer + default: 409 + description: The HTTP status code. required: - id InternalServerError: @@ -5193,6 +5205,37 @@ components: required: - actualId - expectedId + TopicFilterMismatchError: + x-implements: + - com.hivemq.api.errors.OpenApiError + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + message: + type: string + description: The error message. + parameter: + type: string + description: The parameter. + required: + - parameter + DataPolicyNotFoundError: + x-implements: + - com.hivemq.api.errors.OpenApiError + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + message: + type: string + description: The error message. + status: + type: integer + default: 404 + description: The HTTP status code. + required: + - message PreconditionFailedError: x-implements: - com.hivemq.api.errors.OpenApiError diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyAlreadyPresentError.yaml b/ext/openAPI/components/schemas/errors/datahub/DataPolicyAlreadyPresentError.yaml index 60efe37123..29b5ebcac0 100644 --- a/ext/openAPI/components/schemas/errors/datahub/DataPolicyAlreadyPresentError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/DataPolicyAlreadyPresentError.yaml @@ -7,5 +7,9 @@ allOf: id: type: string description: The policy id. + status: + type: integer + default: 409 + description: The HTTP status code. required: - id diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyNotFoundError.yaml b/ext/openAPI/components/schemas/errors/datahub/DataPolicyNotFoundError.yaml new file mode 100644 index 0000000000..81f2c8897a --- /dev/null +++ b/ext/openAPI/components/schemas/errors/datahub/DataPolicyNotFoundError.yaml @@ -0,0 +1,15 @@ +x-implements: + - com.hivemq.api.errors.OpenApiError +allOf: + - $ref: "../ApiError.yaml" + - type: object + properties: + message: + type: string + description: The error message. + status: + type: integer + default: 404 + description: The HTTP status code. + required: + - message diff --git a/ext/openAPI/components/schemas/errors/datahub/TopicFilterMismatchError.yaml b/ext/openAPI/components/schemas/errors/datahub/TopicFilterMismatchError.yaml new file mode 100644 index 0000000000..d0692de5a3 --- /dev/null +++ b/ext/openAPI/components/schemas/errors/datahub/TopicFilterMismatchError.yaml @@ -0,0 +1,14 @@ +x-implements: + - com.hivemq.api.errors.OpenApiError +allOf: + - $ref: "../ApiError.yaml" + - type: object + properties: + message: + type: string + description: The error message. + parameter: + type: string + description: The parameter. + required: + - parameter diff --git a/ext/openAPI/components/schemas/errors/common/InsufficientStorageError.yaml b/ext/openAPI/components/schemas/errors/http/InsufficientStorageError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/common/InsufficientStorageError.yaml rename to ext/openAPI/components/schemas/errors/http/InsufficientStorageError.yaml diff --git a/ext/openAPI/components/schemas/errors/common/InternalServerError.yaml b/ext/openAPI/components/schemas/errors/http/InternalServerError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/common/InternalServerError.yaml rename to ext/openAPI/components/schemas/errors/http/InternalServerError.yaml diff --git a/ext/openAPI/components/schemas/errors/common/InvalidQueryParameterError.yaml b/ext/openAPI/components/schemas/errors/http/InvalidQueryParameterError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/common/InvalidQueryParameterError.yaml rename to ext/openAPI/components/schemas/errors/http/InvalidQueryParameterError.yaml diff --git a/ext/openAPI/components/schemas/errors/common/PreconditionFailedError.yaml b/ext/openAPI/components/schemas/errors/http/PreconditionFailedError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/common/PreconditionFailedError.yaml rename to ext/openAPI/components/schemas/errors/http/PreconditionFailedError.yaml diff --git a/ext/openAPI/components/schemas/errors/common/RequestBodyMissingError.yaml b/ext/openAPI/components/schemas/errors/http/RequestBodyMissingError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/common/RequestBodyMissingError.yaml rename to ext/openAPI/components/schemas/errors/http/RequestBodyMissingError.yaml diff --git a/ext/openAPI/components/schemas/errors/common/TemporaryNotAvailableError.yaml b/ext/openAPI/components/schemas/errors/http/TemporaryNotAvailableError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/common/TemporaryNotAvailableError.yaml rename to ext/openAPI/components/schemas/errors/http/TemporaryNotAvailableError.yaml diff --git a/ext/openAPI/components/schemas/errors/common/UrlParameterMissingError.yaml b/ext/openAPI/components/schemas/errors/http/UrlParameterMissingError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/common/UrlParameterMissingError.yaml rename to ext/openAPI/components/schemas/errors/http/UrlParameterMissingError.yaml diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies.yaml index 91e9c0746e..3dcc621974 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies.yaml @@ -271,7 +271,7 @@ post: application/json: schema: anyOf: - - $ref: "../components/schemas/errors/common/RequestBodyMissingError.yaml" + - $ref: "../components/schemas/errors/http/RequestBodyMissingError.yaml" - $ref: "../components/schemas/errors/datahub/BehaviorPolicyValidationErrors.yaml" description: Policy creation failed '409': @@ -290,7 +290,7 @@ post: content: application/json: schema: - $ref: "../components/schemas/errors/common/TemporaryNotAvailableError.yaml" + $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Temporarily unavailable '507': content: diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml index d37284d428..ca4ff92016 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml @@ -288,13 +288,13 @@ get: application/json: schema: anyOf: - - $ref: "../components/schemas/errors/common/InvalidQueryParameterError.yaml" + - $ref: "../components/schemas/errors/http/InvalidQueryParameterError.yaml" description: URL parameter missing '503': content: application/json: schema: - $ref: "../components/schemas/errors/common/TemporaryNotAvailableError.yaml" + $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable summary: Get all data policies tags: @@ -389,7 +389,7 @@ post: application/json: schema: anyOf: - - $ref: "../components/schemas/errors/common/RequestBodyMissingError.yaml" + - $ref: "../components/schemas/errors/http/RequestBodyMissingError.yaml" - $ref: "../components/schemas/errors/datahub/DataPolicyCreationFailureError.yaml" - $ref: "../components/schemas/errors/datahub/DataPolicyRejectedError.yaml" - $ref: "../components/schemas/errors/datahub/DataPolicyValidationErrors.yaml" @@ -405,19 +405,19 @@ post: content: application/json: schema: - $ref: "../components/schemas/errors/common/InternalServerError.yaml" + $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal server error '503': content: application/json: schema: - $ref: "../components/schemas/errors/common/TemporaryNotAvailableError.yaml" + $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable '507': content: application/json: schema: - $ref: "../components/schemas/errors/common/InsufficientStorageError.yaml" + $ref: "../components/schemas/errors/http/InsufficientStorageError.yaml" description: Insufficient storage summary: Create a new data policy tags: diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml index 5a92642512..8857848e9f 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml @@ -26,26 +26,26 @@ delete: application/json: schema: anyOf: - - $ref: "../components/schemas/errors/common/UrlParameterMissingError.yaml" + - $ref: "../components/schemas/errors/http/UrlParameterMissingError.yaml" - $ref: "../components/schemas/errors/datahub/PolicyNotFoundError.yaml" description: URL parameter missing '412': content: application/json: schema: - $ref: "../components/schemas/errors/common/PreconditionFailedError.yaml" - description: Internal server error + $ref: "../components/schemas/errors/http/PreconditionFailedError.yaml" + description: Precondition failed '500': content: application/json: schema: - $ref: "../components/schemas/errors/common/InternalServerError.yaml" + $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal server error '503': content: application/json: schema: - $ref: "../components/schemas/errors/common/TemporaryNotAvailableError.yaml" + $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable summary: Delete a data policy tags: @@ -131,7 +131,7 @@ get: detail: Required URL parameter 'parameterName' is missing schema: anyOf: - - $ref: "../components/schemas/errors/common/UrlParameterMissingError.yaml" + - $ref: "../components/schemas/errors/http/UrlParameterMissingError.yaml" - $ref: "../components/schemas/errors/datahub/PolicyNotFoundError.yaml" description: Bad request '404': @@ -152,13 +152,13 @@ get: content: application/json: schema: - $ref: "../components/schemas/errors/common/InternalServerError.yaml" + $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal server error '503': content: application/json: schema: - $ref: "../components/schemas/errors/common/TemporaryNotAvailableError.yaml" + $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable summary: Get a data policy tags: @@ -272,34 +272,42 @@ put: application/json: schema: anyOf: - - $ref: "../components/schemas/errors/common/RequestBodyMissingError.yaml" - - $ref: "../components/schemas/errors/common/UrlParameterMissingError.yaml" + - $ref: "../components/schemas/errors/http/RequestBodyMissingError.yaml" + - $ref: "../components/schemas/errors/http/UrlParameterMissingError.yaml" + - $ref: "../components/schemas/errors/datahub/DataPolicyCreationFailureError.yaml" - $ref: "../components/schemas/errors/datahub/DataPolicyValidationErrors.yaml" - $ref: "../components/schemas/errors/datahub/PolicyIdMismatchError.yaml" + - $ref: "../components/schemas/errors/datahub/TopicFilterMismatchError.yaml" description: DataPolicy creation failed '404': content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml + $ref: "../components/schemas/errors/datahub/DataPolicyNotFoundError.yaml" description: DataPolicy not found + '412': + content: + application/json: + schema: + $ref: "../components/schemas/errors/http/PreconditionFailedError.yaml" + description: Precondition failed '500': content: application/json: schema: - $ref: "../components/schemas/errors/common/InternalServerError.yaml" + $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal server error '503': content: application/json: schema: - $ref: "../components/schemas/errors/common/TemporaryNotAvailableError.yaml" + $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable '507': content: application/json: schema: - $ref: "../components/schemas/errors/common/InsufficientStorageError.yaml" + $ref: "../components/schemas/errors/http/InsufficientStorageError.yaml" description: Insufficient storage summary: Update an existing data policy tags: diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/PreconditionFailedError.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/PreconditionFailedError.java deleted file mode 100644 index 52da173129..0000000000 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/PreconditionFailedError.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2019-present HiveMQ GmbH - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.hivemq.api.errors; - -import com.hivemq.http.HttpStatus; -import com.hivemq.http.error.Error; -import com.hivemq.http.error.ProblemDetails; -import org.jetbrains.annotations.NotNull; - -import java.util.List; - -public class PreconditionFailedError extends ProblemDetails { - public PreconditionFailedError( - final @NotNull String cause) { - super( - "PreconditionFailed", - "Precondition Failed", - "A precondition required for fulfilling the request was not fulfilled", - HttpStatus.PRECONDITION_FAILED_412, - List.of(new Error(cause))); - } -} From 64e1313b68d6b6b01778e837a517cdd52575e5a0 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Fri, 30 May 2025 12:52:02 +0200 Subject: [PATCH 013/121] refactor: Refactor DataHub errors 2 --- ext/hivemq-edge-openapi-2025.9.yaml | 16 +- ...rors.yaml => DataPolicyInvalidErrors.yaml} | 0 .../errors/datahub/DataPolicyUserError.yaml | 4 + .../errors/datahub/PolicyNotFoundError.yaml | 4 + ..._v1_data-hub_data-validation_policies.yaml | 2 +- ...b_data-validation_policies_{policyId}.yaml | 4 +- .../api/errors/ValidationErrorFactory.java | 152 +++++++++++++++++ .../validation/EmptyFieldValidationError.java | 81 --------- .../InvalidFieldLengthValidationError.java | 155 ------------------ .../InvalidFieldValueValidationError.java | 98 ----------- .../InvalidIdentifierValidationError.java | 107 ------------ .../MissingFieldValidationError.java | 81 --------- .../UnsupportedFieldValidationError.java | 103 ------------ 13 files changed, 177 insertions(+), 630 deletions(-) rename ext/openAPI/components/schemas/errors/datahub/{DataPolicyValidationErrors.yaml => DataPolicyInvalidErrors.yaml} (100%) create mode 100644 ext/openAPI/components/schemas/errors/datahub/DataPolicyUserError.yaml create mode 100644 hivemq-edge/src/main/java/com/hivemq/api/errors/ValidationErrorFactory.java delete mode 100644 hivemq-edge/src/main/java/com/hivemq/api/errors/validation/EmptyFieldValidationError.java delete mode 100644 hivemq-edge/src/main/java/com/hivemq/api/errors/validation/InvalidFieldLengthValidationError.java delete mode 100644 hivemq-edge/src/main/java/com/hivemq/api/errors/validation/InvalidFieldValueValidationError.java delete mode 100644 hivemq-edge/src/main/java/com/hivemq/api/errors/validation/InvalidIdentifierValidationError.java delete mode 100644 hivemq-edge/src/main/java/com/hivemq/api/errors/validation/MissingFieldValidationError.java delete mode 100644 hivemq-edge/src/main/java/com/hivemq/api/errors/validation/UnsupportedFieldValidationError.java diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index 9abaad05f2..ff1d2f5743 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -1147,7 +1147,7 @@ paths: - $ref: '#/components/schemas/RequestBodyMissingError' - $ref: '#/components/schemas/DataPolicyCreationFailureError' - $ref: '#/components/schemas/DataPolicyRejectedError' - - $ref: '#/components/schemas/DataPolicyValidationErrors' + - $ref: '#/components/schemas/DataPolicyInvalidErrors' description: DataPolicy creation failed '409': content: @@ -1438,7 +1438,8 @@ paths: - $ref: '#/components/schemas/RequestBodyMissingError' - $ref: '#/components/schemas/UrlParameterMissingError' - $ref: '#/components/schemas/DataPolicyCreationFailureError' - - $ref: '#/components/schemas/DataPolicyValidationErrors' + - $ref: '#/components/schemas/DataPolicyUserError' + - $ref: '#/components/schemas/DataPolicyInvalidErrors' - $ref: '#/components/schemas/PolicyIdMismatchError' - $ref: '#/components/schemas/TopicFilterMismatchError' description: DataPolicy creation failed @@ -5116,7 +5117,7 @@ components: - com.hivemq.api.errors.OpenApiError allOf: - $ref: '#/components/schemas/ApiError' - DataPolicyValidationErrors: + DataPolicyInvalidErrors: x-implements: - com.hivemq.api.errors.OpenApiError allOf: @@ -5187,8 +5188,17 @@ components: id: type: string description: The policy id. + status: + type: integer + default: 404 + description: The HTTP status code. required: - id + DataPolicyUserError: + x-implements: + - com.hivemq.api.errors.OpenApiError + allOf: + - $ref: '#/components/schemas/ApiError' PolicyIdMismatchError: x-implements: - com.hivemq.api.errors.OpenApiError diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyValidationErrors.yaml b/ext/openAPI/components/schemas/errors/datahub/DataPolicyInvalidErrors.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/datahub/DataPolicyValidationErrors.yaml rename to ext/openAPI/components/schemas/errors/datahub/DataPolicyInvalidErrors.yaml diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyUserError.yaml b/ext/openAPI/components/schemas/errors/datahub/DataPolicyUserError.yaml new file mode 100644 index 0000000000..60375f8936 --- /dev/null +++ b/ext/openAPI/components/schemas/errors/datahub/DataPolicyUserError.yaml @@ -0,0 +1,4 @@ +x-implements: + - com.hivemq.api.errors.OpenApiError +allOf: + - $ref: "../ApiError.yaml" diff --git a/ext/openAPI/components/schemas/errors/datahub/PolicyNotFoundError.yaml b/ext/openAPI/components/schemas/errors/datahub/PolicyNotFoundError.yaml index 60efe37123..109e2249b1 100644 --- a/ext/openAPI/components/schemas/errors/datahub/PolicyNotFoundError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/PolicyNotFoundError.yaml @@ -7,5 +7,9 @@ allOf: id: type: string description: The policy id. + status: + type: integer + default: 404 + description: The HTTP status code. required: - id diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml index ca4ff92016..19e6857136 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml @@ -392,7 +392,7 @@ post: - $ref: "../components/schemas/errors/http/RequestBodyMissingError.yaml" - $ref: "../components/schemas/errors/datahub/DataPolicyCreationFailureError.yaml" - $ref: "../components/schemas/errors/datahub/DataPolicyRejectedError.yaml" - - $ref: "../components/schemas/errors/datahub/DataPolicyValidationErrors.yaml" + - $ref: "../components/schemas/errors/datahub/DataPolicyInvalidErrors.yaml" description: DataPolicy creation failed '409': content: diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml index 8857848e9f..22c42a9be1 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml @@ -275,7 +275,9 @@ put: - $ref: "../components/schemas/errors/http/RequestBodyMissingError.yaml" - $ref: "../components/schemas/errors/http/UrlParameterMissingError.yaml" - $ref: "../components/schemas/errors/datahub/DataPolicyCreationFailureError.yaml" - - $ref: "../components/schemas/errors/datahub/DataPolicyValidationErrors.yaml" + - $ref: "../components/schemas/errors/datahub/DataPolicyUserError.yaml" + - $ref: "../components/schemas/errors/datahub/DataPolicyInvalidErrors.\ + yaml" - $ref: "../components/schemas/errors/datahub/PolicyIdMismatchError.yaml" - $ref: "../components/schemas/errors/datahub/TopicFilterMismatchError.yaml" description: DataPolicy creation failed diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/ValidationErrorFactory.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/ValidationErrorFactory.java new file mode 100644 index 0000000000..dc3da79810 --- /dev/null +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/ValidationErrorFactory.java @@ -0,0 +1,152 @@ +/* + * Copyright 2019-present HiveMQ GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.hivemq.api.errors; + +import com.hivemq.edge.api.model.EmptyFieldValidationError; +import com.hivemq.edge.api.model.InvalidFieldLengthValidationError; +import com.hivemq.edge.api.model.InvalidFieldValueValidationError; +import com.hivemq.edge.api.model.InvalidIdentifierValidationError; +import com.hivemq.edge.api.model.MissingFieldValidationError; +import com.hivemq.edge.api.model.UnsupportedFieldValidationError; +import org.jetbrains.annotations.NotNull; + +public final class ValidationErrorFactory extends ErrorFactory { + private ValidationErrorFactory() { + super(); + } + + public static @NotNull EmptyFieldValidationError emptyFieldValidationError( + final @NotNull String field) { + return emptyFieldValidationError("Required field '" + field + "' is empty", field); + } + + public static @NotNull EmptyFieldValidationError emptyFieldValidationError( + final @NotNull String detail, + final @NotNull String field) { + return EmptyFieldValidationError.builder() + .type(type(EmptyFieldValidationError.class)) + .detail(detail) + .field(field) + .build(); + } + + public static @NotNull InvalidFieldLengthValidationError invalidFieldLengthValidationError( + final @NotNull String detail, + final @NotNull String field, + final @NotNull String value, + final int actualLength, + final int expectedMinimumLength, + final int expectedMaximumLength) { + return InvalidFieldLengthValidationError.builder() + .type(type(InvalidFieldLengthValidationError.class)) + .detail(detail) + .field(field) + .value(value) + .actualLength(actualLength) + .expectedMinimumLength(expectedMinimumLength) + .expectedMaximumLength(expectedMaximumLength) + .build(); + } + + public static @NotNull InvalidFieldValueValidationError invalidFieldValueValidationError( + final @NotNull String detail, + final @NotNull String field, + final @NotNull String value) { + return InvalidFieldValueValidationError.builder() + .type(type(InvalidFieldValueValidationError.class)) + .detail(detail) + .field(field) + .value(value) + .build(); + } + + public static @NotNull InvalidIdentifierValidationError invalidIdentifierValidationError( + final @NotNull String field, + final @NotNull String value) { + return invalidIdentifierValidationError("Identifier " + + field + + " must begin with a letter and may only consist of lowercase letters," + + " uppercase letters, numbers, periods, hyphens, and underscores", field, value); + } + + public static @NotNull InvalidIdentifierValidationError invalidIdentifierValidationError( + final @NotNull String detail, + final @NotNull String field, + final @NotNull String value) { + return InvalidIdentifierValidationError.builder() + .type(type(InvalidIdentifierValidationError.class)) + .detail(detail) + .field(field) + .value(value) + .build(); + } + + public static @NotNull MissingFieldValidationError missingFieldValidationError( + final @NotNull String field) { + return missingFieldValidationError("Required field '" + field + "' is missing.", field); + } + + public static @NotNull MissingFieldValidationError missingFieldValidationError( + final @NotNull String detail, + final @NotNull String field) { + return MissingFieldValidationError.builder() + .type(type(MissingFieldValidationError.class)) + .detail(detail) + .field(field) + .build(); + } + + public static @NotNull UnsupportedFieldValidationError unsupportedFieldValidationError( + final @NotNull String detail, + final @NotNull String field, + final @NotNull String actualValue, + final @NotNull String expectedValue) { + return UnsupportedFieldValidationError.builder() + .type(type(UnsupportedFieldValidationError.class)) + .detail(detail) + .field(field) + .actualValue(actualValue) + .expectedValue(expectedValue) + .build(); + } + + public static @NotNull UnsupportedFieldValidationError unsupportedFieldValidationErrorByType( + final @NotNull String field, + final @NotNull String actualType, + final @NotNull String expectedType) { + return unsupportedFieldValidationError("Unsupported type '" + + actualType + + " for field '" + + field + + "'. Expected type is '" + + expectedType + + "'.", field, actualType, expectedType); + } + + public static @NotNull UnsupportedFieldValidationError unsupportedFieldValidationErrorByValue( + final @NotNull String field, + final @NotNull String actualValue, + final @NotNull String expectedValue) { + return unsupportedFieldValidationError("Unsupported value '" + + actualValue + + " for field '" + + field + + "'. Expected value is '" + + expectedValue + + "'.", field, actualValue, expectedValue); + } +} diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/EmptyFieldValidationError.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/EmptyFieldValidationError.java deleted file mode 100644 index a611e7b50c..0000000000 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/EmptyFieldValidationError.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright 2019-present HiveMQ GmbH - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.hivemq.api.errors.validation; - -import com.fasterxml.jackson.annotation.JsonProperty; -import org.jetbrains.annotations.NotNull; - -import java.util.Objects; - -public final class EmptyFieldValidationError extends ValidationError { - @JsonProperty("field") - private @NotNull String field; - - private EmptyFieldValidationError(final @NotNull String detail, @NotNull final String field) { - super(detail); - setField(field); - } - - public static @NotNull EmptyFieldValidationError of(final @NotNull String field) { - return new EmptyFieldValidationError("Required field '" + field + "' is empty", field); - } - - public static @NotNull EmptyFieldValidationError of(final @NotNull String detail, final @NotNull String field) { - return new EmptyFieldValidationError(detail, field); - } - - public @NotNull String getField() { - return field; - } - - public @NotNull EmptyFieldValidationError setField(@NotNull final String field) { - this.field = Objects.requireNonNull(field); - return this; - } - - @Override - public @NotNull String toString() { - return "EmptyFieldValidationError{" + - "field='" + - field + - '\'' + - ", detail='" + - detail + - '\'' + - ", type='" + - type + - '\'' + - '}'; - } - - @Override - public boolean equals(final Object o) { - if (o == null || getClass() != o.getClass()) { - return false; - } - if (!super.equals(o)) { - return false; - } - final EmptyFieldValidationError that = (EmptyFieldValidationError) o; - return Objects.equals(field, that.field); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), field); - } -} diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/InvalidFieldLengthValidationError.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/InvalidFieldLengthValidationError.java deleted file mode 100644 index abf41d4a1d..0000000000 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/InvalidFieldLengthValidationError.java +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright 2019-present HiveMQ GmbH - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.hivemq.api.errors.validation; - -import com.fasterxml.jackson.annotation.JsonProperty; -import org.jetbrains.annotations.NotNull; - -import java.util.Objects; - -public final class InvalidFieldLengthValidationError extends ValidationError { - @JsonProperty("actualLength") - private int actualLength; - @JsonProperty("expectedMinimumLength") - private int expectedMinimumLength; - @JsonProperty("expectedMaximumLength") - private int expectedMaximumLength; - @JsonProperty("field") - private @NotNull String field; - @JsonProperty("value") - private @NotNull String value; - - private InvalidFieldLengthValidationError( - final @NotNull String detail, - final @NotNull String field, - final @NotNull String value, - final int actualLength, - final int expectedMinimumLength, - final int expectedMaximumLength) { - super(detail); - setActualLength(actualLength); - setExpectedMinimumLength(expectedMinimumLength); - setExpectedMaximumLength(expectedMaximumLength); - setField(field); - setValue(value); - } - - public static @NotNull InvalidFieldLengthValidationError of( - final @NotNull String detail, - final @NotNull String field, - final @NotNull String value, - final int actualLength, - final int expectedMinimumLength, - final int expectedMaximumLength) { - return new InvalidFieldLengthValidationError(detail, - field, - value, - actualLength, - expectedMinimumLength, - expectedMaximumLength); - } - - @Override - public @NotNull String toString() { - return "InvalidFieldLengthValidationError{" + - "actualLength=" + - actualLength + - ", expectedMinimumLength=" + - expectedMinimumLength + - ", expectedMaximumLength=" + - expectedMaximumLength + - ", field='" + - field + - '\'' + - ", value='" + - value + - '\'' + - ", detail='" + - detail + - '\'' + - ", type='" + - type + - '\'' + - '}'; - } - - @Override - public boolean equals(final Object o) { - if (o == null || getClass() != o.getClass()) { - return false; - } - if (!super.equals(o)) { - return false; - } - final InvalidFieldLengthValidationError that = (InvalidFieldLengthValidationError) o; - return actualLength == that.actualLength && - expectedMinimumLength == that.expectedMinimumLength && - expectedMaximumLength == that.expectedMaximumLength && - Objects.equals(field, that.field) && - Objects.equals(value, that.value); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), actualLength, expectedMinimumLength, expectedMaximumLength, field, value); - } - - public int getActualLength() { - return actualLength; - } - - public @NotNull InvalidFieldLengthValidationError setActualLength(final int actualLength) { - this.actualLength = actualLength; - return this; - } - - public int getExpectedMinimumLength() { - return expectedMinimumLength; - } - - public @NotNull InvalidFieldLengthValidationError setExpectedMinimumLength(final int expectedMinimumLength) { - this.expectedMinimumLength = expectedMinimumLength; - return this; - } - - public int getExpectedMaximumLength() { - return expectedMaximumLength; - } - - public @NotNull InvalidFieldLengthValidationError setExpectedMaximumLength(final int expectedMaximumLength) { - this.expectedMaximumLength = expectedMaximumLength; - return this; - } - - public @NotNull String getValue() { - return value; - } - - public @NotNull InvalidFieldLengthValidationError setValue(final @NotNull String value) { - this.value = Objects.requireNonNull(value); - return this; - } - - public @NotNull String getField() { - return field; - } - - public @NotNull InvalidFieldLengthValidationError setField(final @NotNull String field) { - this.field = Objects.requireNonNull(field); - return this; - } -} diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/InvalidFieldValueValidationError.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/InvalidFieldValueValidationError.java deleted file mode 100644 index 83ec93a299..0000000000 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/InvalidFieldValueValidationError.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright 2019-present HiveMQ GmbH - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.hivemq.api.errors.validation; - -import com.fasterxml.jackson.annotation.JsonProperty; -import org.jetbrains.annotations.NotNull; - -import java.util.Objects; - -public final class InvalidFieldValueValidationError extends ValidationError { - @JsonProperty("field") - private @NotNull String field; - @JsonProperty("value") - private @NotNull String value; - - private InvalidFieldValueValidationError( - final @NotNull String detail, - final @NotNull String field, - final @NotNull String value) { - super(detail); - setField(field); - setValue(value); - } - - public static @NotNull InvalidFieldValueValidationError of( - final @NotNull String detail, - final @NotNull String field, - final @NotNull String value) { - return new InvalidFieldValueValidationError(detail, field, value); - } - - @Override - public @NotNull String toString() { - return "InvalidFieldValueValidationError{" + - "field='" + - field + - '\'' + - ", value='" + - value + - '\'' + - ", detail='" + - detail + - '\'' + - ", type='" + - type + - '\'' + - '}'; - } - - @Override - public boolean equals(final Object o) { - if (o == null || getClass() != o.getClass()) { - return false; - } - if (!super.equals(o)) { - return false; - } - final InvalidFieldValueValidationError that = (InvalidFieldValueValidationError) o; - return Objects.equals(field, that.field) && Objects.equals(value, that.value); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), field, value); - } - - public @NotNull String getValue() { - return value; - } - - public @NotNull InvalidFieldValueValidationError setValue(final @NotNull String value) { - this.value = Objects.requireNonNull(value); - return this; - } - - public @NotNull String getField() { - return field; - } - - public @NotNull InvalidFieldValueValidationError setField(final @NotNull String field) { - this.field = Objects.requireNonNull(field); - return this; - } -} diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/InvalidIdentifierValidationError.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/InvalidIdentifierValidationError.java deleted file mode 100644 index ac12e06a87..0000000000 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/InvalidIdentifierValidationError.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright 2019-present HiveMQ GmbH - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.hivemq.api.errors.validation; - -import com.fasterxml.jackson.annotation.JsonProperty; -import org.jetbrains.annotations.NotNull; - -import java.util.Objects; - -public final class InvalidIdentifierValidationError extends ValidationError { - @JsonProperty("field") - private @NotNull String field; - @JsonProperty("value") - private @NotNull String value; - - private InvalidIdentifierValidationError( - final @NotNull String detail, - final @NotNull String field, - final @NotNull String value) { - super(detail); - setField(field); - setValue(value); - } - - public static @NotNull InvalidIdentifierValidationError of( - final @NotNull String field, - final @NotNull String value) { - return new InvalidIdentifierValidationError("Identifier " + - field + - " must begin with a letter and may only consist of lowercase letters," + - " uppercase letters, numbers, periods, hyphens, and underscores", field, value); - } - - public static @NotNull InvalidIdentifierValidationError of( - final @NotNull String detail, - final @NotNull String field, - final @NotNull String value) { - return new InvalidIdentifierValidationError(detail, field, value); - } - - @Override - public @NotNull String toString() { - return "InvalidIdentifierValidationError{" + - "field='" + - field + - '\'' + - ", value='" + - value + - '\'' + - ", detail='" + - detail + - '\'' + - ", type='" + - type + - '\'' + - '}'; - } - - @Override - public boolean equals(final Object o) { - if (o == null || getClass() != o.getClass()) { - return false; - } - if (!super.equals(o)) { - return false; - } - final InvalidIdentifierValidationError that = (InvalidIdentifierValidationError) o; - return Objects.equals(field, that.field) && Objects.equals(value, that.value); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), field, value); - } - - public @NotNull String getValue() { - return value; - } - - public @NotNull InvalidIdentifierValidationError setValue(final @NotNull String value) { - this.value = Objects.requireNonNull(value); - return this; - } - - public @NotNull String getField() { - return field; - } - - public @NotNull InvalidIdentifierValidationError setField(final @NotNull String field) { - this.field = Objects.requireNonNull(field); - return this; - } -} diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/MissingFieldValidationError.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/MissingFieldValidationError.java deleted file mode 100644 index 03bbbd6b7e..0000000000 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/MissingFieldValidationError.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright 2019-present HiveMQ GmbH - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.hivemq.api.errors.validation; - -import com.fasterxml.jackson.annotation.JsonProperty; -import org.jetbrains.annotations.NotNull; - -import java.util.Objects; - -public final class MissingFieldValidationError extends ValidationError { - @JsonProperty("field") - private @NotNull String field; - - private MissingFieldValidationError(final @NotNull String detail, @NotNull final String field) { - super(detail); - setField(field); - } - - public static @NotNull MissingFieldValidationError of(final @NotNull String field) { - return new MissingFieldValidationError("Required field '" + field + "' is missing", field); - } - - public static @NotNull MissingFieldValidationError of(final @NotNull String detail, final @NotNull String field) { - return new MissingFieldValidationError(detail, field); - } - - public @NotNull String getField() { - return field; - } - - public @NotNull MissingFieldValidationError setField(@NotNull final String field) { - this.field = Objects.requireNonNull(field); - return this; - } - - @Override - public @NotNull String toString() { - return "MissingFieldValidationError{" + - "field='" + - field + - '\'' + - ", detail='" + - detail + - '\'' + - ", type='" + - type + - '\'' + - '}'; - } - - @Override - public boolean equals(final Object o) { - if (o == null || getClass() != o.getClass()) { - return false; - } - if (!super.equals(o)) { - return false; - } - final MissingFieldValidationError that = (MissingFieldValidationError) o; - return Objects.equals(field, that.field); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), field); - } -} diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/UnsupportedFieldValidationError.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/UnsupportedFieldValidationError.java deleted file mode 100644 index c703513b3a..0000000000 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/UnsupportedFieldValidationError.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright 2019-present HiveMQ GmbH - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.hivemq.api.errors.validation; - -import com.fasterxml.jackson.annotation.JsonProperty; -import org.jetbrains.annotations.NotNull; - -import java.util.Objects; - -public final class UnsupportedFieldValidationError extends ValidationError { - @JsonProperty("actualValue") - private @NotNull String actualValue; - @JsonProperty("expectedValue") - private @NotNull String expectedValue; - @JsonProperty("field") - private @NotNull String field; - - private UnsupportedFieldValidationError( - final @NotNull String detail, - final @NotNull String field, - final @NotNull String actualValue, - final @NotNull String expectedValue) { - super(detail); - setActualValue(actualValue); - setExpectedValue(expectedValue); - setField(field); - } - - public static @NotNull UnsupportedFieldValidationError of( - final @NotNull String detail, - final @NotNull String field, - final @NotNull String actualValue, - final @NotNull String expectedValue) { - return new UnsupportedFieldValidationError(detail, field, actualValue, expectedValue); - } - - public static @NotNull UnsupportedFieldValidationError ofType( - final @NotNull String field, - final @NotNull String actualType, - final @NotNull String expectedType) { - return new UnsupportedFieldValidationError("Unsupported type '" + - actualType + - " for field '" + - field + - "'. Expected type is '" + - expectedType + - "'.", field, actualType, expectedType); - } - - public static @NotNull UnsupportedFieldValidationError ofValue( - final @NotNull String field, - final @NotNull String actualValue, - final @NotNull String expectedValue) { - return new UnsupportedFieldValidationError("Unsupported value '" + - actualValue + - " for field '" + - field + - "'. Expected value is '" + - expectedValue + - "'.", field, actualValue, expectedValue); - } - - public @NotNull String getExpectedValue() { - return expectedValue; - } - - public @NotNull UnsupportedFieldValidationError setExpectedValue(@NotNull final String expectedValue) { - this.expectedValue = Objects.requireNonNull(expectedValue); - return this; - } - - public @NotNull String getActualValue() { - return actualValue; - } - - public @NotNull UnsupportedFieldValidationError setActualValue(final @NotNull String actualValue) { - this.actualValue = Objects.requireNonNull(actualValue); - return this; - } - - public @NotNull String getField() { - return field; - } - - public @NotNull UnsupportedFieldValidationError setField(final @NotNull String field) { - this.field = Objects.requireNonNull(field); - return this; - } -} From 35e8581e0fdc38ea00658129da28eeea3a19222a Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Fri, 30 May 2025 13:00:33 +0200 Subject: [PATCH 014/121] refactor: Refactor DataHub errors 3 --- ext/hivemq-edge-openapi-2025.9.yaml | 12 +-- ..._v1_data-hub_data-validation_policies.yaml | 2 +- ...b_data-validation_policies_{policyId}.yaml | 3 +- .../errors/validation/ValidationError.java | 77 ---------------- .../errors/validation/ValidationErrors.java | 87 ------------------- 5 files changed, 8 insertions(+), 173 deletions(-) delete mode 100644 hivemq-edge/src/main/java/com/hivemq/api/errors/validation/ValidationError.java delete mode 100644 hivemq-edge/src/main/java/com/hivemq/api/errors/validation/ValidationErrors.java diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index ff1d2f5743..0bf101ca47 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -1146,8 +1146,8 @@ paths: anyOf: - $ref: '#/components/schemas/RequestBodyMissingError' - $ref: '#/components/schemas/DataPolicyCreationFailureError' - - $ref: '#/components/schemas/DataPolicyRejectedError' - $ref: '#/components/schemas/DataPolicyInvalidErrors' + - $ref: '#/components/schemas/DataPolicyRejectedError' description: DataPolicy creation failed '409': content: @@ -1438,8 +1438,8 @@ paths: - $ref: '#/components/schemas/RequestBodyMissingError' - $ref: '#/components/schemas/UrlParameterMissingError' - $ref: '#/components/schemas/DataPolicyCreationFailureError' - - $ref: '#/components/schemas/DataPolicyUserError' - $ref: '#/components/schemas/DataPolicyInvalidErrors' + - $ref: '#/components/schemas/DataPolicyUserError' - $ref: '#/components/schemas/PolicyIdMismatchError' - $ref: '#/components/schemas/TopicFilterMismatchError' description: DataPolicy creation failed @@ -5112,16 +5112,16 @@ components: description: The actual reason. required: - reason - DataPolicyRejectedError: + DataPolicyInvalidErrors: x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: '#/components/schemas/ApiError' - DataPolicyInvalidErrors: + - $ref: '#/components/schemas/ValidationErrors' + DataPolicyRejectedError: x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: '#/components/schemas/ValidationErrors' + - $ref: '#/components/schemas/ApiError' DataPolicyAlreadyPresentError: x-implements: - com.hivemq.api.errors.OpenApiError diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml index 19e6857136..ca4bb076ba 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml @@ -391,8 +391,8 @@ post: anyOf: - $ref: "../components/schemas/errors/http/RequestBodyMissingError.yaml" - $ref: "../components/schemas/errors/datahub/DataPolicyCreationFailureError.yaml" - - $ref: "../components/schemas/errors/datahub/DataPolicyRejectedError.yaml" - $ref: "../components/schemas/errors/datahub/DataPolicyInvalidErrors.yaml" + - $ref: "../components/schemas/errors/datahub/DataPolicyRejectedError.yaml" description: DataPolicy creation failed '409': content: diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml index 22c42a9be1..7c12bc4cbe 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml @@ -275,9 +275,8 @@ put: - $ref: "../components/schemas/errors/http/RequestBodyMissingError.yaml" - $ref: "../components/schemas/errors/http/UrlParameterMissingError.yaml" - $ref: "../components/schemas/errors/datahub/DataPolicyCreationFailureError.yaml" + - $ref: "../components/schemas/errors/datahub/DataPolicyInvalidErrors.yaml" - $ref: "../components/schemas/errors/datahub/DataPolicyUserError.yaml" - - $ref: "../components/schemas/errors/datahub/DataPolicyInvalidErrors.\ - yaml" - $ref: "../components/schemas/errors/datahub/PolicyIdMismatchError.yaml" - $ref: "../components/schemas/errors/datahub/TopicFilterMismatchError.yaml" description: DataPolicy creation failed diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/ValidationError.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/ValidationError.java deleted file mode 100644 index e327c34f54..0000000000 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/ValidationError.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright 2019-present HiveMQ GmbH - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.hivemq.api.errors.validation; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.hivemq.api.errors.ApiError; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import java.util.Objects; - -public abstract class ValidationError> { - @JsonProperty("detail") - protected @NotNull String detail; - @JsonProperty("type") - protected @NotNull String type; - - protected ValidationError(@NotNull final String detail) { - this(detail, null); - } - - protected ValidationError(@NotNull final String detail, final @Nullable String type) { - setDetail(detail); - setType(type); - } - - public @NotNull String getDetail() { - return detail; - } - - public @NotNull ValidationError setDetail(@NotNull final String detail) { - this.detail = Objects.requireNonNull(detail); - return this; - } - - public @NotNull String getType() { - return type; - } - - public @NotNull ValidationError setType(final @Nullable String type) { - this.type = type == null ? ApiError.getTypeFromClassName(getClass()) : type; - return this; - } - - @Override - public @NotNull String toString() { - return "ValidationError{" + "detail='" + detail + '\'' + ", type='" + type + '\'' + '}'; - } - - @Override - public boolean equals(final @Nullable Object o) { - if (o == null || getClass() != o.getClass()) { - return false; - } - final ValidationError that = (ValidationError) o; - return Objects.equals(detail, that.detail) && Objects.equals(type, that.type); - } - - @Override - public int hashCode() { - return Objects.hash(detail, type); - } -} diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/ValidationErrors.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/ValidationErrors.java deleted file mode 100644 index 41bb7f9141..0000000000 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/validation/ValidationErrors.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright 2019-present HiveMQ GmbH - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.hivemq.api.errors.validation; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.hivemq.api.errors.ApiError; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -public abstract class ValidationErrors extends ApiError> { - @JsonProperty("errors") - protected final @NotNull List> errors; - - protected ValidationErrors( - final @NotNull String title, - final @Nullable String detail, - final @Nullable List> errors, - final int status, - final @Nullable String code) { - super(title, detail, status, code); - this.errors = new ArrayList<>(); - if (errors != null && !errors.isEmpty()) { - this.errors.addAll(errors); - } - } - - @Override - public @NotNull String toString() { - return "ValidationErrors{" + - "errors=" + - errors + - ", code='" + - code + - '\'' + - ", detail='" + - detail + - '\'' + - ", status=" + - status + - ", title='" + - title + - '\'' + - ", type='" + - type + - '\'' + - '}'; - } - - @Override - public boolean equals(final @Nullable Object o) { - if (o == null || getClass() != o.getClass()) { - return false; - } - if (!super.equals(o)) { - return false; - } - final ValidationErrors that = (ValidationErrors) o; - return Objects.equals(errors, that.errors); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), errors); - } - - public @NotNull List> getErrors() { - return errors; - } -} From 60b21994cd6448e03a56986c251549027a1548f1 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Fri, 30 May 2025 13:40:00 +0200 Subject: [PATCH 015/121] refactor: Clean up ApiError --- .../java/com/hivemq/api/errors/ApiError.java | 153 ------------------ .../com/hivemq/util/ErrorResponseUtil.java | 8 - 2 files changed, 161 deletions(-) delete mode 100644 hivemq-edge/src/main/java/com/hivemq/api/errors/ApiError.java diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/ApiError.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/ApiError.java deleted file mode 100644 index 0190124e84..0000000000 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/ApiError.java +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Copyright 2019-present HiveMQ GmbH - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.hivemq.api.errors; - -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.v3.oas.annotations.media.Schema; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import java.util.Objects; - -public abstract class ApiError> { - private static final String CLASS_PREFIX = "com.hivemq"; - private static final String TYPE_PREFIX = "https://hivemq.com"; - - @JsonProperty("code") - @Schema(description = "Correlation id") - protected @Nullable String code; - - @JsonProperty("detail") - protected @Nullable String detail; - - @JsonProperty("status") - protected int status; - - @JsonProperty(value = "title", required = true) - protected @NotNull String title; - - @JsonProperty(value = "type") - protected @NotNull String type; - - protected ApiError( - final @NotNull String title, - final @Nullable String detail, - final int status, - final @Nullable String code) { - this(null, title, detail, status, code); - } - - protected ApiError( - final @Nullable String type, - final @NotNull String title, - final @Nullable String detail, - final int status, - final @Nullable String code) { - setCode(code); - setDetail(detail); - setStatus(status); - setTitle(title); - setType(type); - } - - public static String getTypeFromClassName(final @NotNull Class clazz) { - return TYPE_PREFIX + clazz.getName().substring(CLASS_PREFIX.length()).replace(".", "/"); - } - - public @Nullable String getCode() { - return code; - } - - public @NotNull ApiError setCode(@Nullable final String code) { - this.code = code; - return this; - } - - public @Nullable String getDetail() { - return detail; - } - - public @NotNull ApiError setDetail(@Nullable final String detail) { - this.detail = detail; - return this; - } - - public int getStatus() { - return status; - } - - public @NotNull ApiError setStatus(final int status) { - this.status = status; - return this; - } - - public @NotNull String getTitle() { - return title; - } - - public @NotNull ApiError setTitle(@NotNull final String title) { - this.title = Objects.requireNonNull(title); - return this; - } - - public @NotNull String getType() { - return type; - } - - public @NotNull ApiError setType(@Nullable final String type) { - this.type = type == null ? getTypeFromClassName(getClass()) : type; - return this; - } - - @Override - public @NotNull String toString() { - return "ErrorBase{" + - "code='" + - code + - '\'' + - ", detail='" + - detail + - '\'' + - ", status=" + - status + - ", title='" + - title + - '\'' + - ", type='" + - type + - '\'' + - '}'; - } - - @Override - public boolean equals(final @Nullable Object o) { - if (o == null || getClass() != o.getClass()) { - return false; - } - final ApiError errorBase = (ApiError) o; - return status == errorBase.status && - Objects.equals(code, errorBase.code) && - Objects.equals(detail, errorBase.detail) && - Objects.equals(title, errorBase.title) && - Objects.equals(type, errorBase.type); - } - - @Override - public int hashCode() { - return Objects.hash(code, detail, status, title, type); - } -} diff --git a/hivemq-edge/src/main/java/com/hivemq/util/ErrorResponseUtil.java b/hivemq-edge/src/main/java/com/hivemq/util/ErrorResponseUtil.java index 25f74ebac7..7f14275922 100644 --- a/hivemq-edge/src/main/java/com/hivemq/util/ErrorResponseUtil.java +++ b/hivemq-edge/src/main/java/com/hivemq/util/ErrorResponseUtil.java @@ -15,7 +15,6 @@ */ package com.hivemq.util; -import com.hivemq.api.errors.ApiError; import com.hivemq.api.errors.OpenApiError; import com.hivemq.http.error.ProblemDetails; import org.jetbrains.annotations.NotNull; @@ -39,11 +38,4 @@ public class ErrorResponseUtil { .header("Content-Type", "application/json;charset=utf-8") .build(); } - - public static @NotNull Response errorResponse(final @NotNull ApiError error) { - return Response.status(error.getStatus()) - .entity(error) - .header("Content-Type", "application/json;charset=utf-8") - .build(); - } } From 2a802760f5d4a8930ab14ab5a6b194987ae2cb4c Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Fri, 30 May 2025 14:01:17 +0200 Subject: [PATCH 016/121] refactor: Update get by id for behavior policy --- ext/hivemq-edge-openapi-2025.9.yaml | 169 +++++++++--------- ...data-hub_behavior-validation_policies.yaml | 11 +- ...havior-validation_policies_{policyId}.yaml | 19 +- ...b_data-validation_policies_{policyId}.yaml | 19 +- 4 files changed, 112 insertions(+), 106 deletions(-) diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index 0bf101ca47..9c1835da23 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -352,12 +352,19 @@ paths: schema: $ref: '#/components/schemas/BehaviorPolicyList' description: Success + '400': + content: + application/json: + schema: + anyOf: + - $ref: '#/components/schemas/InvalidQueryParameterError' + description: URL parameter missing '503': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporarily not available + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Get all policies tags: - Data Hub - Behavior Policies @@ -598,14 +605,27 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Invalid query parameter + anyOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + description: Bad request '404': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/PolicyNotFoundError' description: Policy not found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerError' + description: Internal server error + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Get a policy tags: - Data Hub - Behavior Policies @@ -1294,32 +1314,15 @@ paths: '400': content: application/json: - examples: - param-missing: - description: Example response when a required parameter is missing. - summary: Required URL parameter missing - value: - errors: - - title: Required parameter missing - detail: Required URL parameter 'parameterName' is missing schema: anyOf: - $ref: '#/components/schemas/UrlParameterMissingError' - - $ref: '#/components/schemas/PolicyNotFoundError' description: Bad request '404': content: application/json: - examples: - not-found: - description: Policy not found - summary: Not found - value: - errors: - - title: Resource not found - detail: Resource with id 'my-resource-id' not found schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/PolicyNotFoundError' description: Resource not found '500': content: @@ -4698,6 +4701,33 @@ components: - title - status - type + InvalidQueryParameterError: + x-implements: + - com.hivemq.api.errors.OpenApiError + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + parameter: + type: string + description: The query parameter. + reason: + type: string + description: The reason. + required: + - parameter + - reason + TemporaryNotAvailableError: + x-implements: + - com.hivemq.api.errors.OpenApiError + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + status: + type: integer + default: 503 + description: The HTTP status code. RequestBodyMissingError: x-implements: - com.hivemq.api.errors.OpenApiError @@ -4952,16 +4982,47 @@ components: - com.hivemq.api.errors.OpenApiError allOf: - $ref: '#/components/schemas/ValidationErrors' - TemporaryNotAvailableError: + UrlParameterMissingError: + x-implements: + - com.hivemq.api.errors.OpenApiError + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + parameter: + type: string + description: The name of the missing parameter. + required: + - parameter + PolicyNotFoundError: + x-implements: + - com.hivemq.api.errors.OpenApiError + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The policy id. + status: + type: integer + default: 404 + description: The HTTP status code. + required: + - id + InternalServerError: x-implements: - com.hivemq.api.errors.OpenApiError allOf: - $ref: '#/components/schemas/ApiError' - type: object properties: + reason: + type: string + description: The actual reason. status: type: integer - default: 503 + default: 500 description: The HTTP status code. JsonNode: type: object @@ -5084,22 +5145,6 @@ components: description: List of result items that are returned by this endpoint items: $ref: '#/components/schemas/DataPolicy' - InvalidQueryParameterError: - x-implements: - - com.hivemq.api.errors.OpenApiError - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - parameter: - type: string - description: The query parameter. - reason: - type: string - description: The reason. - required: - - parameter - - reason DataPolicyCreationFailureError: x-implements: - com.hivemq.api.errors.OpenApiError @@ -5138,20 +5183,6 @@ components: description: The HTTP status code. required: - id - InternalServerError: - x-implements: - - com.hivemq.api.errors.OpenApiError - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - reason: - type: string - description: The actual reason. - status: - type: integer - default: 500 - description: The HTTP status code. InsufficientStorageError: x-implements: - com.hivemq.api.errors.OpenApiError @@ -5166,34 +5197,6 @@ components: type: integer default: 507 description: The HTTP status code. - UrlParameterMissingError: - x-implements: - - com.hivemq.api.errors.OpenApiError - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - parameter: - type: string - description: The name of the missing parameter. - required: - - parameter - PolicyNotFoundError: - x-implements: - - com.hivemq.api.errors.OpenApiError - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The policy id. - status: - type: integer - default: 404 - description: The HTTP status code. - required: - - id DataPolicyUserError: x-implements: - com.hivemq.api.errors.OpenApiError diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies.yaml index 3dcc621974..6fbb5adf69 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies.yaml @@ -178,12 +178,19 @@ get: schema: $ref: ../components/schemas/BehaviorPolicyList.yaml description: Success + '400': + content: + application/json: + schema: + anyOf: + - $ref: "../components/schemas/errors/http/InvalidQueryParameterError.yaml" + description: URL parameter missing '503': content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml - description: Temporarily not available + $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" + description: Request resource temporary unavailable summary: Get all policies tags: - Data Hub - Behavior Policies diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies_{policyId}.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies_{policyId}.yaml index afd96ea8d4..73f92a39c2 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies_{policyId}.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies_{policyId}.yaml @@ -123,14 +123,27 @@ get: content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml - description: Invalid query parameter + anyOf: + - $ref: "../components/schemas/errors/http/UrlParameterMissingError.yaml" + description: Bad request '404': content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml + $ref: "../components/schemas/errors/datahub/PolicyNotFoundError.yaml" description: Policy not found + '500': + content: + application/json: + schema: + $ref: "../components/schemas/errors/http/InternalServerError.yaml" + description: Internal server error + '503': + content: + application/json: + schema: + $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" + description: Request resource temporary unavailable summary: Get a policy tags: - Data Hub - Behavior Policies diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml index 7c12bc4cbe..c24b2bb0e7 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml @@ -121,32 +121,15 @@ get: '400': content: application/json: - examples: - param-missing: - description: Example response when a required parameter is missing. - summary: Required URL parameter missing - value: - errors: - - title: Required parameter missing - detail: Required URL parameter 'parameterName' is missing schema: anyOf: - $ref: "../components/schemas/errors/http/UrlParameterMissingError.yaml" - - $ref: "../components/schemas/errors/datahub/PolicyNotFoundError.yaml" description: Bad request '404': content: application/json: - examples: - not-found: - description: Policy not found - summary: Not found - value: - errors: - - title: Resource not found - detail: Resource with id 'my-resource-id' not found schema: - $ref: ../components/schemas/ProblemDetails.yaml + $ref: "../components/schemas/errors/datahub/PolicyNotFoundError.yaml" description: Resource not found '500': content: From ae5ec89ba56c5b954d23e4ca33b3cae258b4d860 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Fri, 30 May 2025 15:05:33 +0200 Subject: [PATCH 017/121] refactor: Resolve comments from PR --- ext/hivemq-edge-openapi-2025.9.yaml | 37 ++++++++++++++----- .../components/schemas/errors/ApiError.yaml | 2 + ...data-hub_behavior-validation_policies.yaml | 8 +++- ...havior-validation_policies_{policyId}.yaml | 4 +- ..._v1_data-hub_data-validation_policies.yaml | 11 ++++-- ...b_data-validation_policies_{policyId}.yaml | 12 ++++-- 6 files changed, 54 insertions(+), 20 deletions(-) diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index 9c1835da23..8aeb73b3c3 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -356,8 +356,10 @@ paths: content: application/json: schema: - anyOf: + oneOf: - $ref: '#/components/schemas/InvalidQueryParameterError' + discriminator: + propertyName: type description: URL parameter missing '503': content: @@ -451,9 +453,11 @@ paths: content: application/json: schema: - anyOf: + oneOf: - $ref: '#/components/schemas/RequestBodyMissingError' - $ref: '#/components/schemas/BehaviorPolicyValidationErrors' + discriminator: + propertyName: type description: Policy creation failed '409': content: @@ -605,8 +609,10 @@ paths: content: application/json: schema: - anyOf: + oneOf: - $ref: '#/components/schemas/UrlParameterMissingError' + discriminator: + propertyName: type description: Bad request '404': content: @@ -1070,8 +1076,10 @@ paths: content: application/json: schema: - anyOf: + oneOf: - $ref: '#/components/schemas/InvalidQueryParameterError' + discriminator: + propertyName: type description: URL parameter missing '503': content: @@ -1163,18 +1171,19 @@ paths: content: application/json: schema: - anyOf: + oneOf: - $ref: '#/components/schemas/RequestBodyMissingError' - $ref: '#/components/schemas/DataPolicyCreationFailureError' - $ref: '#/components/schemas/DataPolicyInvalidErrors' - $ref: '#/components/schemas/DataPolicyRejectedError' + discriminator: + propertyName: type description: DataPolicy creation failed '409': content: application/json: schema: - anyOf: - - $ref: '#/components/schemas/DataPolicyAlreadyPresentError' + $ref: '#/components/schemas/DataPolicyAlreadyPresentError' description: DataPolicy already present '500': content: @@ -1225,9 +1234,11 @@ paths: content: application/json: schema: - anyOf: + oneOf: - $ref: '#/components/schemas/UrlParameterMissingError' - $ref: '#/components/schemas/PolicyNotFoundError' + discriminator: + propertyName: type description: URL parameter missing '412': content: @@ -1315,8 +1326,10 @@ paths: content: application/json: schema: - anyOf: + oneOf: - $ref: '#/components/schemas/UrlParameterMissingError' + discriminator: + propertyName: type description: Bad request '404': content: @@ -1437,7 +1450,7 @@ paths: content: application/json: schema: - anyOf: + oneOf: - $ref: '#/components/schemas/RequestBodyMissingError' - $ref: '#/components/schemas/UrlParameterMissingError' - $ref: '#/components/schemas/DataPolicyCreationFailureError' @@ -1445,6 +1458,8 @@ paths: - $ref: '#/components/schemas/DataPolicyUserError' - $ref: '#/components/schemas/PolicyIdMismatchError' - $ref: '#/components/schemas/TopicFilterMismatchError' + discriminator: + propertyName: type description: DataPolicy creation failed '404': content: @@ -4696,6 +4711,8 @@ components: type: integer default: 400 format: int32 + minimum: 100 + maximum: 599 description: The HTTP status code associated with the error. required: - title diff --git a/ext/openAPI/components/schemas/errors/ApiError.yaml b/ext/openAPI/components/schemas/errors/ApiError.yaml index f156edce1d..1ae1c081e1 100644 --- a/ext/openAPI/components/schemas/errors/ApiError.yaml +++ b/ext/openAPI/components/schemas/errors/ApiError.yaml @@ -19,6 +19,8 @@ properties: type: integer default: 400 format: int32 + minimum: 100 + maximum: 599 description: The HTTP status code associated with the error. required: - title diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies.yaml index 6fbb5adf69..843411b1d9 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies.yaml @@ -182,8 +182,10 @@ get: content: application/json: schema: - anyOf: + oneOf: - $ref: "../components/schemas/errors/http/InvalidQueryParameterError.yaml" + discriminator: + propertyName: type description: URL parameter missing '503': content: @@ -277,9 +279,11 @@ post: content: application/json: schema: - anyOf: + oneOf: - $ref: "../components/schemas/errors/http/RequestBodyMissingError.yaml" - $ref: "../components/schemas/errors/datahub/BehaviorPolicyValidationErrors.yaml" + discriminator: + propertyName: type description: Policy creation failed '409': content: diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies_{policyId}.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies_{policyId}.yaml index 73f92a39c2..ad45e3ede0 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies_{policyId}.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies_{policyId}.yaml @@ -123,8 +123,10 @@ get: content: application/json: schema: - anyOf: + oneOf: - $ref: "../components/schemas/errors/http/UrlParameterMissingError.yaml" + discriminator: + propertyName: type description: Bad request '404': content: diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml index ca4bb076ba..ee5069c476 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml @@ -287,8 +287,10 @@ get: content: application/json: schema: - anyOf: + oneOf: - $ref: "../components/schemas/errors/http/InvalidQueryParameterError.yaml" + discriminator: + propertyName: type description: URL parameter missing '503': content: @@ -388,18 +390,19 @@ post: content: application/json: schema: - anyOf: + oneOf: - $ref: "../components/schemas/errors/http/RequestBodyMissingError.yaml" - $ref: "../components/schemas/errors/datahub/DataPolicyCreationFailureError.yaml" - $ref: "../components/schemas/errors/datahub/DataPolicyInvalidErrors.yaml" - $ref: "../components/schemas/errors/datahub/DataPolicyRejectedError.yaml" + discriminator: + propertyName: type description: DataPolicy creation failed '409': content: application/json: schema: - anyOf: - - $ref: "../components/schemas/errors/datahub/DataPolicyAlreadyPresentError.yaml" + $ref: "../components/schemas/errors/datahub/DataPolicyAlreadyPresentError.yaml" description: DataPolicy already present '500': content: diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml index c24b2bb0e7..de82442b2a 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml @@ -25,9 +25,11 @@ delete: content: application/json: schema: - anyOf: + oneOf: - $ref: "../components/schemas/errors/http/UrlParameterMissingError.yaml" - $ref: "../components/schemas/errors/datahub/PolicyNotFoundError.yaml" + discriminator: + propertyName: type description: URL parameter missing '412': content: @@ -122,8 +124,10 @@ get: content: application/json: schema: - anyOf: + oneOf: - $ref: "../components/schemas/errors/http/UrlParameterMissingError.yaml" + discriminator: + propertyName: type description: Bad request '404': content: @@ -254,7 +258,7 @@ put: content: application/json: schema: - anyOf: + oneOf: - $ref: "../components/schemas/errors/http/RequestBodyMissingError.yaml" - $ref: "../components/schemas/errors/http/UrlParameterMissingError.yaml" - $ref: "../components/schemas/errors/datahub/DataPolicyCreationFailureError.yaml" @@ -262,6 +266,8 @@ put: - $ref: "../components/schemas/errors/datahub/DataPolicyUserError.yaml" - $ref: "../components/schemas/errors/datahub/PolicyIdMismatchError.yaml" - $ref: "../components/schemas/errors/datahub/TopicFilterMismatchError.yaml" + discriminator: + propertyName: type description: DataPolicy creation failed '404': content: From c68968728ff6a57876d570f60d5d05f077a4bb63 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Fri, 30 May 2025 17:02:13 +0200 Subject: [PATCH 018/121] refactor: Update put by id for behavior policy --- ext/hivemq-edge-openapi-2025.9.yaml | 178 ++++++++++++++---- .../BehaviorPolicyAlreadyPresentError.yaml | 18 ++ .../BehaviorPolicyCreationFailureError.yaml | 11 ++ ....yaml => BehaviorPolicyInvalidErrors.yaml} | 0 .../datahub/BehaviorPolicyRejectedError.yaml | 4 + .../DataPolicyAlreadyPresentError.yaml | 3 + .../IllegalFunctionValidationError.yaml | 23 +++ .../IllegalTransitionValidationError.yaml | 27 +++ ...AtLeastOneFieldMissingValidationError.yaml | 13 ++ .../errors/validation/ValidationError.yaml | 3 + ...data-hub_behavior-validation_policies.yaml | 18 +- ..._v1_data-hub_data-validation_policies.yaml | 2 +- 12 files changed, 257 insertions(+), 43 deletions(-) create mode 100644 ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyAlreadyPresentError.yaml create mode 100644 ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyCreationFailureError.yaml rename ext/openAPI/components/schemas/errors/datahub/{BehaviorPolicyValidationErrors.yaml => BehaviorPolicyInvalidErrors.yaml} (100%) create mode 100644 ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyRejectedError.yaml create mode 100644 ext/openAPI/components/schemas/errors/datahub/IllegalFunctionValidationError.yaml create mode 100644 ext/openAPI/components/schemas/errors/datahub/IllegalTransitionValidationError.yaml create mode 100644 ext/openAPI/components/schemas/errors/validation/AtLeastOneFieldMissingValidationError.yaml diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index 8aeb73b3c3..570fa3d95b 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -455,7 +455,9 @@ paths: schema: oneOf: - $ref: '#/components/schemas/RequestBodyMissingError' - - $ref: '#/components/schemas/BehaviorPolicyValidationErrors' + - $ref: '#/components/schemas/BehaviorPolicyCreationFailureError' + - $ref: '#/components/schemas/BehaviorPolicyInvalidErrors' + - $ref: '#/components/schemas/BehaviorPolicyRejectedError' discriminator: propertyName: type description: Policy creation failed @@ -463,26 +465,26 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Already exists + $ref: '#/components/schemas/BehaviorPolicyAlreadyPresentError' + description: Behavior policy already present '500': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Internal error + $ref: '#/components/schemas/InternalServerError' + description: Internal server error '503': content: application/json: schema: $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Temporarily unavailable + description: Request resource temporary unavailable '507': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Insufficient storage error + $ref: '#/components/schemas/InsufficientStorageError' + description: Insufficient storage summary: Create a new policy tags: - Data Hub - Behavior Policies @@ -1184,7 +1186,7 @@ paths: application/json: schema: $ref: '#/components/schemas/DataPolicyAlreadyPresentError' - description: DataPolicy already present + description: Data policy already present '500': content: application/json: @@ -4755,6 +4757,18 @@ components: parameter: type: string description: The the missing request body parameter. + BehaviorPolicyCreationFailureError: + x-implements: + - com.hivemq.api.errors.OpenApiError + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + reason: + type: string + description: The actual reason. + required: + - reason ValidationError: x-implements: - com.hivemq.api.errors.OpenApiValidationError @@ -4773,7 +4787,10 @@ components: discriminator: propertyName: type mapping: + AtLeastOneFieldMissingValidationError: '#/components/schemas/AtLeastOneFieldMissingValidationError' EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' + IllegalFunctionValidationError: '#/components/schemas/IllegalFunctionValidationError' + IllegalTransitionValidationError: '#/components/schemas/IllegalTransitionValidationError' InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' @@ -4784,6 +4801,20 @@ components: GeneralPolicyValidationError: '#/components/schemas/GeneralPolicyValidationError' InvalidFunctionOrderValidationError: '#/components/schemas/InvalidFunctionOrderValidationError' UnknownVariableValidationError: '#/components/schemas/UnknownVariableValidationError' + AtLeastOneFieldMissingValidationError: + x-implements: + - com.hivemq.api.errors.OpenApiValidationError + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + fields: + type: array + description: The missing fields. + items: + type: string + required: + - fields EmptyFieldValidationError: x-implements: - com.hivemq.api.errors.OpenApiValidationError @@ -4796,6 +4827,58 @@ components: description: The missing field. required: - field + IllegalFunctionValidationError: + x-implements: + - com.hivemq.api.errors.OpenApiValidationError + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + event: + type: string + description: The event name. + id: + type: string + description: The function id. + message: + type: string + description: The error message. + path: + type: string + description: The path. + required: + - event + - id + - message + - path + IllegalTransitionValidationError: + x-implements: + - com.hivemq.api.errors.OpenApiValidationError + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + event: + type: string + description: The event name. + fromState: + type: string + description: The from state. + id: + type: string + description: The id. + path: + type: string + description: The path. + toState: + type: string + description: The to state. + required: + - event + - fromState + - id + - path + - toState InvalidFieldLengthValidationError: x-implements: - com.hivemq.api.errors.OpenApiValidationError @@ -4994,24 +5077,17 @@ components: $ref: '#/components/schemas/ValidationError' required: - errors - BehaviorPolicyValidationErrors: + BehaviorPolicyInvalidErrors: x-implements: - com.hivemq.api.errors.OpenApiError allOf: - $ref: '#/components/schemas/ValidationErrors' - UrlParameterMissingError: + BehaviorPolicyRejectedError: x-implements: - com.hivemq.api.errors.OpenApiError allOf: - $ref: '#/components/schemas/ApiError' - - type: object - properties: - parameter: - type: string - description: The name of the missing parameter. - required: - - parameter - PolicyNotFoundError: + BehaviorPolicyAlreadyPresentError: x-implements: - com.hivemq.api.errors.OpenApiError allOf: @@ -5021,9 +5097,12 @@ components: id: type: string description: The policy id. + message: + type: string + description: The error message. status: type: integer - default: 404 + default: 409 description: The HTTP status code. required: - id @@ -5041,6 +5120,48 @@ components: type: integer default: 500 description: The HTTP status code. + InsufficientStorageError: + x-implements: + - com.hivemq.api.errors.OpenApiError + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + reason: + type: string + description: The actual reason. + status: + type: integer + default: 507 + description: The HTTP status code. + UrlParameterMissingError: + x-implements: + - com.hivemq.api.errors.OpenApiError + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + parameter: + type: string + description: The name of the missing parameter. + required: + - parameter + PolicyNotFoundError: + x-implements: + - com.hivemq.api.errors.OpenApiError + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The policy id. + status: + type: integer + default: 404 + description: The HTTP status code. + required: + - id JsonNode: type: object description: The arguments of the fsm derived from the behavior policy. @@ -5194,26 +5315,15 @@ components: id: type: string description: The policy id. + message: + type: string + description: The error message. status: type: integer default: 409 description: The HTTP status code. required: - id - InsufficientStorageError: - x-implements: - - com.hivemq.api.errors.OpenApiError - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - reason: - type: string - description: The actual reason. - status: - type: integer - default: 507 - description: The HTTP status code. DataPolicyUserError: x-implements: - com.hivemq.api.errors.OpenApiError diff --git a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyAlreadyPresentError.yaml b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyAlreadyPresentError.yaml new file mode 100644 index 0000000000..0585a6075f --- /dev/null +++ b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyAlreadyPresentError.yaml @@ -0,0 +1,18 @@ +x-implements: + - com.hivemq.api.errors.OpenApiError +allOf: + - $ref: "../ApiError.yaml" + - type: object + properties: + id: + type: string + description: The policy id. + message: + type: string + description: The error message. + status: + type: integer + default: 409 + description: The HTTP status code. + required: + - id diff --git a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyCreationFailureError.yaml b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyCreationFailureError.yaml new file mode 100644 index 0000000000..3028b6deb3 --- /dev/null +++ b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyCreationFailureError.yaml @@ -0,0 +1,11 @@ +x-implements: + - com.hivemq.api.errors.OpenApiError +allOf: + - $ref: "../ApiError.yaml" + - type: object + properties: + reason: + type: string + description: The actual reason. + required: + - reason diff --git a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyValidationErrors.yaml b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyInvalidErrors.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyValidationErrors.yaml rename to ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyInvalidErrors.yaml diff --git a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyRejectedError.yaml b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyRejectedError.yaml new file mode 100644 index 0000000000..60375f8936 --- /dev/null +++ b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyRejectedError.yaml @@ -0,0 +1,4 @@ +x-implements: + - com.hivemq.api.errors.OpenApiError +allOf: + - $ref: "../ApiError.yaml" diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyAlreadyPresentError.yaml b/ext/openAPI/components/schemas/errors/datahub/DataPolicyAlreadyPresentError.yaml index 29b5ebcac0..0585a6075f 100644 --- a/ext/openAPI/components/schemas/errors/datahub/DataPolicyAlreadyPresentError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/DataPolicyAlreadyPresentError.yaml @@ -7,6 +7,9 @@ allOf: id: type: string description: The policy id. + message: + type: string + description: The error message. status: type: integer default: 409 diff --git a/ext/openAPI/components/schemas/errors/datahub/IllegalFunctionValidationError.yaml b/ext/openAPI/components/schemas/errors/datahub/IllegalFunctionValidationError.yaml new file mode 100644 index 0000000000..e7f66e472b --- /dev/null +++ b/ext/openAPI/components/schemas/errors/datahub/IllegalFunctionValidationError.yaml @@ -0,0 +1,23 @@ +x-implements: + - com.hivemq.api.errors.OpenApiValidationError +allOf: + - $ref: "../validation/ValidationError.yaml" + - type: object + properties: + event: + type: string + description: The event name. + id: + type: string + description: The function id. + message: + type: string + description: The error message. + path: + type: string + description: The path. + required: + - event + - id + - message + - path diff --git a/ext/openAPI/components/schemas/errors/datahub/IllegalTransitionValidationError.yaml b/ext/openAPI/components/schemas/errors/datahub/IllegalTransitionValidationError.yaml new file mode 100644 index 0000000000..5b94e1f20b --- /dev/null +++ b/ext/openAPI/components/schemas/errors/datahub/IllegalTransitionValidationError.yaml @@ -0,0 +1,27 @@ +x-implements: + - com.hivemq.api.errors.OpenApiValidationError +allOf: + - $ref: "../validation/ValidationError.yaml" + - type: object + properties: + event: + type: string + description: The event name. + fromState: + type: string + description: The from state. + id: + type: string + description: The id. + path: + type: string + description: The path. + toState: + type: string + description: The to state. + required: + - event + - fromState + - id + - path + - toState diff --git a/ext/openAPI/components/schemas/errors/validation/AtLeastOneFieldMissingValidationError.yaml b/ext/openAPI/components/schemas/errors/validation/AtLeastOneFieldMissingValidationError.yaml new file mode 100644 index 0000000000..3daa52f830 --- /dev/null +++ b/ext/openAPI/components/schemas/errors/validation/AtLeastOneFieldMissingValidationError.yaml @@ -0,0 +1,13 @@ +x-implements: + - com.hivemq.api.errors.OpenApiValidationError +allOf: + - $ref: "./ValidationError.yaml" + - type: object + properties: + fields: + type: array + description: The missing fields. + items: + type: string + required: + - fields diff --git a/ext/openAPI/components/schemas/errors/validation/ValidationError.yaml b/ext/openAPI/components/schemas/errors/validation/ValidationError.yaml index e9281c52b3..d4e73b0bf2 100644 --- a/ext/openAPI/components/schemas/errors/validation/ValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/validation/ValidationError.yaml @@ -15,7 +15,10 @@ required: discriminator: propertyName: type mapping: + AtLeastOneFieldMissingValidationError: "./AtLeastOneFieldMissingValidationError.yaml" EmptyFieldValidationError: "./EmptyFieldValidationError.yaml" + IllegalFunctionValidationError: "../datahub/IllegalFunctionValidationError.yaml" + IllegalTransitionValidationError: "../datahub/IllegalTransitionValidationError.yaml" InvalidFieldLengthValidationError: "./InvalidFieldLengthValidationError.yaml" InvalidFieldValueValidationError: "./InvalidFieldValueValidationError.yaml" InvalidIdentifierValidationError: "./InvalidIdentifierValidationError.yaml" diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies.yaml index 843411b1d9..c3f6386cd4 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies.yaml @@ -281,7 +281,9 @@ post: schema: oneOf: - $ref: "../components/schemas/errors/http/RequestBodyMissingError.yaml" - - $ref: "../components/schemas/errors/datahub/BehaviorPolicyValidationErrors.yaml" + - $ref: "../components/schemas/errors/datahub/BehaviorPolicyCreationFailureError.yaml" + - $ref: "../components/schemas/errors/datahub/BehaviorPolicyInvalidErrors.yaml" + - $ref: "../components/schemas/errors/datahub/BehaviorPolicyRejectedError.yaml" discriminator: propertyName: type description: Policy creation failed @@ -289,26 +291,26 @@ post: content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml - description: Already exists + $ref: "../components/schemas/errors/datahub/BehaviorPolicyAlreadyPresentError.yaml" + description: Behavior policy already present '500': content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml - description: Internal error + $ref: "../components/schemas/errors/http/InternalServerError.yaml" + description: Internal server error '503': content: application/json: schema: $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" - description: Temporarily unavailable + description: Request resource temporary unavailable '507': content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml - description: Insufficient storage error + $ref: "../components/schemas/errors/http/InsufficientStorageError.yaml" + description: Insufficient storage summary: Create a new policy tags: - Data Hub - Behavior Policies diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml index ee5069c476..4e065e331e 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml @@ -403,7 +403,7 @@ post: application/json: schema: $ref: "../components/schemas/errors/datahub/DataPolicyAlreadyPresentError.yaml" - description: DataPolicy already present + description: Data policy already present '500': content: application/json: From c942c46afd8aad233ab8db2d2d290ef0cf1e7044 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Fri, 30 May 2025 17:41:08 +0200 Subject: [PATCH 019/121] refactor: Update post by id for behavior policy --- ext/hivemq-edge-openapi-2025.9.yaml | 113 +++++++++++------- .../BehaviorPolicyUpdateFailureError.yaml | 14 +++ .../datahub/DataPolicyUpdateFailureError.yaml | 14 +++ .../errors/datahub/DataPolicyUserError.yaml | 4 - ...havior-validation_policies_{policyId}.yaml | 26 ++-- ...b_data-validation_policies_{policyId}.yaml | 6 +- 6 files changed, 119 insertions(+), 58 deletions(-) create mode 100644 ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyUpdateFailureError.yaml create mode 100644 ext/openAPI/components/schemas/errors/datahub/DataPolicyUpdateFailureError.yaml delete mode 100644 ext/openAPI/components/schemas/errors/datahub/DataPolicyUserError.yaml diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index 570fa3d95b..fe44e2c6cc 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -736,8 +736,14 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Policy creation failed + oneOf: + - $ref: '#/components/schemas/RequestBodyMissingError' + - $ref: '#/components/schemas/UrlParameterMissingError' + - $ref: '#/components/schemas/BehaviorPolicyCreationFailureError' + - $ref: '#/components/schemas/BehaviorPolicyInvalidErrors' + - $ref: '#/components/schemas/BehaviorPolicyUpdateFailureError' + - $ref: '#/components/schemas/PolicyIdMismatchError' + description: Behavior policy creation failed '404': content: application/json: @@ -748,27 +754,27 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/PreconditionFailedError' description: Precondition failed '500': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Internal error + $ref: '#/components/schemas/InternalServerError' + description: Internal server error '503': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporarily unavailable + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable '507': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Insufficient storage error - summary: Update an existing policy + $ref: '#/components/schemas/InsufficientStorageError' + description: Insufficient storage + summary: Update an existing behavior policy tags: - Data Hub - Behavior Policies /api/v1/data-hub/behavior-validation/states/{clientId}: @@ -1457,18 +1463,18 @@ paths: - $ref: '#/components/schemas/UrlParameterMissingError' - $ref: '#/components/schemas/DataPolicyCreationFailureError' - $ref: '#/components/schemas/DataPolicyInvalidErrors' - - $ref: '#/components/schemas/DataPolicyUserError' + - $ref: '#/components/schemas/DataPolicyUpdateFailureError' - $ref: '#/components/schemas/PolicyIdMismatchError' - $ref: '#/components/schemas/TopicFilterMismatchError' discriminator: propertyName: type - description: DataPolicy creation failed + description: Data policy creation failed '404': content: application/json: schema: $ref: '#/components/schemas/DataPolicyNotFoundError' - description: DataPolicy not found + description: Data policy not found '412': content: application/json: @@ -5162,6 +5168,53 @@ components: description: The HTTP status code. required: - id + BehaviorPolicyUpdateFailureError: + x-implements: + - com.hivemq.api.errors.OpenApiError + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The ID of the policy that failed to update. + reason: + type: string + description: The actual reason. + required: + - id + PolicyIdMismatchError: + x-implements: + - com.hivemq.api.errors.OpenApiError + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + actualId: + type: string + description: The actual id. + expectedId: + type: string + description: The expected id. + required: + - actualId + - expectedId + PreconditionFailedError: + x-implements: + - com.hivemq.api.errors.OpenApiError + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + reason: + type: string + description: The actual reason. + status: + type: integer + default: 412 + description: The HTTP status code. + required: + - reason JsonNode: type: object description: The arguments of the fsm derived from the behavior policy. @@ -5324,27 +5377,21 @@ components: description: The HTTP status code. required: - id - DataPolicyUserError: - x-implements: - - com.hivemq.api.errors.OpenApiError - allOf: - - $ref: '#/components/schemas/ApiError' - PolicyIdMismatchError: + DataPolicyUpdateFailureError: x-implements: - com.hivemq.api.errors.OpenApiError allOf: - $ref: '#/components/schemas/ApiError' - type: object properties: - actualId: + id: type: string - description: The actual id. - expectedId: + description: The ID of the policy that failed to update. + reason: type: string - description: The expected id. + description: The actual reason. required: - - actualId - - expectedId + - id TopicFilterMismatchError: x-implements: - com.hivemq.api.errors.OpenApiError @@ -5376,22 +5423,6 @@ components: description: The HTTP status code. required: - message - PreconditionFailedError: - x-implements: - - com.hivemq.api.errors.OpenApiError - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - reason: - type: string - description: The actual reason. - status: - type: integer - default: 412 - description: The HTTP status code. - required: - - reason Errors: type: object BehaviorPolicyTransitionEvent: diff --git a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyUpdateFailureError.yaml b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyUpdateFailureError.yaml new file mode 100644 index 0000000000..2ffb72d071 --- /dev/null +++ b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyUpdateFailureError.yaml @@ -0,0 +1,14 @@ +x-implements: + - com.hivemq.api.errors.OpenApiError +allOf: + - $ref: "../ApiError.yaml" + - type: object + properties: + id: + type: string + description: The ID of the policy that failed to update. + reason: + type: string + description: The actual reason. + required: + - id diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyUpdateFailureError.yaml b/ext/openAPI/components/schemas/errors/datahub/DataPolicyUpdateFailureError.yaml new file mode 100644 index 0000000000..2ffb72d071 --- /dev/null +++ b/ext/openAPI/components/schemas/errors/datahub/DataPolicyUpdateFailureError.yaml @@ -0,0 +1,14 @@ +x-implements: + - com.hivemq.api.errors.OpenApiError +allOf: + - $ref: "../ApiError.yaml" + - type: object + properties: + id: + type: string + description: The ID of the policy that failed to update. + reason: + type: string + description: The actual reason. + required: + - id diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyUserError.yaml b/ext/openAPI/components/schemas/errors/datahub/DataPolicyUserError.yaml deleted file mode 100644 index 60375f8936..0000000000 --- a/ext/openAPI/components/schemas/errors/datahub/DataPolicyUserError.yaml +++ /dev/null @@ -1,4 +0,0 @@ -x-implements: - - com.hivemq.api.errors.OpenApiError -allOf: - - $ref: "../ApiError.yaml" diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies_{policyId}.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies_{policyId}.yaml index ad45e3ede0..62ffdf5537 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies_{policyId}.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies_{policyId}.yaml @@ -250,8 +250,14 @@ put: content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml - description: Policy creation failed + oneOf: + - $ref: "../components/schemas/errors/http/RequestBodyMissingError.yaml" + - $ref: "../components/schemas/errors/http/UrlParameterMissingError.yaml" + - $ref: "../components/schemas/errors/datahub/BehaviorPolicyCreationFailureError.yaml" + - $ref: "../components/schemas/errors/datahub/BehaviorPolicyInvalidErrors.yaml" + - $ref: "../components/schemas/errors/datahub/BehaviorPolicyUpdateFailureError.yaml" + - $ref: "../components/schemas/errors/datahub/PolicyIdMismatchError.yaml" + description: Behavior policy creation failed '404': content: application/json: @@ -262,26 +268,26 @@ put: content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml + $ref: "../components/schemas/errors/http/PreconditionFailedError.yaml" description: Precondition failed '500': content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml - description: Internal error + $ref: "../components/schemas/errors/http/InternalServerError.yaml" + description: Internal server error '503': content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml - description: Temporarily unavailable + $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" + description: Request resource temporary unavailable '507': content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml - description: Insufficient storage error - summary: Update an existing policy + $ref: "../components/schemas/errors/http/InsufficientStorageError.yaml" + description: Insufficient storage + summary: Update an existing behavior policy tags: - Data Hub - Behavior Policies diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml index de82442b2a..58179d3d41 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml @@ -263,18 +263,18 @@ put: - $ref: "../components/schemas/errors/http/UrlParameterMissingError.yaml" - $ref: "../components/schemas/errors/datahub/DataPolicyCreationFailureError.yaml" - $ref: "../components/schemas/errors/datahub/DataPolicyInvalidErrors.yaml" - - $ref: "../components/schemas/errors/datahub/DataPolicyUserError.yaml" + - $ref: "../components/schemas/errors/datahub/DataPolicyUpdateFailureError.yaml" - $ref: "../components/schemas/errors/datahub/PolicyIdMismatchError.yaml" - $ref: "../components/schemas/errors/datahub/TopicFilterMismatchError.yaml" discriminator: propertyName: type - description: DataPolicy creation failed + description: Data policy creation failed '404': content: application/json: schema: $ref: "../components/schemas/errors/datahub/DataPolicyNotFoundError.yaml" - description: DataPolicy not found + description: Data policy not found '412': content: application/json: From d23be30e17594376b32f2fa10e775519f67c7c83 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Mon, 2 Jun 2025 08:48:46 +0200 Subject: [PATCH 020/121] refactor: Update get, delete for behavior policy --- ext/hivemq-edge-openapi-2025.9.yaml | 22 +++++++++---------- ...havior-validation_policies_{policyId}.yaml | 22 +++++++++---------- 2 files changed, 20 insertions(+), 24 deletions(-) diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index fe44e2c6cc..67cdeb59de 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -516,32 +516,30 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + - $ref: '#/components/schemas/PolicyNotFoundError' + discriminator: + propertyName: type description: URL parameter missing - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/ProblemDetails' - description: Policy not found '412': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/PreconditionFailedError' description: Precondition failed '500': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Internal error + $ref: '#/components/schemas/InternalServerError' + description: Internal server error '503': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporarily not available + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Delete a behavior policy tags: - Data Hub - Behavior Policies diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies_{policyId}.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies_{policyId}.yaml index 62ffdf5537..5c307b4744 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies_{policyId}.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies_{policyId}.yaml @@ -25,32 +25,30 @@ delete: content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml + oneOf: + - $ref: "../components/schemas/errors/http/UrlParameterMissingError.yaml" + - $ref: "../components/schemas/errors/datahub/PolicyNotFoundError.yaml" + discriminator: + propertyName: type description: URL parameter missing - '404': - content: - application/json: - schema: - $ref: ../components/schemas/ProblemDetails.yaml - description: Policy not found '412': content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml + $ref: "../components/schemas/errors/http/PreconditionFailedError.yaml" description: Precondition failed '500': content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml - description: Internal error + $ref: "../components/schemas/errors/http/InternalServerError.yaml" + description: Internal server error '503': content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml - description: Temporarily not available + $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" + description: Request resource temporary unavailable summary: Delete a behavior policy tags: - Data Hub - Behavior Policies From 86fc15033e0fdcac92c071de48a2049537a8d06e Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Mon, 2 Jun 2025 09:13:36 +0200 Subject: [PATCH 021/121] refactor: Add client errors for behavior validation states --- ext/hivemq-edge-openapi-2025.9.yaml | 45 ++++++++++++++++--- .../datahub/ClientDisconnectedError.yaml | 15 +++++++ .../errors/datahub/ClientNotFoundError.yaml | 15 +++++++ ...behavior-validation_states_{clientId}.yaml | 13 +++--- 4 files changed, 78 insertions(+), 10 deletions(-) create mode 100644 ext/openAPI/components/schemas/errors/datahub/ClientDisconnectedError.yaml create mode 100644 ext/openAPI/components/schemas/errors/datahub/ClientNotFoundError.yaml diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index 67cdeb59de..84ce048eea 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -818,20 +818,23 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' description: URL parameter missing '404': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Client is disconnected + oneOf: + - $ref: '#/components/schemas/ClientDisconnectedError' + - $ref: '#/components/schemas/ClientNotFoundError' + description: Client error '500': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Internal Server error + $ref: '#/components/schemas/InternalServerError' + description: Internal server error summary: Get the state of a client tags: - Data Hub - State @@ -5253,6 +5256,38 @@ components: $ref: '#/components/schemas/FsmStateInformationItem' required: - items + ClientDisconnectedError: + x-implements: + - com.hivemq.api.errors.OpenApiError + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The client id. + status: + type: integer + default: 404 + description: The HTTP status code. + required: + - id + ClientNotFoundError: + x-implements: + - com.hivemq.api.errors.OpenApiError + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The client id. + status: + type: integer + default: 404 + description: The HTTP status code. + required: + - id DataPolicyMatching: type: object description: The matching rules the policy applies. diff --git a/ext/openAPI/components/schemas/errors/datahub/ClientDisconnectedError.yaml b/ext/openAPI/components/schemas/errors/datahub/ClientDisconnectedError.yaml new file mode 100644 index 0000000000..4ccdaeb435 --- /dev/null +++ b/ext/openAPI/components/schemas/errors/datahub/ClientDisconnectedError.yaml @@ -0,0 +1,15 @@ +x-implements: + - com.hivemq.api.errors.OpenApiError +allOf: + - $ref: "../ApiError.yaml" + - type: object + properties: + id: + type: string + description: The client id. + status: + type: integer + default: 404 + description: The HTTP status code. + required: + - id diff --git a/ext/openAPI/components/schemas/errors/datahub/ClientNotFoundError.yaml b/ext/openAPI/components/schemas/errors/datahub/ClientNotFoundError.yaml new file mode 100644 index 0000000000..4ccdaeb435 --- /dev/null +++ b/ext/openAPI/components/schemas/errors/datahub/ClientNotFoundError.yaml @@ -0,0 +1,15 @@ +x-implements: + - com.hivemq.api.errors.OpenApiError +allOf: + - $ref: "../ApiError.yaml" + - type: object + properties: + id: + type: string + description: The client id. + status: + type: integer + default: 404 + description: The HTTP status code. + required: + - id diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_states_{clientId}.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_states_{clientId}.yaml index 8b6f8439fd..14dcd81eee 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_states_{clientId}.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_states_{clientId}.yaml @@ -40,20 +40,23 @@ get: content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml + oneOf: + - $ref: "../components/schemas/errors/http/UrlParameterMissingError.yaml" description: URL parameter missing '404': content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml - description: Client is disconnected + oneOf: + - $ref: "../components/schemas/errors/datahub/ClientDisconnectedError.yaml" + - $ref: "../components/schemas/errors/datahub/ClientNotFoundError.yaml" + description: Client error '500': content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml - description: Internal Server error + $ref: "../components/schemas/errors/http/InternalServerError.yaml" + description: Internal server error summary: Get the state of a client tags: - Data Hub - State From 7029d8ad1b368711f1fb91a6114968dd3251a4ae Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Mon, 2 Jun 2025 12:57:49 +0200 Subject: [PATCH 022/121] refactor: Refactor post for script --- ext/hivemq-edge-openapi-2025.9.yaml | 289 ++++++++++++------ .../BehaviorPolicyAlreadyPresentError.yaml | 2 +- .../DataPolicyAlreadyPresentError.yaml | 4 +- .../errors/datahub/SchemaInvalidErrors.yaml | 4 + .../datahub/ScriptAlreadyPresentError.yaml | 15 + .../datahub/ScriptCreationFailureError.yaml | 11 + .../datahub/ScriptEtagMismatchError.yaml | 18 ++ .../errors/datahub/ScriptInvalidErrors.yaml | 4 + .../datahub/ScriptParsingFailureError.yaml | 11 + .../datahub/ScriptSanitationFailureError.yaml | 11 + .../errors/validation/ValidationError.yaml | 10 +- ..._v1_data-hub_data-validation_policies.yaml | 2 +- .../paths/api_v1_data-hub_schemas.yaml | 5 +- .../paths/api_v1_data-hub_scripts.yaml | 21 +- 14 files changed, 287 insertions(+), 120 deletions(-) create mode 100644 ext/openAPI/components/schemas/errors/datahub/SchemaInvalidErrors.yaml create mode 100644 ext/openAPI/components/schemas/errors/datahub/ScriptAlreadyPresentError.yaml create mode 100644 ext/openAPI/components/schemas/errors/datahub/ScriptCreationFailureError.yaml create mode 100644 ext/openAPI/components/schemas/errors/datahub/ScriptEtagMismatchError.yaml create mode 100644 ext/openAPI/components/schemas/errors/datahub/ScriptInvalidErrors.yaml create mode 100644 ext/openAPI/components/schemas/errors/datahub/ScriptParsingFailureError.yaml create mode 100644 ext/openAPI/components/schemas/errors/datahub/ScriptSanitationFailureError.yaml diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index 84ce048eea..d619b73bea 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -1187,7 +1187,7 @@ paths: - $ref: '#/components/schemas/DataPolicyRejectedError' discriminator: propertyName: type - description: DataPolicy creation failed + description: Data policy creation failed '409': content: application/json: @@ -1956,8 +1956,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Schema could not be validatetd + oneOf: + - $ref: '#/components/schemas/SchemaInvalidErrors' + description: Schema creation failed '409': content: application/json: @@ -2272,37 +2273,42 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Script is invalid + oneOf: + - $ref: '#/components/schemas/RequestBodyMissingError' + - $ref: '#/components/schemas/ScriptCreationFailureError' + - $ref: '#/components/schemas/ScriptInvalidErrors' + - $ref: '#/components/schemas/ScriptParsingFailureError' + - $ref: '#/components/schemas/ScriptSanitationFailureError' + description: Script creation failed '409': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/ScriptAlreadyPresentError' description: Script is already present '412': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/ScriptEtagMismatchError' description: Script doesn't match etag '500': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporary not available + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable '507': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InsufficientStorageError' description: Insufficient storage summary: Create a new script tags: @@ -4795,19 +4801,19 @@ components: propertyName: type mapping: AtLeastOneFieldMissingValidationError: '#/components/schemas/AtLeastOneFieldMissingValidationError' + AtMostOneFunctionValidationError: '#/components/schemas/AtMostOneFunctionValidationError' EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' + FunctionMustBePairedValidationError: '#/components/schemas/FunctionMustBePairedValidationError' + GeneralPolicyValidationError: '#/components/schemas/GeneralPolicyValidationError' IllegalFunctionValidationError: '#/components/schemas/IllegalFunctionValidationError' IllegalTransitionValidationError: '#/components/schemas/IllegalTransitionValidationError' InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' + InvalidFunctionOrderValidationError: '#/components/schemas/InvalidFunctionOrderValidationError' InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' - UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' - AtMostOneFunctionValidationError: '#/components/schemas/AtMostOneFunctionValidationError' - FunctionMustBePairedValidationError: '#/components/schemas/FunctionMustBePairedValidationError' - GeneralPolicyValidationError: '#/components/schemas/GeneralPolicyValidationError' - InvalidFunctionOrderValidationError: '#/components/schemas/InvalidFunctionOrderValidationError' UnknownVariableValidationError: '#/components/schemas/UnknownVariableValidationError' + UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' AtLeastOneFieldMissingValidationError: x-implements: - com.hivemq.api.errors.OpenApiValidationError @@ -4822,6 +4828,29 @@ components: type: string required: - fields + AtMostOneFunctionValidationError: + x-implements: + - com.hivemq.api.errors.OpenApiValidationError + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + function: + type: string + description: The function. + occurrences: + type: integer + format: int32 + description: The occurrences of the function. + paths: + type: array + items: + type: string + description: The paths where the function occurs. + required: + - function + - occurrences + - paths EmptyFieldValidationError: x-implements: - com.hivemq.api.errors.OpenApiValidationError @@ -4834,6 +4863,34 @@ components: description: The missing field. required: - field + FunctionMustBePairedValidationError: + x-implements: + - com.hivemq.api.errors.OpenApiValidationError + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + existingFunction: + type: string + description: The existing function. + missingFunction: + type: string + description: The missing function. + required: + - existingFunction + - missingFunction + GeneralPolicyValidationError: + x-implements: + - com.hivemq.api.errors.OpenApiValidationError + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + title: + type: string + description: The title. + required: + - title IllegalFunctionValidationError: x-implements: - com.hivemq.api.errors.OpenApiValidationError @@ -4933,7 +4990,7 @@ components: required: - field - value - InvalidIdentifierValidationError: + InvalidFunctionOrderValidationError: x-implements: - com.hivemq.api.errors.OpenApiValidationError allOf: @@ -4942,14 +4999,18 @@ components: properties: field: type: string - description: The invalid identifier field. - value: + description: The field. + function: type: string - description: The invalid identifier value. + description: The function. + previousFunction: + type: string + description: The previous function. required: - field - - value - MissingFieldValidationError: + - function + - previousFunction + InvalidIdentifierValidationError: x-implements: - com.hivemq.api.errors.OpenApiValidationError allOf: @@ -4958,118 +5019,63 @@ components: properties: field: type: string - description: The missing field. + description: The invalid identifier field. + value: + type: string + description: The invalid identifier value. required: - field - UnsupportedFieldValidationError: + - value + MissingFieldValidationError: x-implements: - com.hivemq.api.errors.OpenApiValidationError allOf: - $ref: '#/components/schemas/ValidationError' - type: object properties: - actualValue: - type: string - description: The actual value. - expectedValue: - type: string - description: The expected value. field: type: string - description: The field. + description: The missing field. required: - - actualValue - - expectedValue - field - AtMostOneFunctionValidationError: + UnknownVariableValidationError: x-implements: - com.hivemq.api.errors.OpenApiValidationError allOf: - $ref: '#/components/schemas/ValidationError' - type: object properties: - function: + field: type: string - description: The function. - occurrences: - type: integer - format: int32 - description: The occurrences of the function. - paths: + description: The field. + variables: type: array items: type: string - description: The paths where the function occurs. - required: - - function - - occurrences - - paths - FunctionMustBePairedValidationError: - x-implements: - - com.hivemq.api.errors.OpenApiValidationError - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - existingFunction: - type: string - description: The existing function. - missingFunction: - type: string - description: The missing function. - required: - - existingFunction - - missingFunction - GeneralPolicyValidationError: - x-implements: - - com.hivemq.api.errors.OpenApiValidationError - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - title: - type: string - description: The title. + description: The unknown variables. required: - - title - InvalidFunctionOrderValidationError: + - field + - variables + UnsupportedFieldValidationError: x-implements: - com.hivemq.api.errors.OpenApiValidationError allOf: - $ref: '#/components/schemas/ValidationError' - type: object properties: - field: - type: string - description: The field. - function: + actualValue: type: string - description: The function. - previousFunction: + description: The actual value. + expectedValue: type: string - description: The previous function. - required: - - field - - function - - previousFunction - UnknownVariableValidationError: - x-implements: - - com.hivemq.api.errors.OpenApiValidationError - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: + description: The expected value. field: type: string description: The field. - variables: - type: array - items: - type: string - description: The unknown variables. required: + - actualValue + - expectedValue - field - - variables ValidationErrors: x-implements: - com.hivemq.api.errors.OpenApiError @@ -5103,7 +5109,7 @@ components: properties: id: type: string - description: The policy id. + description: The behavior policy id. message: type: string description: The error message. @@ -5400,14 +5406,14 @@ components: properties: id: type: string - description: The policy id. + description: The data policy id. message: type: string description: The error message. status: type: integer default: 409 - description: The HTTP status code. + description: The Request Conflict HTTP Status Code. required: - id DataPolicyUpdateFailureError: @@ -5561,6 +5567,11 @@ components: description: List of result items that are returned by this endpoint items: $ref: '#/components/schemas/PolicySchema' + SchemaInvalidErrors: + x-implements: + - com.hivemq.api.errors.OpenApiError + allOf: + - $ref: '#/components/schemas/ValidationErrors' Script: type: object properties: @@ -5602,6 +5613,82 @@ components: description: List of result items that are returned by this endpoint items: $ref: '#/components/schemas/Script' + ScriptCreationFailureError: + x-implements: + - com.hivemq.api.errors.OpenApiError + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + reason: + type: string + description: The actual reason. + required: + - reason + ScriptInvalidErrors: + x-implements: + - com.hivemq.api.errors.OpenApiError + allOf: + - $ref: '#/components/schemas/ValidationErrors' + ScriptParsingFailureError: + x-implements: + - com.hivemq.api.errors.OpenApiError + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + reason: + type: string + description: The actual reason. + required: + - reason + ScriptSanitationFailureError: + x-implements: + - com.hivemq.api.errors.OpenApiError + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + reason: + type: string + description: The actual reason. + required: + - reason + ScriptAlreadyPresentError: + x-implements: + - com.hivemq.api.errors.OpenApiError + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The script id. + status: + type: integer + default: 409 + description: The Request Conflict HTTP Status Code. + required: + - id + ScriptEtagMismatchError: + x-implements: + - com.hivemq.api.errors.OpenApiError + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The script id. + eTag: + type: string + description: The eTag. + status: + type: integer + default: 412 + description: The Precondition Failed HTTP Status Code. + required: + - id Capability: type: object description: List of result items that are returned by this endpoint diff --git a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyAlreadyPresentError.yaml b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyAlreadyPresentError.yaml index 0585a6075f..a970579c25 100644 --- a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyAlreadyPresentError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyAlreadyPresentError.yaml @@ -6,7 +6,7 @@ allOf: properties: id: type: string - description: The policy id. + description: The behavior policy id. message: type: string description: The error message. diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyAlreadyPresentError.yaml b/ext/openAPI/components/schemas/errors/datahub/DataPolicyAlreadyPresentError.yaml index 0585a6075f..2bf3ea9172 100644 --- a/ext/openAPI/components/schemas/errors/datahub/DataPolicyAlreadyPresentError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/DataPolicyAlreadyPresentError.yaml @@ -6,13 +6,13 @@ allOf: properties: id: type: string - description: The policy id. + description: The data policy id. message: type: string description: The error message. status: type: integer default: 409 - description: The HTTP status code. + description: The Request Conflict HTTP Status Code. required: - id diff --git a/ext/openAPI/components/schemas/errors/datahub/SchemaInvalidErrors.yaml b/ext/openAPI/components/schemas/errors/datahub/SchemaInvalidErrors.yaml new file mode 100644 index 0000000000..f737385842 --- /dev/null +++ b/ext/openAPI/components/schemas/errors/datahub/SchemaInvalidErrors.yaml @@ -0,0 +1,4 @@ +x-implements: + - com.hivemq.api.errors.OpenApiError +allOf: + - $ref: "../validation/ValidationErrors.yaml" diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptAlreadyPresentError.yaml b/ext/openAPI/components/schemas/errors/datahub/ScriptAlreadyPresentError.yaml new file mode 100644 index 0000000000..1a38dcac2b --- /dev/null +++ b/ext/openAPI/components/schemas/errors/datahub/ScriptAlreadyPresentError.yaml @@ -0,0 +1,15 @@ +x-implements: + - com.hivemq.api.errors.OpenApiError +allOf: + - $ref: "../ApiError.yaml" + - type: object + properties: + id: + type: string + description: The script id. + status: + type: integer + default: 409 + description: The Request Conflict HTTP Status Code. + required: + - id diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptCreationFailureError.yaml b/ext/openAPI/components/schemas/errors/datahub/ScriptCreationFailureError.yaml new file mode 100644 index 0000000000..3028b6deb3 --- /dev/null +++ b/ext/openAPI/components/schemas/errors/datahub/ScriptCreationFailureError.yaml @@ -0,0 +1,11 @@ +x-implements: + - com.hivemq.api.errors.OpenApiError +allOf: + - $ref: "../ApiError.yaml" + - type: object + properties: + reason: + type: string + description: The actual reason. + required: + - reason diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptEtagMismatchError.yaml b/ext/openAPI/components/schemas/errors/datahub/ScriptEtagMismatchError.yaml new file mode 100644 index 0000000000..9616050f31 --- /dev/null +++ b/ext/openAPI/components/schemas/errors/datahub/ScriptEtagMismatchError.yaml @@ -0,0 +1,18 @@ +x-implements: + - com.hivemq.api.errors.OpenApiError +allOf: + - $ref: "../ApiError.yaml" + - type: object + properties: + id: + type: string + description: The script id. + eTag: + type: string + description: The eTag. + status: + type: integer + default: 412 + description: The Precondition Failed HTTP Status Code. + required: + - id diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptInvalidErrors.yaml b/ext/openAPI/components/schemas/errors/datahub/ScriptInvalidErrors.yaml new file mode 100644 index 0000000000..f737385842 --- /dev/null +++ b/ext/openAPI/components/schemas/errors/datahub/ScriptInvalidErrors.yaml @@ -0,0 +1,4 @@ +x-implements: + - com.hivemq.api.errors.OpenApiError +allOf: + - $ref: "../validation/ValidationErrors.yaml" diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptParsingFailureError.yaml b/ext/openAPI/components/schemas/errors/datahub/ScriptParsingFailureError.yaml new file mode 100644 index 0000000000..3028b6deb3 --- /dev/null +++ b/ext/openAPI/components/schemas/errors/datahub/ScriptParsingFailureError.yaml @@ -0,0 +1,11 @@ +x-implements: + - com.hivemq.api.errors.OpenApiError +allOf: + - $ref: "../ApiError.yaml" + - type: object + properties: + reason: + type: string + description: The actual reason. + required: + - reason diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptSanitationFailureError.yaml b/ext/openAPI/components/schemas/errors/datahub/ScriptSanitationFailureError.yaml new file mode 100644 index 0000000000..3028b6deb3 --- /dev/null +++ b/ext/openAPI/components/schemas/errors/datahub/ScriptSanitationFailureError.yaml @@ -0,0 +1,11 @@ +x-implements: + - com.hivemq.api.errors.OpenApiError +allOf: + - $ref: "../ApiError.yaml" + - type: object + properties: + reason: + type: string + description: The actual reason. + required: + - reason diff --git a/ext/openAPI/components/schemas/errors/validation/ValidationError.yaml b/ext/openAPI/components/schemas/errors/validation/ValidationError.yaml index d4e73b0bf2..b0892a0d4b 100644 --- a/ext/openAPI/components/schemas/errors/validation/ValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/validation/ValidationError.yaml @@ -16,16 +16,16 @@ discriminator: propertyName: type mapping: AtLeastOneFieldMissingValidationError: "./AtLeastOneFieldMissingValidationError.yaml" + AtMostOneFunctionValidationError: "../datahub/AtMostOneFunctionValidationError.yaml" EmptyFieldValidationError: "./EmptyFieldValidationError.yaml" + FunctionMustBePairedValidationError: "../datahub/FunctionMustBePairedValidationError.yaml" + GeneralPolicyValidationError: "../datahub/GeneralPolicyValidationError.yaml" IllegalFunctionValidationError: "../datahub/IllegalFunctionValidationError.yaml" IllegalTransitionValidationError: "../datahub/IllegalTransitionValidationError.yaml" InvalidFieldLengthValidationError: "./InvalidFieldLengthValidationError.yaml" InvalidFieldValueValidationError: "./InvalidFieldValueValidationError.yaml" + InvalidFunctionOrderValidationError: "../datahub/InvalidFunctionOrderValidationError.yaml" InvalidIdentifierValidationError: "./InvalidIdentifierValidationError.yaml" MissingFieldValidationError: "./MissingFieldValidationError.yaml" - UnsupportedFieldValidationError: "./UnsupportedFieldValidationError.yaml" - AtMostOneFunctionValidationError: "../datahub/AtMostOneFunctionValidationError.yaml" - FunctionMustBePairedValidationError: "../datahub/FunctionMustBePairedValidationError.yaml" - GeneralPolicyValidationError: "../datahub/GeneralPolicyValidationError.yaml" - InvalidFunctionOrderValidationError: "../datahub/InvalidFunctionOrderValidationError.yaml" UnknownVariableValidationError: "../datahub/UnknownVariableValidationError.yaml" + UnsupportedFieldValidationError: "./UnsupportedFieldValidationError.yaml" diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml index 4e065e331e..e4c6a0f8f8 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml @@ -397,7 +397,7 @@ post: - $ref: "../components/schemas/errors/datahub/DataPolicyRejectedError.yaml" discriminator: propertyName: type - description: DataPolicy creation failed + description: Data policy creation failed '409': content: application/json: diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas.yaml index 557fe41de4..79e7914f75 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas.yaml @@ -206,8 +206,9 @@ post: content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml - description: Schema could not be validatetd + oneOf: + - $ref: "../components/schemas/errors/datahub/SchemaInvalidErrors.yaml" + description: Schema creation failed '409': content: application/json: diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts.yaml index ec5233fc39..f25122948e 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts.yaml @@ -193,37 +193,42 @@ post: content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml - description: Script is invalid + oneOf: + - $ref: "../components/schemas/errors/http/RequestBodyMissingError.yaml" + - $ref: "../components/schemas/errors/datahub/ScriptCreationFailureError.yaml" + - $ref: "../components/schemas/errors/datahub/ScriptInvalidErrors.yaml" + - $ref: "../components/schemas/errors/datahub/ScriptParsingFailureError.yaml" + - $ref: "../components/schemas/errors/datahub/ScriptSanitationFailureError.yaml" + description: Script creation failed '409': content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml + $ref: "../components/schemas/errors/datahub/ScriptAlreadyPresentError.yaml" description: Script is already present '412': content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml + $ref: "../components/schemas/errors/datahub/ScriptEtagMismatchError.yaml" description: Script doesn't match etag '500': content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml + $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal server error '503': content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml - description: Temporary not available + $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" + description: Request resource temporary unavailable '507': content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml + $ref: "../components/schemas/errors/http/InsufficientStorageError.yaml" description: Insufficient storage summary: Create a new script tags: From 42d16db521482f1327784beaf4cba1470118180b Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Mon, 2 Jun 2025 13:51:02 +0200 Subject: [PATCH 023/121] refactor: Refactor get for script --- ext/hivemq-edge-openapi-2025.9.yaml | 29 ++++++++++++++++--- .../errors/datahub/ScriptNotFoundError.yaml | 15 ++++++++++ .../paths/api_v1_data-hub_scripts.yaml | 2 ++ .../api_v1_data-hub_scripts_{scriptId}.yaml | 13 +++++---- 4 files changed, 50 insertions(+), 9 deletions(-) create mode 100644 ext/openAPI/components/schemas/errors/datahub/ScriptNotFoundError.yaml diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index d619b73bea..6ec1454945 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -2279,6 +2279,8 @@ paths: - $ref: '#/components/schemas/ScriptInvalidErrors' - $ref: '#/components/schemas/ScriptParsingFailureError' - $ref: '#/components/schemas/ScriptSanitationFailureError' + discriminator: + propertyName: type description: Script creation failed '409': content: @@ -2406,13 +2408,16 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + discriminator: + propertyName: type description: URL parameter missing '404': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/ScriptNotFoundError' description: Script not found '500': content: @@ -2424,8 +2429,8 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporary not available + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Get a script tags: - Data Hub - Scripts @@ -5689,6 +5694,22 @@ components: description: The Precondition Failed HTTP Status Code. required: - id + ScriptNotFoundError: + x-implements: + - com.hivemq.api.errors.OpenApiError + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The script ID. + status: + type: integer + default: 404 + description: The HTTP status code. + required: + - message Capability: type: object description: List of result items that are returned by this endpoint diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptNotFoundError.yaml b/ext/openAPI/components/schemas/errors/datahub/ScriptNotFoundError.yaml new file mode 100644 index 0000000000..4aa3e14856 --- /dev/null +++ b/ext/openAPI/components/schemas/errors/datahub/ScriptNotFoundError.yaml @@ -0,0 +1,15 @@ +x-implements: + - com.hivemq.api.errors.OpenApiError +allOf: + - $ref: "../ApiError.yaml" + - type: object + properties: + id: + type: string + description: The script ID. + status: + type: integer + default: 404 + description: The HTTP status code. + required: + - message diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts.yaml index f25122948e..b4a7c28b86 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts.yaml @@ -199,6 +199,8 @@ post: - $ref: "../components/schemas/errors/datahub/ScriptInvalidErrors.yaml" - $ref: "../components/schemas/errors/datahub/ScriptParsingFailureError.yaml" - $ref: "../components/schemas/errors/datahub/ScriptSanitationFailureError.yaml" + discriminator: + propertyName: type description: Script creation failed '409': content: diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts_{scriptId}.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts_{scriptId}.yaml index 8e1f08c279..3a506d8c7d 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts_{scriptId}.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts_{scriptId}.yaml @@ -93,26 +93,29 @@ get: content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml + oneOf: + - $ref: "../components/schemas/errors/http/UrlParameterMissingError.yaml" + discriminator: + propertyName: type description: URL parameter missing '404': content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml + $ref: "../components/schemas/errors/datahub/ScriptNotFoundError.yaml" description: Script not found '500': content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml + $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal Server error '503': content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml - description: Temporary not available + $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" + description: Request resource temporary unavailable summary: Get a script tags: - Data Hub - Scripts From 9a0fc37eb0c4757dee03cf2da349cd9f1f2d90fd Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Mon, 2 Jun 2025 13:54:42 +0200 Subject: [PATCH 024/121] refactor: Refactor get all for script --- ext/hivemq-edge-openapi-2025.9.yaml | 15 ++++++++++++--- .../openapi/paths/api_v1_data-hub_scripts.yaml | 13 +++++++++++-- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index 6ec1454945..76751f5703 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -2220,12 +2220,21 @@ paths: schema: $ref: '#/components/schemas/ScriptList' description: Success + '400': + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/InvalidQueryParameterError' + discriminator: + propertyName: type + description: URL parameter missing '503': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporary not available + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Get all scripts tags: - Data Hub - Scripts @@ -2423,7 +2432,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal Server error '503': content: diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts.yaml index b4a7c28b86..73df529287 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts.yaml @@ -138,12 +138,21 @@ get: schema: $ref: ../components/schemas/ScriptList.yaml description: Success + '400': + content: + application/json: + schema: + oneOf: + - $ref: "../components/schemas/errors/http/InvalidQueryParameterError.yaml" + discriminator: + propertyName: type + description: URL parameter missing '503': content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml - description: Temporary not available + $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" + description: Request resource temporary unavailable summary: Get all scripts tags: - Data Hub - Scripts From ccda1254c6f085f62788a2e11c5e226dfc6a44ec Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Mon, 2 Jun 2025 14:52:55 +0200 Subject: [PATCH 025/121] refactor: Refactor delete for script --- ext/hivemq-edge-openapi-2025.9.yaml | 86 +++++++++++++++---- .../datahub/BehaviorPolicyNotFoundError.yaml | 18 ++++ .../datahub/DataPolicyNotFoundError.yaml | 5 +- .../errors/datahub/ScriptNotFoundError.yaml | 5 +- .../errors/datahub/ScriptReferencedError.yaml | 14 +++ ...havior-validation_policies_{policyId}.yaml | 13 ++- ...b_data-validation_policies_{policyId}.yaml | 7 +- .../api_v1_data-hub_scripts_{scriptId}.yaml | 18 ++-- 8 files changed, 136 insertions(+), 30 deletions(-) create mode 100644 ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyNotFoundError.yaml create mode 100644 ext/openAPI/components/schemas/errors/datahub/ScriptReferencedError.yaml diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index 76751f5703..abb24d5176 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -518,10 +518,15 @@ paths: schema: oneOf: - $ref: '#/components/schemas/UrlParameterMissingError' - - $ref: '#/components/schemas/PolicyNotFoundError' discriminator: propertyName: type description: URL parameter missing + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyNotFoundError' + description: Behavior policy not found '412': content: application/json: @@ -618,7 +623,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/PolicyNotFoundError' + $ref: '#/components/schemas/BehaviorPolicyNotFoundError' description: Policy not found '500': content: @@ -746,8 +751,8 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Policy not found + $ref: '#/components/schemas/BehaviorPolicyNotFoundError' + description: Data policy not found '412': content: application/json: @@ -1245,10 +1250,15 @@ paths: schema: oneOf: - $ref: '#/components/schemas/UrlParameterMissingError' - - $ref: '#/components/schemas/PolicyNotFoundError' discriminator: propertyName: type description: URL parameter missing + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyNotFoundError' + description: Data policy not found '412': content: application/json: @@ -2349,32 +2359,36 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Script is referenced + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + - $ref: '#/components/schemas/ScriptReferencedError' + discriminator: + propertyName: type + description: URL parameter missing '404': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/ScriptNotFoundError' description: Script not found '412': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/ScriptEtagMismatchError' description: Script doesn't match etag '500': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal Server error '503': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporary not available + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Delete a script tags: - Data Hub - Scripts @@ -5173,7 +5187,7 @@ components: description: The name of the missing parameter. required: - parameter - PolicyNotFoundError: + BehaviorPolicyNotFoundError: x-implements: - com.hivemq.api.errors.OpenApiError allOf: @@ -5182,7 +5196,10 @@ components: properties: id: type: string - description: The policy id. + description: The data policy id. + message: + type: string + description: The error message. status: type: integer default: 404 @@ -5236,6 +5253,22 @@ components: description: The HTTP status code. required: - reason + PolicyNotFoundError: + x-implements: + - com.hivemq.api.errors.OpenApiError + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The policy id. + status: + type: integer + default: 404 + description: The HTTP status code. + required: + - id JsonNode: type: object description: The arguments of the fsm derived from the behavior policy. @@ -5467,6 +5500,9 @@ components: - $ref: '#/components/schemas/ApiError' - type: object properties: + id: + type: string + description: The data policy id. message: type: string description: The error message. @@ -5475,7 +5511,7 @@ components: default: 404 description: The HTTP status code. required: - - message + - id Errors: type: object BehaviorPolicyTransitionEvent: @@ -5713,12 +5749,30 @@ components: id: type: string description: The script ID. + message: + type: string + description: The error message. status: type: integer default: 404 description: The HTTP status code. required: - - message + - id + ScriptReferencedError: + x-implements: + - com.hivemq.api.errors.OpenApiError + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The script ID. + message: + type: string + description: The error message. + required: + - id Capability: type: object description: List of result items that are returned by this endpoint diff --git a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyNotFoundError.yaml b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyNotFoundError.yaml new file mode 100644 index 0000000000..db2a81d359 --- /dev/null +++ b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyNotFoundError.yaml @@ -0,0 +1,18 @@ +x-implements: + - com.hivemq.api.errors.OpenApiError +allOf: + - $ref: "../ApiError.yaml" + - type: object + properties: + id: + type: string + description: The data policy id. + message: + type: string + description: The error message. + status: + type: integer + default: 404 + description: The HTTP status code. + required: + - id diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyNotFoundError.yaml b/ext/openAPI/components/schemas/errors/datahub/DataPolicyNotFoundError.yaml index 81f2c8897a..db2a81d359 100644 --- a/ext/openAPI/components/schemas/errors/datahub/DataPolicyNotFoundError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/DataPolicyNotFoundError.yaml @@ -4,6 +4,9 @@ allOf: - $ref: "../ApiError.yaml" - type: object properties: + id: + type: string + description: The data policy id. message: type: string description: The error message. @@ -12,4 +15,4 @@ allOf: default: 404 description: The HTTP status code. required: - - message + - id diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptNotFoundError.yaml b/ext/openAPI/components/schemas/errors/datahub/ScriptNotFoundError.yaml index 4aa3e14856..5c7a2892d2 100644 --- a/ext/openAPI/components/schemas/errors/datahub/ScriptNotFoundError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/ScriptNotFoundError.yaml @@ -7,9 +7,12 @@ allOf: id: type: string description: The script ID. + message: + type: string + description: The error message. status: type: integer default: 404 description: The HTTP status code. required: - - message + - id diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptReferencedError.yaml b/ext/openAPI/components/schemas/errors/datahub/ScriptReferencedError.yaml new file mode 100644 index 0000000000..c78dc914bc --- /dev/null +++ b/ext/openAPI/components/schemas/errors/datahub/ScriptReferencedError.yaml @@ -0,0 +1,14 @@ +x-implements: + - com.hivemq.api.errors.OpenApiError +allOf: + - $ref: "../ApiError.yaml" + - type: object + properties: + id: + type: string + description: The script ID. + message: + type: string + description: The error message. + required: + - id diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies_{policyId}.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies_{policyId}.yaml index 5c307b4744..78d647e7e9 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies_{policyId}.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies_{policyId}.yaml @@ -27,10 +27,15 @@ delete: schema: oneOf: - $ref: "../components/schemas/errors/http/UrlParameterMissingError.yaml" - - $ref: "../components/schemas/errors/datahub/PolicyNotFoundError.yaml" discriminator: propertyName: type description: URL parameter missing + '404': + content: + application/json: + schema: + $ref: "../components/schemas/errors/datahub/PolicyNotFoundError.yaml" + description: Behavior policy not found '412': content: application/json: @@ -130,7 +135,7 @@ get: content: application/json: schema: - $ref: "../components/schemas/errors/datahub/PolicyNotFoundError.yaml" + $ref: "../components/schemas/errors/datahub/BehaviorPolicyNotFoundError.yaml" description: Policy not found '500': content: @@ -260,8 +265,8 @@ put: content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml - description: Policy not found + $ref: "../components/schemas/errors/datahub/BehaviorPolicyNotFoundError.yaml" + description: Data policy not found '412': content: application/json: diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml index 58179d3d41..4427b53a05 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml @@ -27,10 +27,15 @@ delete: schema: oneOf: - $ref: "../components/schemas/errors/http/UrlParameterMissingError.yaml" - - $ref: "../components/schemas/errors/datahub/PolicyNotFoundError.yaml" discriminator: propertyName: type description: URL parameter missing + '404': + content: + application/json: + schema: + $ref: "../components/schemas/errors/datahub/PolicyNotFoundError.yaml" + description: Data policy not found '412': content: application/json: diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts_{scriptId}.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts_{scriptId}.yaml index 3a506d8c7d..3a21f0d86d 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts_{scriptId}.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts_{scriptId}.yaml @@ -22,32 +22,36 @@ delete: content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml - description: Script is referenced + oneOf: + - $ref: "../components/schemas/errors/http/UrlParameterMissingError.yaml" + - $ref: "../components/schemas/errors/datahub/ScriptReferencedError.yaml" + discriminator: + propertyName: type + description: URL parameter missing '404': content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml + $ref: "../components/schemas/errors/datahub/ScriptNotFoundError.yaml" description: Script not found '412': content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml + $ref: "../components/schemas/errors/datahub/ScriptEtagMismatchError.yaml" description: Script doesn't match etag '500': content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml + $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal Server error '503': content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml - description: Temporary not available + $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" + description: Request resource temporary unavailable summary: Delete a script tags: - Data Hub - Scripts From c992dbbbe046ae13983d824b8a1ebeb885f98f76 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Mon, 2 Jun 2025 16:03:00 +0200 Subject: [PATCH 026/121] refactor: Refactor post for schema --- ext/hivemq-edge-openapi-2025.9.yaml | 74 +++++++++++++++++-- .../datahub/SchemaAlreadyPresentError.yaml | 15 ++++ .../datahub/SchemaEtagMismatchError.yaml | 18 +++++ .../datahub/SchemaParsingFailureError.yaml | 15 ++++ .../paths/api_v1_data-hub_schemas.yaml | 22 ++++-- .../hivemq/api/errors/HttpErrorFactory.java | 14 ++-- 6 files changed, 138 insertions(+), 20 deletions(-) create mode 100644 ext/openAPI/components/schemas/errors/datahub/SchemaAlreadyPresentError.yaml create mode 100644 ext/openAPI/components/schemas/errors/datahub/SchemaEtagMismatchError.yaml create mode 100644 ext/openAPI/components/schemas/errors/datahub/SchemaParsingFailureError.yaml diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index abb24d5176..794bf2c359 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -1967,31 +1967,41 @@ paths: application/json: schema: oneOf: + - $ref: '#/components/schemas/RequestBodyMissingError' - $ref: '#/components/schemas/SchemaInvalidErrors' + - $ref: '#/components/schemas/SchemaParsingFailureError' + discriminator: + propertyName: type description: Schema creation failed '409': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Schema already exists + $ref: '#/components/schemas/SchemaAlreadyPresentError' + description: Schema is already present '412': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Mismatch between schema and etag + $ref: '#/components/schemas/SchemaEtagMismatchError' + description: Schema doesn't match etag '500': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable '507': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InsufficientStorageError' description: Insufficient storage summary: Create a new schema tags: @@ -5622,6 +5632,58 @@ components: - com.hivemq.api.errors.OpenApiError allOf: - $ref: '#/components/schemas/ValidationErrors' + SchemaParsingFailureError: + x-implements: + - com.hivemq.api.errors.OpenApiError + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + alias: + type: string + description: The schema alias. + message: + type: string + description: The error message. + required: + - alias + - message + SchemaAlreadyPresentError: + x-implements: + - com.hivemq.api.errors.OpenApiError + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The schema id. + status: + type: integer + default: 409 + description: The Request Conflict HTTP Status Code. + required: + - id + SchemaEtagMismatchError: + x-implements: + - com.hivemq.api.errors.OpenApiError + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The schema id. + eTag: + type: string + description: The eTag. + status: + type: integer + default: 412 + description: The Precondition Failed HTTP Status Code. + required: + - id + - eTag Script: type: object properties: diff --git a/ext/openAPI/components/schemas/errors/datahub/SchemaAlreadyPresentError.yaml b/ext/openAPI/components/schemas/errors/datahub/SchemaAlreadyPresentError.yaml new file mode 100644 index 0000000000..82eaef868b --- /dev/null +++ b/ext/openAPI/components/schemas/errors/datahub/SchemaAlreadyPresentError.yaml @@ -0,0 +1,15 @@ +x-implements: + - com.hivemq.api.errors.OpenApiError +allOf: + - $ref: "../ApiError.yaml" + - type: object + properties: + id: + type: string + description: The schema id. + status: + type: integer + default: 409 + description: The Request Conflict HTTP Status Code. + required: + - id diff --git a/ext/openAPI/components/schemas/errors/datahub/SchemaEtagMismatchError.yaml b/ext/openAPI/components/schemas/errors/datahub/SchemaEtagMismatchError.yaml new file mode 100644 index 0000000000..f445828192 --- /dev/null +++ b/ext/openAPI/components/schemas/errors/datahub/SchemaEtagMismatchError.yaml @@ -0,0 +1,18 @@ +x-implements: + - com.hivemq.api.errors.OpenApiError +allOf: + - $ref: "../ApiError.yaml" + - type: object + properties: + id: + type: string + description: The schema id. + eTag: + type: string + description: The eTag. + status: + type: integer + default: 412 + description: The Precondition Failed HTTP Status Code. + required: + - id diff --git a/ext/openAPI/components/schemas/errors/datahub/SchemaParsingFailureError.yaml b/ext/openAPI/components/schemas/errors/datahub/SchemaParsingFailureError.yaml new file mode 100644 index 0000000000..f582f0513c --- /dev/null +++ b/ext/openAPI/components/schemas/errors/datahub/SchemaParsingFailureError.yaml @@ -0,0 +1,15 @@ +x-implements: + - com.hivemq.api.errors.OpenApiError +allOf: + - $ref: "../ApiError.yaml" + - type: object + properties: + alias: + type: string + description: The schema alias. + message: + type: string + description: The error message. + required: + - alias + - message diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas.yaml index 79e7914f75..5e8d02b7e6 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas.yaml @@ -207,31 +207,41 @@ post: application/json: schema: oneOf: + - $ref: "../components/schemas/errors/http/RequestBodyMissingError.yaml" - $ref: "../components/schemas/errors/datahub/SchemaInvalidErrors.yaml" + - $ref: "../components/schemas/errors/datahub/SchemaParsingFailureError.yaml" + discriminator: + propertyName: type description: Schema creation failed '409': content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml - description: Schema already exists + $ref: "../components/schemas/errors/datahub/SchemaAlreadyPresentError.yaml" + description: Schema is already present '412': content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml - description: Mismatch between schema and etag + $ref: "../components/schemas/errors/datahub/SchemaEtagMismatchError.yaml" + description: Schema doesn't match etag '500': content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml + $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal server error + '503': + content: + application/json: + schema: + $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" + description: Request resource temporary unavailable '507': content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml + $ref: "../components/schemas/errors/http/InsufficientStorageError.yaml" description: Insufficient storage summary: Create a new schema tags: diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java index e086c4a1b1..f02d2aa112 100644 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java @@ -76,18 +76,16 @@ private HttpErrorFactory() { } public static @NotNull RequestBodyMissingError requestBodyMissingError() { - return RequestBodyMissingError.builder() - .type(type(RequestBodyMissingError.class)) - .title("Required request body missing") - .detail("Required request body missing.") - .build(); + return requestBodyMissingError(null); } - public static @NotNull RequestBodyMissingError requestBodyMissingError(final @NotNull String parameter) { + public static @NotNull RequestBodyMissingError requestBodyMissingError(final @Nullable String parameter) { return RequestBodyMissingError.builder() .type(type(RequestBodyMissingError.class)) - .title("Required request body parameter " + parameter + " missing") - .detail("Required request body parameter " + parameter + " missing") + .title("Required request body missing") + .detail(parameter == null ? + "Required request body missing." : + "Required request body parameter " + parameter + " missing.") .parameter(parameter) .build(); } From e324ac5a47b343472477e05d99663994439b17b6 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Mon, 2 Jun 2025 16:13:07 +0200 Subject: [PATCH 027/121] refactor: Refactor get for schema --- ext/hivemq-edge-openapi-2025.9.yaml | 35 ++++++++++++++++--- .../errors/datahub/SchemaNotFoundError.yaml | 18 ++++++++++ .../api_v1_data-hub_schemas_{schemaId}.yaml | 17 ++++++--- 3 files changed, 62 insertions(+), 8 deletions(-) create mode 100644 ext/openAPI/components/schemas/errors/datahub/SchemaNotFoundError.yaml diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index 794bf2c359..5d98120162 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -2106,13 +2106,16 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: A url parameter is missing + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + discriminator: + propertyName: type + description: URL parameter missing '404': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/SchemaNotFoundError' description: Schema not found '500': content: @@ -2120,6 +2123,12 @@ paths: schema: $ref: '#/components/schemas/ProblemDetails' description: Internal server error + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Get a schema tags: - Data Hub - Schemas @@ -5683,7 +5692,25 @@ components: description: The Precondition Failed HTTP Status Code. required: - id - - eTag + SchemaNotFoundError: + x-implements: + - com.hivemq.api.errors.OpenApiError + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The schema ID. + message: + type: string + description: The error message. + status: + type: integer + default: 404 + description: The HTTP status code. + required: + - id Script: type: object properties: diff --git a/ext/openAPI/components/schemas/errors/datahub/SchemaNotFoundError.yaml b/ext/openAPI/components/schemas/errors/datahub/SchemaNotFoundError.yaml new file mode 100644 index 0000000000..b42d6e7660 --- /dev/null +++ b/ext/openAPI/components/schemas/errors/datahub/SchemaNotFoundError.yaml @@ -0,0 +1,18 @@ +x-implements: + - com.hivemq.api.errors.OpenApiError +allOf: + - $ref: "../ApiError.yaml" + - type: object + properties: + id: + type: string + description: The schema ID. + message: + type: string + description: The error message. + status: + type: integer + default: 404 + description: The HTTP status code. + required: + - id diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas_{schemaId}.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas_{schemaId}.yaml index 7a3a82ec52..10894bf606 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas_{schemaId}.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas_{schemaId}.yaml @@ -100,20 +100,29 @@ get: content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml - description: A url parameter is missing + oneOf: + - $ref: "../components/schemas/errors/http/UrlParameterMissingError.yaml" + discriminator: + propertyName: type + description: URL parameter missing '404': content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml + $ref: "../components/schemas/errors/datahub/SchemaNotFoundError.yaml" description: Schema not found '500': content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml + $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal server error + '503': + content: + application/json: + schema: + $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" + description: Request resource temporary unavailable summary: Get a schema tags: - Data Hub - Schemas From d8fcfc51b73d290e3697f72ea235ed4483d9ca0a Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Mon, 2 Jun 2025 16:17:00 +0200 Subject: [PATCH 028/121] refactor: Refactor get all for schema --- ext/hivemq-edge-openapi-2025.9.yaml | 13 +++++++++++-- .../openapi/paths/api_v1_data-hub_schemas.yaml | 11 ++++++++++- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index 5d98120162..29044e3460 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -1913,11 +1913,20 @@ paths: schema: $ref: '#/components/schemas/SchemaList' description: Success + '400': + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/InvalidQueryParameterError' + discriminator: + propertyName: type + description: URL parameter missing '503': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable summary: Get all schemas tags: @@ -2121,7 +2130,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas.yaml index 5e8d02b7e6..a6a56b38a8 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas.yaml @@ -151,11 +151,20 @@ get: schema: $ref: ../components/schemas/SchemaList.yaml description: Success + '400': + content: + application/json: + schema: + oneOf: + - $ref: "../components/schemas/errors/http/InvalidQueryParameterError.yaml" + discriminator: + propertyName: type + description: URL parameter missing '503': content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml + $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable summary: Get all schemas tags: From 6a0777fb3ecb779fec4dd3026dae66d3852d58d1 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Mon, 2 Jun 2025 16:34:33 +0200 Subject: [PATCH 029/121] refactor: Refactor delete for schema --- ext/hivemq-edge-openapi-2025.9.yaml | 35 ++++++++++++++----- .../errors/datahub/SchemaReferencedError.yaml | 14 ++++++++ .../api_v1_data-hub_schemas_{schemaId}.yaml | 20 ++++++----- 3 files changed, 53 insertions(+), 16 deletions(-) create mode 100644 ext/openAPI/components/schemas/errors/datahub/SchemaReferencedError.yaml diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index 29044e3460..8aac34aa21 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -2043,31 +2043,35 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Schema referenced + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + - $ref: '#/components/schemas/SchemaReferencedError' + discriminator: + propertyName: type + description: URL parameter missing '404': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/SchemaNotFoundError' description: Schema not found '412': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Mismatch between schema and etag + $ref: '#/components/schemas/SchemaEtagMismatchError' + description: Schema doesn't match etag '500': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Internal server error + $ref: '#/components/schemas/InternalServerError' + description: Internal Server error '503': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable summary: Delete all versions of the schema tags: @@ -5720,6 +5724,21 @@ components: description: The HTTP status code. required: - id + SchemaReferencedError: + x-implements: + - com.hivemq.api.errors.OpenApiError + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The schema ID. + message: + type: string + description: The error message. + required: + - id Script: type: object properties: diff --git a/ext/openAPI/components/schemas/errors/datahub/SchemaReferencedError.yaml b/ext/openAPI/components/schemas/errors/datahub/SchemaReferencedError.yaml new file mode 100644 index 0000000000..d2832a9829 --- /dev/null +++ b/ext/openAPI/components/schemas/errors/datahub/SchemaReferencedError.yaml @@ -0,0 +1,14 @@ +x-implements: + - com.hivemq.api.errors.OpenApiError +allOf: + - $ref: "../ApiError.yaml" + - type: object + properties: + id: + type: string + description: The schema ID. + message: + type: string + description: The error message. + required: + - id diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas_{schemaId}.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas_{schemaId}.yaml index 10894bf606..8ba9ff4c71 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas_{schemaId}.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas_{schemaId}.yaml @@ -25,31 +25,35 @@ delete: content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml - description: Schema referenced + oneOf: + - $ref: "../components/schemas/errors/http/UrlParameterMissingError.yaml" + - $ref: "../components/schemas/errors/datahub/SchemaReferencedError.yaml" + discriminator: + propertyName: type + description: URL parameter missing '404': content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml + $ref: "../components/schemas/errors/datahub/SchemaNotFoundError.yaml" description: Schema not found '412': content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml - description: Mismatch between schema and etag + $ref: "../components/schemas/errors/datahub/SchemaEtagMismatchError.yaml" + description: Schema doesn't match etag '500': content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml - description: Internal server error + $ref: "../components/schemas/errors/http/InternalServerError.yaml" + description: Internal Server error '503': content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml + $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable summary: Delete all versions of the schema tags: From c8943b8ffe79c53a3a88d4366fe5ef447b722754 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Mon, 2 Jun 2025 17:01:21 +0200 Subject: [PATCH 030/121] refactor: Refactor get for fsm --- ext/hivemq-edge-openapi-2025.9.yaml | 8 +++++--- ...v1_data-hub_behavior-validation_states_{clientId}.yaml | 4 ++++ .../openapi/paths/api_v1_data-hub_fsm.yaml | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index 8aac34aa21..68fea10450 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -825,6 +825,8 @@ paths: schema: oneOf: - $ref: '#/components/schemas/UrlParameterMissingError' + discriminator: + propertyName: type description: URL parameter missing '404': content: @@ -833,6 +835,8 @@ paths: oneOf: - $ref: '#/components/schemas/ClientDisconnectedError' - $ref: '#/components/schemas/ClientNotFoundError' + discriminator: + propertyName: type description: Client error '500': content: @@ -1596,7 +1600,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Errors' + $ref: '#/components/schemas/InternalServerError' description: Internal server error summary: Get all FSMs as a JSON Schema tags: @@ -5544,8 +5548,6 @@ components: description: The HTTP status code. required: - id - Errors: - type: object BehaviorPolicyTransitionEvent: type: string description: Accepted event in transition diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_states_{clientId}.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_states_{clientId}.yaml index 14dcd81eee..9d3a726e75 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_states_{clientId}.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_states_{clientId}.yaml @@ -42,6 +42,8 @@ get: schema: oneOf: - $ref: "../components/schemas/errors/http/UrlParameterMissingError.yaml" + discriminator: + propertyName: type description: URL parameter missing '404': content: @@ -50,6 +52,8 @@ get: oneOf: - $ref: "../components/schemas/errors/datahub/ClientDisconnectedError.yaml" - $ref: "../components/schemas/errors/datahub/ClientNotFoundError.yaml" + discriminator: + propertyName: type description: Client error '500': content: diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_fsm.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_fsm.yaml index a7b849a4bc..c0a3ae08dd 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_fsm.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_fsm.yaml @@ -92,7 +92,7 @@ get: content: application/json: schema: - $ref: ../components/schemas/Errors.yaml + $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal server error summary: Get all FSMs as a JSON Schema tags: From c91b345c9c86a769e04af87763121f673c50763a Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Tue, 3 Jun 2025 09:33:35 +0200 Subject: [PATCH 031/121] refactor: Refactor for functions --- ext/hivemq-edge-openapi-2025.9.yaml | 2 +- .../openapi/paths/api_v1_data-hub_functions.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index 68fea10450..27da1f4eb6 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -1762,7 +1762,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error summary: Get all functions as a JSON Schema tags: diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_functions.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_functions.yaml index 6f4181e864..1d2adc52bf 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_functions.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_functions.yaml @@ -187,7 +187,7 @@ get: content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml + $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal server error summary: Get all functions as a JSON Schema tags: From 540391bbf06c873ebeff141f1e9f88ca817a6ec9 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Tue, 3 Jun 2025 10:30:26 +0200 Subject: [PATCH 032/121] refactor: Mark errors in ProblemDetails as @Deprecated --- ext/hivemq-edge-openapi-2025.9.yaml | 1 + .../openapi/components/schemas/ProblemDetails.yaml | 1 + 2 files changed, 2 insertions(+) diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index 27da1f4eb6..8c95536b21 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -4604,6 +4604,7 @@ components: detail: type: string errors: + deprecated: true type: array items: $ref: '#/components/schemas/Error' diff --git a/hivemq-edge-openapi/openapi/components/schemas/ProblemDetails.yaml b/hivemq-edge-openapi/openapi/components/schemas/ProblemDetails.yaml index b28f26b508..edb3c5924c 100644 --- a/hivemq-edge-openapi/openapi/components/schemas/ProblemDetails.yaml +++ b/hivemq-edge-openapi/openapi/components/schemas/ProblemDetails.yaml @@ -6,6 +6,7 @@ properties: detail: type: string errors: + deprecated: true type: array items: $ref: ./Error.yaml From a0ea1baaa20ad5b5551d4d0646d9e9e07f7eaa6f Mon Sep 17 00:00:00 2001 From: Nicolas Van Labeke Date: Tue, 3 Jun 2025 09:57:05 +0100 Subject: [PATCH 033/121] Merge pull request #995 * refactor(29945): remove deprecated store-based list of functions * refactor(29945): refactor the react-query hook * refactor(29945): update openAPI specs * refactor(29945): update mocks for functions * refactor(29945): fix mocks * test(29945): add tests * refactor(29945): update openAPI specs * refactor(29945): fix dataOnly for mocks * refactor(29945): add license-free mocks * feat(29945): add filtering hook for functions * test(29945): add tests * refactor(29945): fix default MSW handlers * refactor(29945): refactor the JSONSchema for operation as a template * refactor(29945): Add the DataHub.transform function to the list * refactor(29945): add functions to the selector * refactor(29945): add functions to the editor * refactor(29945): add functions to the form context * refactor(29945): get context of the pipeline * refactor(29945): replace deprecated type * refactor(29945): linting * test(29945): fix tests * test(29945): fix tests * test(29945): add tests * test(29945): add tests * fix(29945): fix tsc errors * chore(29945): fix scripts * chore(29945): fix translations * test(29945): fix tests * test(29945): fix tests * test(29945): fix tests * test(29945): fix tests * chore(29945): revert fix --- .../datahub/hooks/useGetFilteredFunctions.tsx | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 hivemq-edge-frontend/src/extensions/datahub/hooks/useGetFilteredFunctions.tsx diff --git a/hivemq-edge-frontend/src/extensions/datahub/hooks/useGetFilteredFunctions.tsx b/hivemq-edge-frontend/src/extensions/datahub/hooks/useGetFilteredFunctions.tsx new file mode 100644 index 0000000000..2ee8a2c742 --- /dev/null +++ b/hivemq-edge-frontend/src/extensions/datahub/hooks/useGetFilteredFunctions.tsx @@ -0,0 +1,66 @@ +import { useMemo } from 'react' + +import { BehaviorPolicyTransitionEvent, type FunctionSpecs } from '@/api/__generated__' +import { DataHubNodeType } from '@datahub/types.ts' +import { useGetAllFunctionSpecs } from '@datahub/api/hooks/DataHubFunctionsService/useGetAllFunctionSpecs.ts' + +export const MqttTransformFunction: FunctionSpecs = { + functionId: 'DataHub.transform', + metadata: { + inLicenseAllowed: true, + isTerminal: false, + isDataOnly: false, + hasArguments: true, + supportedEvents: [ + BehaviorPolicyTransitionEvent.EVENT_ON_ANY, + BehaviorPolicyTransitionEvent.MQTT_ON_INBOUND_CONNECT, + BehaviorPolicyTransitionEvent.MQTT_ON_INBOUND_PUBLISH, + BehaviorPolicyTransitionEvent.MQTT_ON_INBOUND_SUBSCRIBE, + BehaviorPolicyTransitionEvent.MQTT_ON_INBOUND_DISCONNECT, + BehaviorPolicyTransitionEvent.CONNECTION_ON_DISCONNECT, + ], + }, + schema: { + title: 'Transformation', + description: + 'The list of Javascript functions used in this transformation operation. Add them directly on the graph', + properties: { + transform: { + type: 'array', + title: 'Execution order', + description: 'Change the order in which the transform functions will be executed', + items: { + type: 'string', + title: 'Function name', + }, + }, + }, + }, +} + +export const useGetFilteredFunction = ( + type: DataHubNodeType = DataHubNodeType.DATA_POLICY, + transition?: BehaviorPolicyTransitionEvent +) => { + const { isError, error, isLoading, isSuccess, data } = useGetAllFunctionSpecs() + + const filteredFunctions = useMemo(() => { + if (!data || !data.items?.length) return [] + + return data.items.filter((functionSpec) => { + if (!functionSpec.metadata.inLicenseAllowed) return false + if ( + functionSpec.metadata.supportedEvents?.length && + transition && + !functionSpec.metadata.supportedEvents.includes(transition) + ) + return false + if (functionSpec.metadata.isDataOnly && type !== DataHubNodeType.DATA_POLICY) return false + + // In all other cases, the function is valid + return true + }) + }, [data, transition, type]) + + return { data: [...filteredFunctions, MqttTransformFunction], isError, error, isLoading, isSuccess } +} From cdcc735e4d1df765c1a94109b01bd5d630d45568 Mon Sep 17 00:00:00 2001 From: Nicolas Van Labeke Date: Tue, 3 Jun 2025 10:04:05 +0100 Subject: [PATCH 034/121] Merge pull request #997 * fix(29930): add onclose callback to the tools * fix(29930): refactor the data transfer key * fix(29930): clear data transfer key --- .../src/extensions/datahub/utils/datahub.utils.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hivemq-edge-frontend/src/extensions/datahub/utils/datahub.utils.ts b/hivemq-edge-frontend/src/extensions/datahub/utils/datahub.utils.ts index 8b86eee383..bd795fdeed 100644 --- a/hivemq-edge-frontend/src/extensions/datahub/utils/datahub.utils.ts +++ b/hivemq-edge-frontend/src/extensions/datahub/utils/datahub.utils.ts @@ -3,6 +3,8 @@ import { OperationData } from '@datahub/types.ts' export const DND_DESIGNER_NODE_TYPE = 'application/reactflow;type=designer-node' +export const DND_DESIGNER_NODE_TYPE = 'application/reactflow;type=designer-node' + export const SCRIPT_FUNCTION_SEPARATOR = ':' export const SCRIPT_FUNCTION_PREFIX = 'fn' export const SCRIPT_FUNCTION_LATEST = 'latest' From bdf7a3aa4e9707cdc540565bd60a7aa518298858 Mon Sep 17 00:00:00 2001 From: Nicolas Van Labeke Date: Tue, 3 Jun 2025 10:52:30 +0100 Subject: [PATCH 035/121] Merge pull request #998 * refactor(29945): update openAPI specs * refactor(29945): fix mocks * feat(29945): add filtering hook for functions * refactor(29945): Add the DataHub.transform function to the list * chore(29945): fix translations * test(29945): fix tests * chore(29945): revert fix * fix(24800): fix the format of the topic property * fix(24800): fix the widget for the topic property * test(24800): fix tests * fix(24800): fix rebase --- .../datahub/designer/operation/OperationPanel.spec.cy.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hivemq-edge-frontend/src/extensions/datahub/designer/operation/OperationPanel.spec.cy.tsx b/hivemq-edge-frontend/src/extensions/datahub/designer/operation/OperationPanel.spec.cy.tsx index c606d08f3e..02dac3b008 100644 --- a/hivemq-edge-frontend/src/extensions/datahub/designer/operation/OperationPanel.spec.cy.tsx +++ b/hivemq-edge-frontend/src/extensions/datahub/designer/operation/OperationPanel.spec.cy.tsx @@ -194,7 +194,7 @@ describe('OperationPanel', () => { }, } - it('should render the form', () => { + it.only('should render the form', () => { cy.mountWithProviders(, { wrapper: getWrapperWith([node]), }) From 108e1f07987a1c3748e1865dab7c14670ad7625e Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Tue, 3 Jun 2025 16:37:30 +0200 Subject: [PATCH 036/121] refactor: Reuse ProblemDetails, add RequestBodyParameterMissingError --- ext/hivemq-edge-openapi-2025.9.yaml | 214 ++++++++++++------ .../components/schemas/errors/ApiError.yaml | 28 --- .../BehaviorPolicyAlreadyPresentError.yaml | 2 +- .../BehaviorPolicyCreationFailureError.yaml | 6 +- .../datahub/BehaviorPolicyNotFoundError.yaml | 2 +- .../datahub/BehaviorPolicyRejectedError.yaml | 8 +- .../BehaviorPolicyUpdateFailureError.yaml | 6 +- .../datahub/ClientDisconnectedError.yaml | 2 +- .../errors/datahub/ClientNotFoundError.yaml | 2 +- .../DataPolicyAlreadyPresentError.yaml | 2 +- .../DataPolicyCreationFailureError.yaml | 6 +- .../datahub/DataPolicyInvalidErrors.yaml | 6 + .../datahub/DataPolicyNotFoundError.yaml | 2 +- .../datahub/DataPolicyRejectedError.yaml | 8 +- .../datahub/DataPolicyUpdateFailureError.yaml | 6 +- .../errors/datahub/PolicyIdMismatchError.yaml | 6 +- .../errors/datahub/PolicyNotFoundError.yaml | 2 +- .../datahub/SchemaAlreadyPresentError.yaml | 2 +- .../datahub/SchemaEtagMismatchError.yaml | 2 +- .../errors/datahub/SchemaInvalidErrors.yaml | 6 + .../errors/datahub/SchemaNotFoundError.yaml | 2 +- .../datahub/SchemaParsingFailureError.yaml | 6 +- .../errors/datahub/SchemaReferencedError.yaml | 6 +- .../datahub/ScriptAlreadyPresentError.yaml | 2 +- .../datahub/ScriptCreationFailureError.yaml | 6 +- .../datahub/ScriptEtagMismatchError.yaml | 2 +- .../errors/datahub/ScriptInvalidErrors.yaml | 6 + .../errors/datahub/ScriptNotFoundError.yaml | 2 +- .../datahub/ScriptParsingFailureError.yaml | 6 +- .../errors/datahub/ScriptReferencedError.yaml | 6 +- .../datahub/ScriptSanitationFailureError.yaml | 6 +- .../datahub/TopicFilterMismatchError.yaml | 6 +- .../errors/http/InsufficientStorageError.yaml | 2 +- .../errors/http/InternalServerError.yaml | 2 +- .../http/InvalidQueryParameterError.yaml | 6 +- .../errors/http/PreconditionFailedError.yaml | 2 +- .../errors/http/RequestBodyMissingError.yaml | 9 +- .../RequestBodyParameterMissingError.yaml | 13 ++ .../http/TemporaryNotAvailableError.yaml | 2 +- .../errors/http/UrlParameterMissingError.yaml | 6 +- .../errors/validation/ValidationErrors.yaml | 6 +- .../paths/api_v1_data-hub_schemas.yaml | 2 +- .../paths/api_v1_data-hub_scripts.yaml | 2 +- .../hivemq/api/errors/HttpErrorFactory.java | 17 +- 44 files changed, 299 insertions(+), 144 deletions(-) delete mode 100644 ext/openAPI/components/schemas/errors/ApiError.yaml create mode 100644 ext/openAPI/components/schemas/errors/http/RequestBodyParameterMissingError.yaml diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index 8c95536b21..710800ba26 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -1980,7 +1980,7 @@ paths: application/json: schema: oneOf: - - $ref: '#/components/schemas/RequestBodyMissingError' + - $ref: '#/components/schemas/RequestBodyParameterMissingError' - $ref: '#/components/schemas/SchemaInvalidErrors' - $ref: '#/components/schemas/SchemaParsingFailureError' discriminator: @@ -2329,7 +2329,7 @@ paths: application/json: schema: oneOf: - - $ref: '#/components/schemas/RequestBodyMissingError' + - $ref: '#/components/schemas/RequestBodyParameterMissingError' - $ref: '#/components/schemas/ScriptCreationFailureError' - $ref: '#/components/schemas/ScriptInvalidErrors' - $ref: '#/components/schemas/ScriptParsingFailureError' @@ -4769,40 +4769,11 @@ components: description: List of result items that are returned by this endpoint items: $ref: '#/components/schemas/BehaviorPolicy' - ApiError: - type: object - x-implements: - - com.hivemq.api.errors.OpenApiError - properties: - code: - type: string - description: Correlation id. - detail: - type: string - description: A detailed description of the error. - title: - type: string - description: A short, human-readable summary of the error. - type: - type: string - format: uri - description: A URI reference that identifies the error type. - status: - type: integer - default: 400 - format: int32 - minimum: 100 - maximum: 599 - description: The HTTP status code associated with the error. - required: - - title - - status - - type InvalidQueryParameterError: x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: '#/components/schemas/ApiError' + - $ref: '#/components/schemas/ProblemDetails' - type: object properties: parameter: @@ -4811,6 +4782,10 @@ components: reason: type: string description: The reason. + status: + type: integer + default: 400 + description: The HTTP status code. required: - parameter - reason @@ -4818,7 +4793,7 @@ components: x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: '#/components/schemas/ApiError' + - $ref: '#/components/schemas/ProblemDetails' - type: object properties: status: @@ -4829,22 +4804,27 @@ components: x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: '#/components/schemas/ApiError' + - $ref: '#/components/schemas/ProblemDetails' - type: object properties: - parameter: - type: string - description: The the missing request body parameter. + status: + type: integer + default: 400 + description: The HTTP status code. BehaviorPolicyCreationFailureError: x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: '#/components/schemas/ApiError' + - $ref: '#/components/schemas/ProblemDetails' - type: object properties: reason: type: string description: The actual reason. + status: + type: integer + default: 400 + description: The HTTP status code. required: - reason ValidationError: @@ -5145,7 +5125,7 @@ components: x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: '#/components/schemas/ApiError' + - $ref: '#/components/schemas/ProblemDetails' - type: object properties: errors: @@ -5153,6 +5133,10 @@ components: description: List of validation errors. items: $ref: '#/components/schemas/ValidationError' + status: + type: integer + default: 400 + description: The HTTP status code. required: - errors BehaviorPolicyInvalidErrors: @@ -5164,12 +5148,18 @@ components: x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: '#/components/schemas/ApiError' + - $ref: '#/components/schemas/ProblemDetails' + - type: object + properties: + status: + type: integer + default: 400 + description: The HTTP status code. BehaviorPolicyAlreadyPresentError: x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: '#/components/schemas/ApiError' + - $ref: '#/components/schemas/ProblemDetails' - type: object properties: id: @@ -5188,7 +5178,7 @@ components: x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: '#/components/schemas/ApiError' + - $ref: '#/components/schemas/ProblemDetails' - type: object properties: reason: @@ -5202,7 +5192,7 @@ components: x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: '#/components/schemas/ApiError' + - $ref: '#/components/schemas/ProblemDetails' - type: object properties: reason: @@ -5216,19 +5206,23 @@ components: x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: '#/components/schemas/ApiError' + - $ref: '#/components/schemas/ProblemDetails' - type: object properties: parameter: type: string description: The name of the missing parameter. + status: + type: integer + default: 400 + description: The HTTP status code. required: - parameter BehaviorPolicyNotFoundError: x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: '#/components/schemas/ApiError' + - $ref: '#/components/schemas/ProblemDetails' - type: object properties: id: @@ -5247,7 +5241,7 @@ components: x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: '#/components/schemas/ApiError' + - $ref: '#/components/schemas/ProblemDetails' - type: object properties: id: @@ -5256,13 +5250,17 @@ components: reason: type: string description: The actual reason. + status: + type: integer + default: 400 + description: The HTTP status code. required: - id PolicyIdMismatchError: x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: '#/components/schemas/ApiError' + - $ref: '#/components/schemas/ProblemDetails' - type: object properties: actualId: @@ -5271,6 +5269,10 @@ components: expectedId: type: string description: The expected id. + status: + type: integer + default: 400 + description: The HTTP status code. required: - actualId - expectedId @@ -5278,7 +5280,7 @@ components: x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: '#/components/schemas/ApiError' + - $ref: '#/components/schemas/ProblemDetails' - type: object properties: reason: @@ -5294,7 +5296,7 @@ components: x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: '#/components/schemas/ApiError' + - $ref: '#/components/schemas/ProblemDetails' - type: object properties: id: @@ -5350,7 +5352,7 @@ components: x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: '#/components/schemas/ApiError' + - $ref: '#/components/schemas/ProblemDetails' - type: object properties: id: @@ -5366,7 +5368,7 @@ components: x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: '#/components/schemas/ApiError' + - $ref: '#/components/schemas/ProblemDetails' - type: object properties: id: @@ -5463,12 +5465,16 @@ components: x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: '#/components/schemas/ApiError' + - $ref: '#/components/schemas/ProblemDetails' - type: object properties: reason: type: string description: The actual reason. + status: + type: integer + default: 400 + description: The HTTP status code. required: - reason DataPolicyInvalidErrors: @@ -5476,16 +5482,28 @@ components: - com.hivemq.api.errors.OpenApiError allOf: - $ref: '#/components/schemas/ValidationErrors' + - type: object + properties: + status: + type: integer + default: 400 + description: The HTTP status code. DataPolicyRejectedError: x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: '#/components/schemas/ApiError' + - $ref: '#/components/schemas/ProblemDetails' + - type: object + properties: + status: + type: integer + default: 400 + description: The HTTP status code. DataPolicyAlreadyPresentError: x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: '#/components/schemas/ApiError' + - $ref: '#/components/schemas/ProblemDetails' - type: object properties: id: @@ -5504,7 +5522,7 @@ components: x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: '#/components/schemas/ApiError' + - $ref: '#/components/schemas/ProblemDetails' - type: object properties: id: @@ -5513,13 +5531,17 @@ components: reason: type: string description: The actual reason. + status: + type: integer + default: 400 + description: The HTTP status code. required: - id TopicFilterMismatchError: x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: '#/components/schemas/ApiError' + - $ref: '#/components/schemas/ProblemDetails' - type: object properties: message: @@ -5528,13 +5550,17 @@ components: parameter: type: string description: The parameter. + status: + type: integer + default: 400 + description: The HTTP status code. required: - parameter DataPolicyNotFoundError: x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: '#/components/schemas/ApiError' + - $ref: '#/components/schemas/ProblemDetails' - type: object properties: id: @@ -5652,16 +5678,36 @@ components: description: List of result items that are returned by this endpoint items: $ref: '#/components/schemas/PolicySchema' + RequestBodyParameterMissingError: + x-implements: + - com.hivemq.api.errors.OpenApiError + allOf: + - $ref: '#/components/schemas/ProblemDetails' + - type: object + properties: + parameter: + type: string + description: The the missing request body parameter. + status: + type: integer + default: 400 + description: The HTTP status code. SchemaInvalidErrors: x-implements: - com.hivemq.api.errors.OpenApiError allOf: - $ref: '#/components/schemas/ValidationErrors' + - type: object + properties: + status: + type: integer + default: 400 + description: The HTTP status code. SchemaParsingFailureError: x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: '#/components/schemas/ApiError' + - $ref: '#/components/schemas/ProblemDetails' - type: object properties: alias: @@ -5670,6 +5716,10 @@ components: message: type: string description: The error message. + status: + type: integer + default: 400 + description: The HTTP status code. required: - alias - message @@ -5677,7 +5727,7 @@ components: x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: '#/components/schemas/ApiError' + - $ref: '#/components/schemas/ProblemDetails' - type: object properties: id: @@ -5693,7 +5743,7 @@ components: x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: '#/components/schemas/ApiError' + - $ref: '#/components/schemas/ProblemDetails' - type: object properties: id: @@ -5712,7 +5762,7 @@ components: x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: '#/components/schemas/ApiError' + - $ref: '#/components/schemas/ProblemDetails' - type: object properties: id: @@ -5731,7 +5781,7 @@ components: x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: '#/components/schemas/ApiError' + - $ref: '#/components/schemas/ProblemDetails' - type: object properties: id: @@ -5740,6 +5790,10 @@ components: message: type: string description: The error message. + status: + type: integer + default: 400 + description: The HTTP status code. required: - id Script: @@ -5787,12 +5841,16 @@ components: x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: '#/components/schemas/ApiError' + - $ref: '#/components/schemas/ProblemDetails' - type: object properties: reason: type: string description: The actual reason. + status: + type: integer + default: 400 + description: The HTTP status code. required: - reason ScriptInvalidErrors: @@ -5800,35 +5858,49 @@ components: - com.hivemq.api.errors.OpenApiError allOf: - $ref: '#/components/schemas/ValidationErrors' + - type: object + properties: + status: + type: integer + default: 400 + description: The HTTP status code. ScriptParsingFailureError: x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: '#/components/schemas/ApiError' + - $ref: '#/components/schemas/ProblemDetails' - type: object properties: reason: type: string description: The actual reason. + status: + type: integer + default: 400 + description: The HTTP status code. required: - reason ScriptSanitationFailureError: x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: '#/components/schemas/ApiError' + - $ref: '#/components/schemas/ProblemDetails' - type: object properties: reason: type: string description: The actual reason. + status: + type: integer + default: 400 + description: The HTTP status code. required: - reason ScriptAlreadyPresentError: x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: '#/components/schemas/ApiError' + - $ref: '#/components/schemas/ProblemDetails' - type: object properties: id: @@ -5844,7 +5916,7 @@ components: x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: '#/components/schemas/ApiError' + - $ref: '#/components/schemas/ProblemDetails' - type: object properties: id: @@ -5863,7 +5935,7 @@ components: x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: '#/components/schemas/ApiError' + - $ref: '#/components/schemas/ProblemDetails' - type: object properties: id: @@ -5882,7 +5954,7 @@ components: x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: '#/components/schemas/ApiError' + - $ref: '#/components/schemas/ProblemDetails' - type: object properties: id: @@ -5891,6 +5963,10 @@ components: message: type: string description: The error message. + status: + type: integer + default: 400 + description: The HTTP status code. required: - id Capability: diff --git a/ext/openAPI/components/schemas/errors/ApiError.yaml b/ext/openAPI/components/schemas/errors/ApiError.yaml deleted file mode 100644 index 1ae1c081e1..0000000000 --- a/ext/openAPI/components/schemas/errors/ApiError.yaml +++ /dev/null @@ -1,28 +0,0 @@ -type: object -x-implements: - - com.hivemq.api.errors.OpenApiError -properties: - code: - type: string - description: Correlation id. - detail: - type: string - description: A detailed description of the error. - title: - type: string - description: A short, human-readable summary of the error. - type: - type: string - format: uri - description: A URI reference that identifies the error type. - status: - type: integer - default: 400 - format: int32 - minimum: 100 - maximum: 599 - description: The HTTP status code associated with the error. -required: - - title - - status - - type diff --git a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyAlreadyPresentError.yaml b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyAlreadyPresentError.yaml index a970579c25..18ad008d1b 100644 --- a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyAlreadyPresentError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyAlreadyPresentError.yaml @@ -1,7 +1,7 @@ x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../ApiError.yaml" + - $ref: "../../ProblemDetails.yaml" - type: object properties: id: diff --git a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyCreationFailureError.yaml b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyCreationFailureError.yaml index 3028b6deb3..7784cacb04 100644 --- a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyCreationFailureError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyCreationFailureError.yaml @@ -1,11 +1,15 @@ x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../ApiError.yaml" + - $ref: "../../ProblemDetails.yaml" - type: object properties: reason: type: string description: The actual reason. + status: + type: integer + default: 400 + description: The HTTP status code. required: - reason diff --git a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyNotFoundError.yaml b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyNotFoundError.yaml index db2a81d359..a9b5fc6062 100644 --- a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyNotFoundError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyNotFoundError.yaml @@ -1,7 +1,7 @@ x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../ApiError.yaml" + - $ref: "../../ProblemDetails.yaml" - type: object properties: id: diff --git a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyRejectedError.yaml b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyRejectedError.yaml index 60375f8936..8d7d8b4ed0 100644 --- a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyRejectedError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyRejectedError.yaml @@ -1,4 +1,10 @@ x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../ApiError.yaml" + - $ref: "../../ProblemDetails.yaml" + - type: object + properties: + status: + type: integer + default: 400 + description: The HTTP status code. diff --git a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyUpdateFailureError.yaml b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyUpdateFailureError.yaml index 2ffb72d071..a36f8a4cb9 100644 --- a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyUpdateFailureError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyUpdateFailureError.yaml @@ -1,7 +1,7 @@ x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../ApiError.yaml" + - $ref: "../../ProblemDetails.yaml" - type: object properties: id: @@ -10,5 +10,9 @@ allOf: reason: type: string description: The actual reason. + status: + type: integer + default: 400 + description: The HTTP status code. required: - id diff --git a/ext/openAPI/components/schemas/errors/datahub/ClientDisconnectedError.yaml b/ext/openAPI/components/schemas/errors/datahub/ClientDisconnectedError.yaml index 4ccdaeb435..2afb205bbb 100644 --- a/ext/openAPI/components/schemas/errors/datahub/ClientDisconnectedError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/ClientDisconnectedError.yaml @@ -1,7 +1,7 @@ x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../ApiError.yaml" + - $ref: "../../ProblemDetails.yaml" - type: object properties: id: diff --git a/ext/openAPI/components/schemas/errors/datahub/ClientNotFoundError.yaml b/ext/openAPI/components/schemas/errors/datahub/ClientNotFoundError.yaml index 4ccdaeb435..2afb205bbb 100644 --- a/ext/openAPI/components/schemas/errors/datahub/ClientNotFoundError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/ClientNotFoundError.yaml @@ -1,7 +1,7 @@ x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../ApiError.yaml" + - $ref: "../../ProblemDetails.yaml" - type: object properties: id: diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyAlreadyPresentError.yaml b/ext/openAPI/components/schemas/errors/datahub/DataPolicyAlreadyPresentError.yaml index 2bf3ea9172..052f69fbe2 100644 --- a/ext/openAPI/components/schemas/errors/datahub/DataPolicyAlreadyPresentError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/DataPolicyAlreadyPresentError.yaml @@ -1,7 +1,7 @@ x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../ApiError.yaml" + - $ref: "../../ProblemDetails.yaml" - type: object properties: id: diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyCreationFailureError.yaml b/ext/openAPI/components/schemas/errors/datahub/DataPolicyCreationFailureError.yaml index 3028b6deb3..7784cacb04 100644 --- a/ext/openAPI/components/schemas/errors/datahub/DataPolicyCreationFailureError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/DataPolicyCreationFailureError.yaml @@ -1,11 +1,15 @@ x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../ApiError.yaml" + - $ref: "../../ProblemDetails.yaml" - type: object properties: reason: type: string description: The actual reason. + status: + type: integer + default: 400 + description: The HTTP status code. required: - reason diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyInvalidErrors.yaml b/ext/openAPI/components/schemas/errors/datahub/DataPolicyInvalidErrors.yaml index f737385842..dd1411d4e4 100644 --- a/ext/openAPI/components/schemas/errors/datahub/DataPolicyInvalidErrors.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/DataPolicyInvalidErrors.yaml @@ -2,3 +2,9 @@ x-implements: - com.hivemq.api.errors.OpenApiError allOf: - $ref: "../validation/ValidationErrors.yaml" + - type: object + properties: + status: + type: integer + default: 400 + description: The HTTP status code. diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyNotFoundError.yaml b/ext/openAPI/components/schemas/errors/datahub/DataPolicyNotFoundError.yaml index db2a81d359..a9b5fc6062 100644 --- a/ext/openAPI/components/schemas/errors/datahub/DataPolicyNotFoundError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/DataPolicyNotFoundError.yaml @@ -1,7 +1,7 @@ x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../ApiError.yaml" + - $ref: "../../ProblemDetails.yaml" - type: object properties: id: diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyRejectedError.yaml b/ext/openAPI/components/schemas/errors/datahub/DataPolicyRejectedError.yaml index 60375f8936..8d7d8b4ed0 100644 --- a/ext/openAPI/components/schemas/errors/datahub/DataPolicyRejectedError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/DataPolicyRejectedError.yaml @@ -1,4 +1,10 @@ x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../ApiError.yaml" + - $ref: "../../ProblemDetails.yaml" + - type: object + properties: + status: + type: integer + default: 400 + description: The HTTP status code. diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyUpdateFailureError.yaml b/ext/openAPI/components/schemas/errors/datahub/DataPolicyUpdateFailureError.yaml index 2ffb72d071..a36f8a4cb9 100644 --- a/ext/openAPI/components/schemas/errors/datahub/DataPolicyUpdateFailureError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/DataPolicyUpdateFailureError.yaml @@ -1,7 +1,7 @@ x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../ApiError.yaml" + - $ref: "../../ProblemDetails.yaml" - type: object properties: id: @@ -10,5 +10,9 @@ allOf: reason: type: string description: The actual reason. + status: + type: integer + default: 400 + description: The HTTP status code. required: - id diff --git a/ext/openAPI/components/schemas/errors/datahub/PolicyIdMismatchError.yaml b/ext/openAPI/components/schemas/errors/datahub/PolicyIdMismatchError.yaml index f1c86078a3..22f41c1646 100644 --- a/ext/openAPI/components/schemas/errors/datahub/PolicyIdMismatchError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/PolicyIdMismatchError.yaml @@ -1,7 +1,7 @@ x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../ApiError.yaml" + - $ref: "../../ProblemDetails.yaml" - type: object properties: actualId: @@ -10,6 +10,10 @@ allOf: expectedId: type: string description: The expected id. + status: + type: integer + default: 400 + description: The HTTP status code. required: - actualId - expectedId diff --git a/ext/openAPI/components/schemas/errors/datahub/PolicyNotFoundError.yaml b/ext/openAPI/components/schemas/errors/datahub/PolicyNotFoundError.yaml index 109e2249b1..5818193349 100644 --- a/ext/openAPI/components/schemas/errors/datahub/PolicyNotFoundError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/PolicyNotFoundError.yaml @@ -1,7 +1,7 @@ x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../ApiError.yaml" + - $ref: "../../ProblemDetails.yaml" - type: object properties: id: diff --git a/ext/openAPI/components/schemas/errors/datahub/SchemaAlreadyPresentError.yaml b/ext/openAPI/components/schemas/errors/datahub/SchemaAlreadyPresentError.yaml index 82eaef868b..0b416133d8 100644 --- a/ext/openAPI/components/schemas/errors/datahub/SchemaAlreadyPresentError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/SchemaAlreadyPresentError.yaml @@ -1,7 +1,7 @@ x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../ApiError.yaml" + - $ref: "../../ProblemDetails.yaml" - type: object properties: id: diff --git a/ext/openAPI/components/schemas/errors/datahub/SchemaEtagMismatchError.yaml b/ext/openAPI/components/schemas/errors/datahub/SchemaEtagMismatchError.yaml index f445828192..9d2938e0ea 100644 --- a/ext/openAPI/components/schemas/errors/datahub/SchemaEtagMismatchError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/SchemaEtagMismatchError.yaml @@ -1,7 +1,7 @@ x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../ApiError.yaml" + - $ref: "../../ProblemDetails.yaml" - type: object properties: id: diff --git a/ext/openAPI/components/schemas/errors/datahub/SchemaInvalidErrors.yaml b/ext/openAPI/components/schemas/errors/datahub/SchemaInvalidErrors.yaml index f737385842..dd1411d4e4 100644 --- a/ext/openAPI/components/schemas/errors/datahub/SchemaInvalidErrors.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/SchemaInvalidErrors.yaml @@ -2,3 +2,9 @@ x-implements: - com.hivemq.api.errors.OpenApiError allOf: - $ref: "../validation/ValidationErrors.yaml" + - type: object + properties: + status: + type: integer + default: 400 + description: The HTTP status code. diff --git a/ext/openAPI/components/schemas/errors/datahub/SchemaNotFoundError.yaml b/ext/openAPI/components/schemas/errors/datahub/SchemaNotFoundError.yaml index b42d6e7660..b6878bf50d 100644 --- a/ext/openAPI/components/schemas/errors/datahub/SchemaNotFoundError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/SchemaNotFoundError.yaml @@ -1,7 +1,7 @@ x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../ApiError.yaml" + - $ref: "../../ProblemDetails.yaml" - type: object properties: id: diff --git a/ext/openAPI/components/schemas/errors/datahub/SchemaParsingFailureError.yaml b/ext/openAPI/components/schemas/errors/datahub/SchemaParsingFailureError.yaml index f582f0513c..2037aef5ad 100644 --- a/ext/openAPI/components/schemas/errors/datahub/SchemaParsingFailureError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/SchemaParsingFailureError.yaml @@ -1,7 +1,7 @@ x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../ApiError.yaml" + - $ref: "../../ProblemDetails.yaml" - type: object properties: alias: @@ -10,6 +10,10 @@ allOf: message: type: string description: The error message. + status: + type: integer + default: 400 + description: The HTTP status code. required: - alias - message diff --git a/ext/openAPI/components/schemas/errors/datahub/SchemaReferencedError.yaml b/ext/openAPI/components/schemas/errors/datahub/SchemaReferencedError.yaml index d2832a9829..a220a52516 100644 --- a/ext/openAPI/components/schemas/errors/datahub/SchemaReferencedError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/SchemaReferencedError.yaml @@ -1,7 +1,7 @@ x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../ApiError.yaml" + - $ref: "../../ProblemDetails.yaml" - type: object properties: id: @@ -10,5 +10,9 @@ allOf: message: type: string description: The error message. + status: + type: integer + default: 400 + description: The HTTP status code. required: - id diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptAlreadyPresentError.yaml b/ext/openAPI/components/schemas/errors/datahub/ScriptAlreadyPresentError.yaml index 1a38dcac2b..530391d730 100644 --- a/ext/openAPI/components/schemas/errors/datahub/ScriptAlreadyPresentError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/ScriptAlreadyPresentError.yaml @@ -1,7 +1,7 @@ x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../ApiError.yaml" + - $ref: "../../ProblemDetails.yaml" - type: object properties: id: diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptCreationFailureError.yaml b/ext/openAPI/components/schemas/errors/datahub/ScriptCreationFailureError.yaml index 3028b6deb3..7784cacb04 100644 --- a/ext/openAPI/components/schemas/errors/datahub/ScriptCreationFailureError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/ScriptCreationFailureError.yaml @@ -1,11 +1,15 @@ x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../ApiError.yaml" + - $ref: "../../ProblemDetails.yaml" - type: object properties: reason: type: string description: The actual reason. + status: + type: integer + default: 400 + description: The HTTP status code. required: - reason diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptEtagMismatchError.yaml b/ext/openAPI/components/schemas/errors/datahub/ScriptEtagMismatchError.yaml index 9616050f31..f8d9c8658a 100644 --- a/ext/openAPI/components/schemas/errors/datahub/ScriptEtagMismatchError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/ScriptEtagMismatchError.yaml @@ -1,7 +1,7 @@ x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../ApiError.yaml" + - $ref: "../../ProblemDetails.yaml" - type: object properties: id: diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptInvalidErrors.yaml b/ext/openAPI/components/schemas/errors/datahub/ScriptInvalidErrors.yaml index f737385842..dd1411d4e4 100644 --- a/ext/openAPI/components/schemas/errors/datahub/ScriptInvalidErrors.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/ScriptInvalidErrors.yaml @@ -2,3 +2,9 @@ x-implements: - com.hivemq.api.errors.OpenApiError allOf: - $ref: "../validation/ValidationErrors.yaml" + - type: object + properties: + status: + type: integer + default: 400 + description: The HTTP status code. diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptNotFoundError.yaml b/ext/openAPI/components/schemas/errors/datahub/ScriptNotFoundError.yaml index 5c7a2892d2..7755cdeb02 100644 --- a/ext/openAPI/components/schemas/errors/datahub/ScriptNotFoundError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/ScriptNotFoundError.yaml @@ -1,7 +1,7 @@ x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../ApiError.yaml" + - $ref: "../../ProblemDetails.yaml" - type: object properties: id: diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptParsingFailureError.yaml b/ext/openAPI/components/schemas/errors/datahub/ScriptParsingFailureError.yaml index 3028b6deb3..7784cacb04 100644 --- a/ext/openAPI/components/schemas/errors/datahub/ScriptParsingFailureError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/ScriptParsingFailureError.yaml @@ -1,11 +1,15 @@ x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../ApiError.yaml" + - $ref: "../../ProblemDetails.yaml" - type: object properties: reason: type: string description: The actual reason. + status: + type: integer + default: 400 + description: The HTTP status code. required: - reason diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptReferencedError.yaml b/ext/openAPI/components/schemas/errors/datahub/ScriptReferencedError.yaml index c78dc914bc..74ccb23143 100644 --- a/ext/openAPI/components/schemas/errors/datahub/ScriptReferencedError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/ScriptReferencedError.yaml @@ -1,7 +1,7 @@ x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../ApiError.yaml" + - $ref: "../../ProblemDetails.yaml" - type: object properties: id: @@ -10,5 +10,9 @@ allOf: message: type: string description: The error message. + status: + type: integer + default: 400 + description: The HTTP status code. required: - id diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptSanitationFailureError.yaml b/ext/openAPI/components/schemas/errors/datahub/ScriptSanitationFailureError.yaml index 3028b6deb3..7784cacb04 100644 --- a/ext/openAPI/components/schemas/errors/datahub/ScriptSanitationFailureError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/ScriptSanitationFailureError.yaml @@ -1,11 +1,15 @@ x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../ApiError.yaml" + - $ref: "../../ProblemDetails.yaml" - type: object properties: reason: type: string description: The actual reason. + status: + type: integer + default: 400 + description: The HTTP status code. required: - reason diff --git a/ext/openAPI/components/schemas/errors/datahub/TopicFilterMismatchError.yaml b/ext/openAPI/components/schemas/errors/datahub/TopicFilterMismatchError.yaml index d0692de5a3..b3bc2e78ae 100644 --- a/ext/openAPI/components/schemas/errors/datahub/TopicFilterMismatchError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/TopicFilterMismatchError.yaml @@ -1,7 +1,7 @@ x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../ApiError.yaml" + - $ref: "../../ProblemDetails.yaml" - type: object properties: message: @@ -10,5 +10,9 @@ allOf: parameter: type: string description: The parameter. + status: + type: integer + default: 400 + description: The HTTP status code. required: - parameter diff --git a/ext/openAPI/components/schemas/errors/http/InsufficientStorageError.yaml b/ext/openAPI/components/schemas/errors/http/InsufficientStorageError.yaml index ba3c24c702..d91616bae0 100644 --- a/ext/openAPI/components/schemas/errors/http/InsufficientStorageError.yaml +++ b/ext/openAPI/components/schemas/errors/http/InsufficientStorageError.yaml @@ -1,7 +1,7 @@ x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../ApiError.yaml" + - $ref: "../../ProblemDetails.yaml" - type: object properties: reason: diff --git a/ext/openAPI/components/schemas/errors/http/InternalServerError.yaml b/ext/openAPI/components/schemas/errors/http/InternalServerError.yaml index a9d240d66d..adb82e711a 100644 --- a/ext/openAPI/components/schemas/errors/http/InternalServerError.yaml +++ b/ext/openAPI/components/schemas/errors/http/InternalServerError.yaml @@ -1,7 +1,7 @@ x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../ApiError.yaml" + - $ref: "../../ProblemDetails.yaml" - type: object properties: reason: diff --git a/ext/openAPI/components/schemas/errors/http/InvalidQueryParameterError.yaml b/ext/openAPI/components/schemas/errors/http/InvalidQueryParameterError.yaml index eb973b62fc..772a4daa03 100644 --- a/ext/openAPI/components/schemas/errors/http/InvalidQueryParameterError.yaml +++ b/ext/openAPI/components/schemas/errors/http/InvalidQueryParameterError.yaml @@ -1,7 +1,7 @@ x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../ApiError.yaml" + - $ref: "../../ProblemDetails.yaml" - type: object properties: parameter: @@ -10,6 +10,10 @@ allOf: reason: type: string description: The reason. + status: + type: integer + default: 400 + description: The HTTP status code. required: - parameter - reason diff --git a/ext/openAPI/components/schemas/errors/http/PreconditionFailedError.yaml b/ext/openAPI/components/schemas/errors/http/PreconditionFailedError.yaml index 04e6429a2d..ce1fda4f12 100644 --- a/ext/openAPI/components/schemas/errors/http/PreconditionFailedError.yaml +++ b/ext/openAPI/components/schemas/errors/http/PreconditionFailedError.yaml @@ -1,7 +1,7 @@ x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../ApiError.yaml" + - $ref: "../../ProblemDetails.yaml" - type: object properties: reason: diff --git a/ext/openAPI/components/schemas/errors/http/RequestBodyMissingError.yaml b/ext/openAPI/components/schemas/errors/http/RequestBodyMissingError.yaml index 2c7d08b95b..8d7d8b4ed0 100644 --- a/ext/openAPI/components/schemas/errors/http/RequestBodyMissingError.yaml +++ b/ext/openAPI/components/schemas/errors/http/RequestBodyMissingError.yaml @@ -1,9 +1,10 @@ x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../ApiError.yaml" + - $ref: "../../ProblemDetails.yaml" - type: object properties: - parameter: - type: string - description: The the missing request body parameter. + status: + type: integer + default: 400 + description: The HTTP status code. diff --git a/ext/openAPI/components/schemas/errors/http/RequestBodyParameterMissingError.yaml b/ext/openAPI/components/schemas/errors/http/RequestBodyParameterMissingError.yaml new file mode 100644 index 0000000000..8bfadcc89b --- /dev/null +++ b/ext/openAPI/components/schemas/errors/http/RequestBodyParameterMissingError.yaml @@ -0,0 +1,13 @@ +x-implements: + - com.hivemq.api.errors.OpenApiError +allOf: + - $ref: "../../ProblemDetails.yaml" + - type: object + properties: + parameter: + type: string + description: The the missing request body parameter. + status: + type: integer + default: 400 + description: The HTTP status code. diff --git a/ext/openAPI/components/schemas/errors/http/TemporaryNotAvailableError.yaml b/ext/openAPI/components/schemas/errors/http/TemporaryNotAvailableError.yaml index 46322b7c85..01ec74f68b 100644 --- a/ext/openAPI/components/schemas/errors/http/TemporaryNotAvailableError.yaml +++ b/ext/openAPI/components/schemas/errors/http/TemporaryNotAvailableError.yaml @@ -1,7 +1,7 @@ x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../ApiError.yaml" + - $ref: "../../ProblemDetails.yaml" - type: object properties: status: diff --git a/ext/openAPI/components/schemas/errors/http/UrlParameterMissingError.yaml b/ext/openAPI/components/schemas/errors/http/UrlParameterMissingError.yaml index 9955ab2f16..5a4bdd2c8e 100644 --- a/ext/openAPI/components/schemas/errors/http/UrlParameterMissingError.yaml +++ b/ext/openAPI/components/schemas/errors/http/UrlParameterMissingError.yaml @@ -1,11 +1,15 @@ x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../ApiError.yaml" + - $ref: "../../ProblemDetails.yaml" - type: object properties: parameter: type: string description: The name of the missing parameter. + status: + type: integer + default: 400 + description: The HTTP status code. required: - parameter diff --git a/ext/openAPI/components/schemas/errors/validation/ValidationErrors.yaml b/ext/openAPI/components/schemas/errors/validation/ValidationErrors.yaml index 7ff4bdf10c..c4616d7c85 100644 --- a/ext/openAPI/components/schemas/errors/validation/ValidationErrors.yaml +++ b/ext/openAPI/components/schemas/errors/validation/ValidationErrors.yaml @@ -1,7 +1,7 @@ x-implements: - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../ApiError.yaml" + - $ref: "../../ProblemDetails.yaml" - type: object properties: errors: @@ -9,5 +9,9 @@ allOf: description: List of validation errors. items: $ref: "./ValidationError.yaml" + status: + type: integer + default: 400 + description: The HTTP status code. required: - errors diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas.yaml index a6a56b38a8..4352d66de4 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas.yaml @@ -216,7 +216,7 @@ post: application/json: schema: oneOf: - - $ref: "../components/schemas/errors/http/RequestBodyMissingError.yaml" + - $ref: "../components/schemas/errors/http/RequestBodyParameterMissingError.yaml" - $ref: "../components/schemas/errors/datahub/SchemaInvalidErrors.yaml" - $ref: "../components/schemas/errors/datahub/SchemaParsingFailureError.yaml" discriminator: diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts.yaml index 73df529287..a9d905283c 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts.yaml @@ -203,7 +203,7 @@ post: application/json: schema: oneOf: - - $ref: "../components/schemas/errors/http/RequestBodyMissingError.yaml" + - $ref: "../components/schemas/errors/http/RequestBodyParameterMissingError.yaml" - $ref: "../components/schemas/errors/datahub/ScriptCreationFailureError.yaml" - $ref: "../components/schemas/errors/datahub/ScriptInvalidErrors.yaml" - $ref: "../components/schemas/errors/datahub/ScriptParsingFailureError.yaml" diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java index f02d2aa112..e373728482 100644 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java @@ -21,6 +21,7 @@ import com.hivemq.edge.api.model.InvalidQueryParameterError; import com.hivemq.edge.api.model.PreconditionFailedError; import com.hivemq.edge.api.model.RequestBodyMissingError; +import com.hivemq.edge.api.model.RequestBodyParameterMissingError; import com.hivemq.edge.api.model.TemporaryNotAvailableError; import com.hivemq.edge.api.model.UrlParameterMissingError; import org.jetbrains.annotations.NotNull; @@ -76,16 +77,18 @@ private HttpErrorFactory() { } public static @NotNull RequestBodyMissingError requestBodyMissingError() { - return requestBodyMissingError(null); - } - - public static @NotNull RequestBodyMissingError requestBodyMissingError(final @Nullable String parameter) { return RequestBodyMissingError.builder() .type(type(RequestBodyMissingError.class)) .title("Required request body missing") - .detail(parameter == null ? - "Required request body missing." : - "Required request body parameter " + parameter + " missing.") + .detail("Required request body missing.") + .build(); + } + + public static @NotNull RequestBodyParameterMissingError requestBodyParameterMissingError(final @NotNull String parameter) { + return RequestBodyParameterMissingError.builder() + .type(type(RequestBodyParameterMissingError.class)) + .title("Required request body parameter missing") + .detail("Required request body parameter '" + parameter + "' missing.") .parameter(parameter) .build(); } From a602bd3969031ebb476fad36367693ef1711d6ba Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Wed, 4 Jun 2025 11:20:21 +0200 Subject: [PATCH 037/121] refactor: Remove x-implements: - com.hivemq.api.errors.OpenApiValidationError --- ext/hivemq-edge-openapi-2025.9.yaml | 30 ------------------ .../AtMostOneFunctionValidationError.yaml | 2 -- .../FunctionMustBePairedValidationError.yaml | 2 -- .../datahub/GeneralPolicyValidationError.yaml | 2 -- .../IllegalFunctionValidationError.yaml | 2 -- .../IllegalTransitionValidationError.yaml | 2 -- .../InvalidFunctionOrderValidationError.yaml | 2 -- .../UnknownVariableValidationError.yaml | 2 -- ...AtLeastOneFieldMissingValidationError.yaml | 2 -- .../validation/EmptyFieldValidationError.yaml | 2 -- .../InvalidFieldLengthValidationError.yaml | 2 -- .../InvalidFieldValueValidationError.yaml | 2 -- .../InvalidIdentifierValidationError.yaml | 2 -- .../MissingFieldValidationError.yaml | 2 -- .../UnsupportedFieldValidationError.yaml | 2 -- .../errors/validation/ValidationError.yaml | 2 -- .../api/errors/OpenApiValidationError.java | 31 ------------------- 17 files changed, 91 deletions(-) delete mode 100644 hivemq-edge/src/main/java/com/hivemq/api/errors/OpenApiValidationError.java diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index 710800ba26..665477e121 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -4828,8 +4828,6 @@ components: required: - reason ValidationError: - x-implements: - - com.hivemq.api.errors.OpenApiValidationError type: object properties: detail: @@ -4860,8 +4858,6 @@ components: UnknownVariableValidationError: '#/components/schemas/UnknownVariableValidationError' UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' AtLeastOneFieldMissingValidationError: - x-implements: - - com.hivemq.api.errors.OpenApiValidationError allOf: - $ref: '#/components/schemas/ValidationError' - type: object @@ -4874,8 +4870,6 @@ components: required: - fields AtMostOneFunctionValidationError: - x-implements: - - com.hivemq.api.errors.OpenApiValidationError allOf: - $ref: '#/components/schemas/ValidationError' - type: object @@ -4897,8 +4891,6 @@ components: - occurrences - paths EmptyFieldValidationError: - x-implements: - - com.hivemq.api.errors.OpenApiValidationError allOf: - $ref: '#/components/schemas/ValidationError' - type: object @@ -4909,8 +4901,6 @@ components: required: - field FunctionMustBePairedValidationError: - x-implements: - - com.hivemq.api.errors.OpenApiValidationError allOf: - $ref: '#/components/schemas/ValidationError' - type: object @@ -4925,8 +4915,6 @@ components: - existingFunction - missingFunction GeneralPolicyValidationError: - x-implements: - - com.hivemq.api.errors.OpenApiValidationError allOf: - $ref: '#/components/schemas/ValidationError' - type: object @@ -4937,8 +4925,6 @@ components: required: - title IllegalFunctionValidationError: - x-implements: - - com.hivemq.api.errors.OpenApiValidationError allOf: - $ref: '#/components/schemas/ValidationError' - type: object @@ -4961,8 +4947,6 @@ components: - message - path IllegalTransitionValidationError: - x-implements: - - com.hivemq.api.errors.OpenApiValidationError allOf: - $ref: '#/components/schemas/ValidationError' - type: object @@ -4989,8 +4973,6 @@ components: - path - toState InvalidFieldLengthValidationError: - x-implements: - - com.hivemq.api.errors.OpenApiValidationError allOf: - $ref: '#/components/schemas/ValidationError' - type: object @@ -5020,8 +5002,6 @@ components: - field - value InvalidFieldValueValidationError: - x-implements: - - com.hivemq.api.errors.OpenApiValidationError allOf: - $ref: '#/components/schemas/ValidationError' - type: object @@ -5036,8 +5016,6 @@ components: - field - value InvalidFunctionOrderValidationError: - x-implements: - - com.hivemq.api.errors.OpenApiValidationError allOf: - $ref: '#/components/schemas/ValidationError' - type: object @@ -5056,8 +5034,6 @@ components: - function - previousFunction InvalidIdentifierValidationError: - x-implements: - - com.hivemq.api.errors.OpenApiValidationError allOf: - $ref: '#/components/schemas/ValidationError' - type: object @@ -5072,8 +5048,6 @@ components: - field - value MissingFieldValidationError: - x-implements: - - com.hivemq.api.errors.OpenApiValidationError allOf: - $ref: '#/components/schemas/ValidationError' - type: object @@ -5084,8 +5058,6 @@ components: required: - field UnknownVariableValidationError: - x-implements: - - com.hivemq.api.errors.OpenApiValidationError allOf: - $ref: '#/components/schemas/ValidationError' - type: object @@ -5102,8 +5074,6 @@ components: - field - variables UnsupportedFieldValidationError: - x-implements: - - com.hivemq.api.errors.OpenApiValidationError allOf: - $ref: '#/components/schemas/ValidationError' - type: object diff --git a/ext/openAPI/components/schemas/errors/datahub/AtMostOneFunctionValidationError.yaml b/ext/openAPI/components/schemas/errors/datahub/AtMostOneFunctionValidationError.yaml index d09c8fd473..680f975ccd 100644 --- a/ext/openAPI/components/schemas/errors/datahub/AtMostOneFunctionValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/AtMostOneFunctionValidationError.yaml @@ -1,5 +1,3 @@ -x-implements: - - com.hivemq.api.errors.OpenApiValidationError allOf: - $ref: "../validation/ValidationError.yaml" - type: object diff --git a/ext/openAPI/components/schemas/errors/datahub/FunctionMustBePairedValidationError.yaml b/ext/openAPI/components/schemas/errors/datahub/FunctionMustBePairedValidationError.yaml index 904a2d5d04..07ff484703 100644 --- a/ext/openAPI/components/schemas/errors/datahub/FunctionMustBePairedValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/FunctionMustBePairedValidationError.yaml @@ -1,5 +1,3 @@ -x-implements: - - com.hivemq.api.errors.OpenApiValidationError allOf: - $ref: "../validation/ValidationError.yaml" - type: object diff --git a/ext/openAPI/components/schemas/errors/datahub/GeneralPolicyValidationError.yaml b/ext/openAPI/components/schemas/errors/datahub/GeneralPolicyValidationError.yaml index c3e175b50d..45e26077dc 100644 --- a/ext/openAPI/components/schemas/errors/datahub/GeneralPolicyValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/GeneralPolicyValidationError.yaml @@ -1,5 +1,3 @@ -x-implements: - - com.hivemq.api.errors.OpenApiValidationError allOf: - $ref: "../validation/ValidationError.yaml" - type: object diff --git a/ext/openAPI/components/schemas/errors/datahub/IllegalFunctionValidationError.yaml b/ext/openAPI/components/schemas/errors/datahub/IllegalFunctionValidationError.yaml index e7f66e472b..8ba52834c6 100644 --- a/ext/openAPI/components/schemas/errors/datahub/IllegalFunctionValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/IllegalFunctionValidationError.yaml @@ -1,5 +1,3 @@ -x-implements: - - com.hivemq.api.errors.OpenApiValidationError allOf: - $ref: "../validation/ValidationError.yaml" - type: object diff --git a/ext/openAPI/components/schemas/errors/datahub/IllegalTransitionValidationError.yaml b/ext/openAPI/components/schemas/errors/datahub/IllegalTransitionValidationError.yaml index 5b94e1f20b..9b88732a29 100644 --- a/ext/openAPI/components/schemas/errors/datahub/IllegalTransitionValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/IllegalTransitionValidationError.yaml @@ -1,5 +1,3 @@ -x-implements: - - com.hivemq.api.errors.OpenApiValidationError allOf: - $ref: "../validation/ValidationError.yaml" - type: object diff --git a/ext/openAPI/components/schemas/errors/datahub/InvalidFunctionOrderValidationError.yaml b/ext/openAPI/components/schemas/errors/datahub/InvalidFunctionOrderValidationError.yaml index 49011d1ead..ea5adab888 100644 --- a/ext/openAPI/components/schemas/errors/datahub/InvalidFunctionOrderValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/InvalidFunctionOrderValidationError.yaml @@ -1,5 +1,3 @@ -x-implements: - - com.hivemq.api.errors.OpenApiValidationError allOf: - $ref: "../validation/ValidationError.yaml" - type: object diff --git a/ext/openAPI/components/schemas/errors/datahub/UnknownVariableValidationError.yaml b/ext/openAPI/components/schemas/errors/datahub/UnknownVariableValidationError.yaml index e07aa564c3..2718f109be 100644 --- a/ext/openAPI/components/schemas/errors/datahub/UnknownVariableValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/UnknownVariableValidationError.yaml @@ -1,5 +1,3 @@ -x-implements: - - com.hivemq.api.errors.OpenApiValidationError allOf: - $ref: "../validation/ValidationError.yaml" - type: object diff --git a/ext/openAPI/components/schemas/errors/validation/AtLeastOneFieldMissingValidationError.yaml b/ext/openAPI/components/schemas/errors/validation/AtLeastOneFieldMissingValidationError.yaml index 3daa52f830..b6b61d395a 100644 --- a/ext/openAPI/components/schemas/errors/validation/AtLeastOneFieldMissingValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/validation/AtLeastOneFieldMissingValidationError.yaml @@ -1,5 +1,3 @@ -x-implements: - - com.hivemq.api.errors.OpenApiValidationError allOf: - $ref: "./ValidationError.yaml" - type: object diff --git a/ext/openAPI/components/schemas/errors/validation/EmptyFieldValidationError.yaml b/ext/openAPI/components/schemas/errors/validation/EmptyFieldValidationError.yaml index bc8b7c7a4c..d37e184cd3 100644 --- a/ext/openAPI/components/schemas/errors/validation/EmptyFieldValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/validation/EmptyFieldValidationError.yaml @@ -1,5 +1,3 @@ -x-implements: - - com.hivemq.api.errors.OpenApiValidationError allOf: - $ref: "./ValidationError.yaml" - type: object diff --git a/ext/openAPI/components/schemas/errors/validation/InvalidFieldLengthValidationError.yaml b/ext/openAPI/components/schemas/errors/validation/InvalidFieldLengthValidationError.yaml index 6137ed45ff..1ea6096d7e 100644 --- a/ext/openAPI/components/schemas/errors/validation/InvalidFieldLengthValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/validation/InvalidFieldLengthValidationError.yaml @@ -1,5 +1,3 @@ -x-implements: - - com.hivemq.api.errors.OpenApiValidationError allOf: - $ref: "./ValidationError.yaml" - type: object diff --git a/ext/openAPI/components/schemas/errors/validation/InvalidFieldValueValidationError.yaml b/ext/openAPI/components/schemas/errors/validation/InvalidFieldValueValidationError.yaml index 6be8643a82..f9dd044216 100644 --- a/ext/openAPI/components/schemas/errors/validation/InvalidFieldValueValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/validation/InvalidFieldValueValidationError.yaml @@ -1,5 +1,3 @@ -x-implements: - - com.hivemq.api.errors.OpenApiValidationError allOf: - $ref: "./ValidationError.yaml" - type: object diff --git a/ext/openAPI/components/schemas/errors/validation/InvalidIdentifierValidationError.yaml b/ext/openAPI/components/schemas/errors/validation/InvalidIdentifierValidationError.yaml index 3e2ba46bf5..621fdbd3eb 100644 --- a/ext/openAPI/components/schemas/errors/validation/InvalidIdentifierValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/validation/InvalidIdentifierValidationError.yaml @@ -1,5 +1,3 @@ -x-implements: - - com.hivemq.api.errors.OpenApiValidationError allOf: - $ref: "./ValidationError.yaml" - type: object diff --git a/ext/openAPI/components/schemas/errors/validation/MissingFieldValidationError.yaml b/ext/openAPI/components/schemas/errors/validation/MissingFieldValidationError.yaml index bc8b7c7a4c..d37e184cd3 100644 --- a/ext/openAPI/components/schemas/errors/validation/MissingFieldValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/validation/MissingFieldValidationError.yaml @@ -1,5 +1,3 @@ -x-implements: - - com.hivemq.api.errors.OpenApiValidationError allOf: - $ref: "./ValidationError.yaml" - type: object diff --git a/ext/openAPI/components/schemas/errors/validation/UnsupportedFieldValidationError.yaml b/ext/openAPI/components/schemas/errors/validation/UnsupportedFieldValidationError.yaml index b480122de4..18d411dbd4 100644 --- a/ext/openAPI/components/schemas/errors/validation/UnsupportedFieldValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/validation/UnsupportedFieldValidationError.yaml @@ -1,5 +1,3 @@ -x-implements: - - com.hivemq.api.errors.OpenApiValidationError allOf: - $ref: "./ValidationError.yaml" - type: object diff --git a/ext/openAPI/components/schemas/errors/validation/ValidationError.yaml b/ext/openAPI/components/schemas/errors/validation/ValidationError.yaml index b0892a0d4b..e730b37389 100644 --- a/ext/openAPI/components/schemas/errors/validation/ValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/validation/ValidationError.yaml @@ -1,5 +1,3 @@ -x-implements: - - com.hivemq.api.errors.OpenApiValidationError type: object properties: detail: diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/OpenApiValidationError.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/OpenApiValidationError.java deleted file mode 100644 index 23c0e729c2..0000000000 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/OpenApiValidationError.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2019-present HiveMQ GmbH - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.hivemq.api.errors; - -import org.jetbrains.annotations.NotNull; - -import java.net.URI; - -public interface OpenApiValidationError { - @NotNull String getDetail(); - - void setDetail(@NotNull String detail); - - @NotNull URI getType(); - - void setType(@NotNull URI type); -} From 5b2c061f1bf2b3316a3ef2efc97d8ca29eae8bff Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Wed, 4 Jun 2025 12:00:23 +0200 Subject: [PATCH 038/121] refactor: Remove x-implements: - com.hivemq.api.errors.OpenApiError --- ext/hivemq-edge-openapi-2025.9.yaml | 1359 ++++++++--------- .../components/schemas/errors/ApiError.yaml | 45 + .../BehaviorPolicyAlreadyPresentError.yaml | 4 +- .../BehaviorPolicyCreationFailureError.yaml | 4 +- .../datahub/BehaviorPolicyInvalidErrors.yaml | 2 - .../datahub/BehaviorPolicyNotFoundError.yaml | 4 +- .../datahub/BehaviorPolicyRejectedError.yaml | 4 +- .../BehaviorPolicyUpdateFailureError.yaml | 4 +- .../datahub/ClientDisconnectedError.yaml | 4 +- .../errors/datahub/ClientNotFoundError.yaml | 4 +- .../DataPolicyAlreadyPresentError.yaml | 4 +- .../DataPolicyCreationFailureError.yaml | 4 +- .../datahub/DataPolicyInvalidErrors.yaml | 2 - .../datahub/DataPolicyNotFoundError.yaml | 4 +- .../datahub/DataPolicyRejectedError.yaml | 4 +- .../datahub/DataPolicyUpdateFailureError.yaml | 4 +- .../errors/datahub/PolicyIdMismatchError.yaml | 4 +- .../errors/datahub/PolicyNotFoundError.yaml | 4 +- .../datahub/SchemaAlreadyPresentError.yaml | 4 +- .../datahub/SchemaEtagMismatchError.yaml | 4 +- .../errors/datahub/SchemaInvalidErrors.yaml | 2 - .../errors/datahub/SchemaNotFoundError.yaml | 4 +- .../datahub/SchemaParsingFailureError.yaml | 4 +- .../errors/datahub/SchemaReferencedError.yaml | 4 +- .../datahub/ScriptAlreadyPresentError.yaml | 4 +- .../datahub/ScriptCreationFailureError.yaml | 4 +- .../datahub/ScriptEtagMismatchError.yaml | 4 +- .../errors/datahub/ScriptInvalidErrors.yaml | 2 - .../errors/datahub/ScriptNotFoundError.yaml | 4 +- .../datahub/ScriptParsingFailureError.yaml | 4 +- .../errors/datahub/ScriptReferencedError.yaml | 4 +- .../datahub/ScriptSanitationFailureError.yaml | 4 +- .../datahub/TopicFilterMismatchError.yaml | 4 +- .../errors/http/InsufficientStorageError.yaml | 4 +- .../errors/http/InternalServerError.yaml | 4 +- .../http/InvalidQueryParameterError.yaml | 4 +- .../errors/http/PreconditionFailedError.yaml | 4 +- .../errors/http/RequestBodyMissingError.yaml | 4 +- .../RequestBodyParameterMissingError.yaml | 4 +- .../http/TemporaryNotAvailableError.yaml | 4 +- .../errors/http/UrlParameterMissingError.yaml | 4 +- .../errors/validation/ValidationError.yaml | 28 +- .../errors/validation/ValidationErrors.yaml | 17 +- .../com/hivemq/api/errors/OpenApiError.java | 44 - .../com/hivemq/util/ErrorResponseUtil.java | 4 +- 45 files changed, 771 insertions(+), 874 deletions(-) create mode 100644 ext/openAPI/components/schemas/errors/ApiError.yaml delete mode 100644 hivemq-edge/src/main/java/com/hivemq/api/errors/OpenApiError.java diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index 665477e121..34dc47c41e 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -4769,11 +4769,490 @@ components: description: List of result items that are returned by this endpoint items: $ref: '#/components/schemas/BehaviorPolicy' + ApiError: + allOf: + - $ref: '#/components/schemas/ProblemDetails' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/BehaviorPolicyAlreadyPresentError: '#/components/schemas/BehaviorPolicyAlreadyPresentError' + https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError: '#/components/schemas/BehaviorPolicyCreationFailureError' + https://hivemq.com/edge/api/model/BehaviorPolicyNotFoundError: '#/components/schemas/BehaviorPolicyNotFoundError' + https://hivemq.com/edge/api/model/BehaviorPolicyRejectedError: '#/components/schemas/BehaviorPolicyRejectedError' + https://hivemq.com/edge/api/model/BehaviorPolicyUpdateFailureError: '#/components/schemas/BehaviorPolicyUpdateFailureError' + https://hivemq.com/edge/api/model/ClientDisconnectedError: '#/components/schemas/ClientDisconnectedError' + https://hivemq.com/edge/api/model/ClientNotFoundError: '#/components/schemas/ClientNotFoundError' + https://hivemq.com/edge/api/model/DataPolicyAlreadyPresentError: '#/components/schemas/DataPolicyAlreadyPresentError' + https://hivemq.com/edge/api/model/DataPolicyCreationFailureError: '#/components/schemas/DataPolicyCreationFailureError' + https://hivemq.com/edge/api/model/DataPolicyNotFoundError: '#/components/schemas/DataPolicyNotFoundError' + https://hivemq.com/edge/api/model/DataPolicyRejectedError: '#/components/schemas/DataPolicyRejectedError' + https://hivemq.com/edge/api/model/DataPolicyUpdateFailureError: '#/components/schemas/DataPolicyUpdateFailureError' + https://hivemq.com/edge/api/model/PolicyIdMismatchError: '#/components/schemas/PolicyIdMismatchError' + https://hivemq.com/edge/api/model/PolicyNotFoundError: '#/components/schemas/PolicyNotFoundError' + https://hivemq.com/edge/api/model/SchemaAlreadyPresentError: '#/components/schemas/SchemaAlreadyPresentError' + https://hivemq.com/edge/api/model/SchemaEtagMismatchError: '#/components/schemas/SchemaEtagMismatchError' + https://hivemq.com/edge/api/model/SchemaNotFoundError: '#/components/schemas/SchemaNotFoundError' + https://hivemq.com/edge/api/model/SchemaParsingFailureError: '#/components/schemas/SchemaParsingFailureError' + https://hivemq.com/edge/api/model/SchemaReferencedError: '#/components/schemas/SchemaReferencedError' + https://hivemq.com/edge/api/model/ScriptAlreadyPresentError: '#/components/schemas/ScriptAlreadyPresentError' + https://hivemq.com/edge/api/model/ScriptCreationFailureError: '#/components/schemas/ScriptCreationFailureError' + https://hivemq.com/edge/api/model/ScriptEtagMismatchError: '#/components/schemas/ScriptEtagMismatchError' + https://hivemq.com/edge/api/model/ScriptNotFoundError: '#/components/schemas/ScriptNotFoundError' + https://hivemq.com/edge/api/model/ScriptParsingFailureError: '#/components/schemas/ScriptParsingFailureError' + https://hivemq.com/edge/api/model/ScriptReferencedError: '#/components/schemas/ScriptReferencedError' + https://hivemq.com/edge/api/model/ScriptSanitationFailureError: '#/components/schemas/ScriptSanitationFailureError' + https://hivemq.com/edge/api/model/TopicFilterMismatchError: '#/components/schemas/TopicFilterMismatchError' + https://hivemq.com/edge/api/model/InsufficientStorageError: '#/components/schemas/InsufficientStorageError' + https://hivemq.com/edge/api/model/InternalServerError: '#/components/schemas/InternalServerError' + https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' + https://hivemq.com/edge/api/model/PreconditionFailedError: '#/components/schemas/PreconditionFailedError' + https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' + https://hivemq.com/edge/api/model/RequestBodyParameterMissingError: '#/components/schemas/RequestBodyParameterMissingError' + https://hivemq.com/edge/api/model/TemporaryNotAvailableError: '#/components/schemas/TemporaryNotAvailableError' + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + https://hivemq.com/edge/api/model/ValidationErrors: '#/components/schemas/ValidationErrors' + BehaviorPolicyAlreadyPresentError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The behavior policy id. + message: + type: string + description: The error message. + status: + type: integer + default: 409 + description: The HTTP status code. + required: + - id + BehaviorPolicyCreationFailureError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + reason: + type: string + description: The actual reason. + status: + type: integer + default: 400 + description: The HTTP status code. + required: + - reason + BehaviorPolicyNotFoundError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The data policy id. + message: + type: string + description: The error message. + status: + type: integer + default: 404 + description: The HTTP status code. + required: + - id + BehaviorPolicyRejectedError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + status: + type: integer + default: 400 + description: The HTTP status code. + BehaviorPolicyUpdateFailureError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The ID of the policy that failed to update. + reason: + type: string + description: The actual reason. + status: + type: integer + default: 400 + description: The HTTP status code. + required: + - id + ClientDisconnectedError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The client id. + status: + type: integer + default: 404 + description: The HTTP status code. + required: + - id + ClientNotFoundError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The client id. + status: + type: integer + default: 404 + description: The HTTP status code. + required: + - id + DataPolicyAlreadyPresentError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The data policy id. + message: + type: string + description: The error message. + status: + type: integer + default: 409 + description: The Request Conflict HTTP Status Code. + required: + - id + DataPolicyCreationFailureError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + reason: + type: string + description: The actual reason. + status: + type: integer + default: 400 + description: The HTTP status code. + required: + - reason + DataPolicyNotFoundError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The data policy id. + message: + type: string + description: The error message. + status: + type: integer + default: 404 + description: The HTTP status code. + required: + - id + DataPolicyRejectedError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + status: + type: integer + default: 400 + description: The HTTP status code. + DataPolicyUpdateFailureError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The ID of the policy that failed to update. + reason: + type: string + description: The actual reason. + status: + type: integer + default: 400 + description: The HTTP status code. + required: + - id + PolicyIdMismatchError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + actualId: + type: string + description: The actual id. + expectedId: + type: string + description: The expected id. + status: + type: integer + default: 400 + description: The HTTP status code. + required: + - actualId + - expectedId + PolicyNotFoundError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The policy id. + status: + type: integer + default: 404 + description: The HTTP status code. + required: + - id + SchemaAlreadyPresentError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The schema id. + status: + type: integer + default: 409 + description: The Request Conflict HTTP Status Code. + required: + - id + SchemaEtagMismatchError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The schema id. + eTag: + type: string + description: The eTag. + status: + type: integer + default: 412 + description: The Precondition Failed HTTP Status Code. + required: + - id + SchemaNotFoundError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The schema ID. + message: + type: string + description: The error message. + status: + type: integer + default: 404 + description: The HTTP status code. + required: + - id + SchemaParsingFailureError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + alias: + type: string + description: The schema alias. + message: + type: string + description: The error message. + status: + type: integer + default: 400 + description: The HTTP status code. + required: + - alias + - message + SchemaReferencedError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The schema ID. + message: + type: string + description: The error message. + status: + type: integer + default: 400 + description: The HTTP status code. + required: + - id + ScriptAlreadyPresentError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The script id. + status: + type: integer + default: 409 + description: The Request Conflict HTTP Status Code. + required: + - id + ScriptCreationFailureError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + reason: + type: string + description: The actual reason. + status: + type: integer + default: 400 + description: The HTTP status code. + required: + - reason + ScriptEtagMismatchError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The script id. + eTag: + type: string + description: The eTag. + status: + type: integer + default: 412 + description: The Precondition Failed HTTP Status Code. + required: + - id + ScriptNotFoundError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The script ID. + message: + type: string + description: The error message. + status: + type: integer + default: 404 + description: The HTTP status code. + required: + - id + ScriptParsingFailureError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + reason: + type: string + description: The actual reason. + status: + type: integer + default: 400 + description: The HTTP status code. + required: + - reason + ScriptReferencedError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The script ID. + message: + type: string + description: The error message. + status: + type: integer + default: 400 + description: The HTTP status code. + required: + - id + ScriptSanitationFailureError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + reason: + type: string + description: The actual reason. + status: + type: integer + default: 400 + description: The HTTP status code. + required: + - reason + TopicFilterMismatchError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + message: + type: string + description: The error message. + parameter: + type: string + description: The parameter. + status: + type: integer + default: 400 + description: The HTTP status code. + required: + - parameter + InsufficientStorageError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + reason: + type: string + description: The actual reason. + status: + type: integer + default: 507 + description: The HTTP status code. + InternalServerError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + reason: + type: string + description: The actual reason. + status: + type: integer + default: 500 + description: The HTTP status code. InvalidQueryParameterError: - x-implements: - - com.hivemq.api.errors.OpenApiError allOf: - - $ref: '#/components/schemas/ProblemDetails' + - $ref: '#/components/schemas/ApiError' - type: object properties: parameter: @@ -4789,44 +5268,117 @@ components: required: - parameter - reason - TemporaryNotAvailableError: - x-implements: - - com.hivemq.api.errors.OpenApiError + PreconditionFailedError: allOf: - - $ref: '#/components/schemas/ProblemDetails' + - $ref: '#/components/schemas/ApiError' - type: object properties: + reason: + type: string + description: The actual reason. status: type: integer - default: 503 + default: 412 description: The HTTP status code. + required: + - reason RequestBodyMissingError: - x-implements: - - com.hivemq.api.errors.OpenApiError allOf: - - $ref: '#/components/schemas/ProblemDetails' + - $ref: '#/components/schemas/ApiError' - type: object properties: status: type: integer default: 400 description: The HTTP status code. - BehaviorPolicyCreationFailureError: - x-implements: - - com.hivemq.api.errors.OpenApiError + RequestBodyParameterMissingError: allOf: - - $ref: '#/components/schemas/ProblemDetails' + - $ref: '#/components/schemas/ApiError' - type: object properties: - reason: + parameter: type: string - description: The actual reason. + description: The the missing request body parameter. + status: + type: integer + default: 400 + description: The HTTP status code. + TemporaryNotAvailableError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + status: + type: integer + default: 503 + description: The HTTP status code. + UrlParameterMissingError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + parameter: + type: string + description: The name of the missing parameter. status: type: integer default: 400 description: The HTTP status code. required: - - reason + - parameter + ValidationErrors: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + childErrors: + type: array + description: List of child validation errors. + items: + $ref: '#/components/schemas/ValidationError' + status: + type: integer + default: 400 + description: The HTTP status code. + required: + - childErrors + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors: '#/components/schemas/BehaviorPolicyInvalidErrors' + https://hivemq.com/edge/api/model/DataPolicyInvalidErrors: '#/components/schemas/DataPolicyInvalidErrors' + https://hivemq.com/edge/api/model/SchemaInvalidErrors: '#/components/schemas/SchemaInvalidErrors' + https://hivemq.com/edge/api/model/ScriptInvalidErrors: '#/components/schemas/ScriptInvalidErrors' + BehaviorPolicyInvalidErrors: + allOf: + - $ref: '#/components/schemas/ValidationErrors' + DataPolicyInvalidErrors: + allOf: + - $ref: '#/components/schemas/ValidationErrors' + - type: object + properties: + status: + type: integer + default: 400 + description: The HTTP status code. + SchemaInvalidErrors: + allOf: + - $ref: '#/components/schemas/ValidationErrors' + - type: object + properties: + status: + type: integer + default: 400 + description: The HTTP status code. + ScriptInvalidErrors: + allOf: + - $ref: '#/components/schemas/ValidationErrors' + - type: object + properties: + status: + type: integer + default: 400 + description: The HTTP status code. ValidationError: type: object properties: @@ -4843,20 +5395,20 @@ components: discriminator: propertyName: type mapping: - AtLeastOneFieldMissingValidationError: '#/components/schemas/AtLeastOneFieldMissingValidationError' - AtMostOneFunctionValidationError: '#/components/schemas/AtMostOneFunctionValidationError' - EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' - FunctionMustBePairedValidationError: '#/components/schemas/FunctionMustBePairedValidationError' - GeneralPolicyValidationError: '#/components/schemas/GeneralPolicyValidationError' - IllegalFunctionValidationError: '#/components/schemas/IllegalFunctionValidationError' - IllegalTransitionValidationError: '#/components/schemas/IllegalTransitionValidationError' - InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' - InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' - InvalidFunctionOrderValidationError: '#/components/schemas/InvalidFunctionOrderValidationError' - InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' - MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' - UnknownVariableValidationError: '#/components/schemas/UnknownVariableValidationError' - UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' + https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError: '#/components/schemas/AtLeastOneFieldMissingValidationError' + https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError: '#/components/schemas/AtMostOneFunctionValidationError' + https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' + https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError: '#/components/schemas/FunctionMustBePairedValidationError' + https://hivemq.com/edge/api/model/GeneralPolicyValidationError: '#/components/schemas/GeneralPolicyValidationError' + https://hivemq.com/edge/api/model/IllegalFunctionValidationError: '#/components/schemas/IllegalFunctionValidationError' + https://hivemq.com/edge/api/model/IllegalTransitionValidationError: '#/components/schemas/IllegalTransitionValidationError' + https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' + https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' + https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError: '#/components/schemas/InvalidFunctionOrderValidationError' + https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' + https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' + https://hivemq.com/edge/api/model/UnknownVariableValidationError: '#/components/schemas/UnknownVariableValidationError' + https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' AtLeastOneFieldMissingValidationError: allOf: - $ref: '#/components/schemas/ValidationError' @@ -5025,259 +5577,72 @@ components: description: The field. function: type: string - description: The function. - previousFunction: - type: string - description: The previous function. - required: - - field - - function - - previousFunction - InvalidIdentifierValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - field: - type: string - description: The invalid identifier field. - value: - type: string - description: The invalid identifier value. - required: - - field - - value - MissingFieldValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - field: - type: string - description: The missing field. - required: - - field - UnknownVariableValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - field: - type: string - description: The field. - variables: - type: array - items: - type: string - description: The unknown variables. - required: - - field - - variables - UnsupportedFieldValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - actualValue: - type: string - description: The actual value. - expectedValue: - type: string - description: The expected value. - field: - type: string - description: The field. - required: - - actualValue - - expectedValue - - field - ValidationErrors: - x-implements: - - com.hivemq.api.errors.OpenApiError - allOf: - - $ref: '#/components/schemas/ProblemDetails' - - type: object - properties: - errors: - type: array - description: List of validation errors. - items: - $ref: '#/components/schemas/ValidationError' - status: - type: integer - default: 400 - description: The HTTP status code. - required: - - errors - BehaviorPolicyInvalidErrors: - x-implements: - - com.hivemq.api.errors.OpenApiError - allOf: - - $ref: '#/components/schemas/ValidationErrors' - BehaviorPolicyRejectedError: - x-implements: - - com.hivemq.api.errors.OpenApiError - allOf: - - $ref: '#/components/schemas/ProblemDetails' - - type: object - properties: - status: - type: integer - default: 400 - description: The HTTP status code. - BehaviorPolicyAlreadyPresentError: - x-implements: - - com.hivemq.api.errors.OpenApiError - allOf: - - $ref: '#/components/schemas/ProblemDetails' - - type: object - properties: - id: - type: string - description: The behavior policy id. - message: - type: string - description: The error message. - status: - type: integer - default: 409 - description: The HTTP status code. - required: - - id - InternalServerError: - x-implements: - - com.hivemq.api.errors.OpenApiError - allOf: - - $ref: '#/components/schemas/ProblemDetails' - - type: object - properties: - reason: - type: string - description: The actual reason. - status: - type: integer - default: 500 - description: The HTTP status code. - InsufficientStorageError: - x-implements: - - com.hivemq.api.errors.OpenApiError - allOf: - - $ref: '#/components/schemas/ProblemDetails' - - type: object - properties: - reason: - type: string - description: The actual reason. - status: - type: integer - default: 507 - description: The HTTP status code. - UrlParameterMissingError: - x-implements: - - com.hivemq.api.errors.OpenApiError - allOf: - - $ref: '#/components/schemas/ProblemDetails' - - type: object - properties: - parameter: - type: string - description: The name of the missing parameter. - status: - type: integer - default: 400 - description: The HTTP status code. - required: - - parameter - BehaviorPolicyNotFoundError: - x-implements: - - com.hivemq.api.errors.OpenApiError - allOf: - - $ref: '#/components/schemas/ProblemDetails' - - type: object - properties: - id: - type: string - description: The data policy id. - message: - type: string - description: The error message. - status: - type: integer - default: 404 - description: The HTTP status code. + description: The function. + previousFunction: + type: string + description: The previous function. required: - - id - BehaviorPolicyUpdateFailureError: - x-implements: - - com.hivemq.api.errors.OpenApiError + - field + - function + - previousFunction + InvalidIdentifierValidationError: allOf: - - $ref: '#/components/schemas/ProblemDetails' + - $ref: '#/components/schemas/ValidationError' - type: object properties: - id: + field: type: string - description: The ID of the policy that failed to update. - reason: + description: The invalid identifier field. + value: type: string - description: The actual reason. - status: - type: integer - default: 400 - description: The HTTP status code. + description: The invalid identifier value. required: - - id - PolicyIdMismatchError: - x-implements: - - com.hivemq.api.errors.OpenApiError + - field + - value + MissingFieldValidationError: allOf: - - $ref: '#/components/schemas/ProblemDetails' + - $ref: '#/components/schemas/ValidationError' - type: object properties: - actualId: - type: string - description: The actual id. - expectedId: + field: type: string - description: The expected id. - status: - type: integer - default: 400 - description: The HTTP status code. + description: The missing field. required: - - actualId - - expectedId - PreconditionFailedError: - x-implements: - - com.hivemq.api.errors.OpenApiError + - field + UnknownVariableValidationError: allOf: - - $ref: '#/components/schemas/ProblemDetails' + - $ref: '#/components/schemas/ValidationError' - type: object properties: - reason: + field: type: string - description: The actual reason. - status: - type: integer - default: 412 - description: The HTTP status code. + description: The field. + variables: + type: array + items: + type: string + description: The unknown variables. required: - - reason - PolicyNotFoundError: - x-implements: - - com.hivemq.api.errors.OpenApiError + - field + - variables + UnsupportedFieldValidationError: allOf: - - $ref: '#/components/schemas/ProblemDetails' + - $ref: '#/components/schemas/ValidationError' - type: object properties: - id: + actualValue: type: string - description: The policy id. - status: - type: integer - default: 404 - description: The HTTP status code. + description: The actual value. + expectedValue: + type: string + description: The expected value. + field: + type: string + description: The field. required: - - id + - actualValue + - expectedValue + - field JsonNode: type: object description: The arguments of the fsm derived from the behavior policy. @@ -5318,38 +5683,6 @@ components: $ref: '#/components/schemas/FsmStateInformationItem' required: - items - ClientDisconnectedError: - x-implements: - - com.hivemq.api.errors.OpenApiError - allOf: - - $ref: '#/components/schemas/ProblemDetails' - - type: object - properties: - id: - type: string - description: The client id. - status: - type: integer - default: 404 - description: The HTTP status code. - required: - - id - ClientNotFoundError: - x-implements: - - com.hivemq.api.errors.OpenApiError - allOf: - - $ref: '#/components/schemas/ProblemDetails' - - type: object - properties: - id: - type: string - description: The client id. - status: - type: integer - default: 404 - description: The HTTP status code. - required: - - id DataPolicyMatching: type: object description: The matching rules the policy applies. @@ -5395,156 +5728,42 @@ components: DataPolicy: type: object description: A data policy which is used to validate and execute certain actions based on the validation result. - properties: - createdAt: - type: string - format: date-time - description: The formatted UTC timestamp indicating when the policy was created. - readOnly: true - id: - type: string - description: The unique identifier of the policy. - lastUpdatedAt: - type: string - format: date-time - description: The formatted UTC timestamp indicating when the policy was updated the last time. - readOnly: true - matching: - $ref: '#/components/schemas/DataPolicyMatching' - onFailure: - $ref: '#/components/schemas/DataPolicyAction' - onSuccess: - $ref: '#/components/schemas/DataPolicyAction' - validation: - $ref: '#/components/schemas/DataPolicyValidation' - required: - - id - - matching - DataPolicyList: - type: object - description: A listing of data policies. - properties: - _links: - $ref: '#/components/schemas/PaginationCursor' - items: - type: array - description: List of result items that are returned by this endpoint - items: - $ref: '#/components/schemas/DataPolicy' - DataPolicyCreationFailureError: - x-implements: - - com.hivemq.api.errors.OpenApiError - allOf: - - $ref: '#/components/schemas/ProblemDetails' - - type: object - properties: - reason: - type: string - description: The actual reason. - status: - type: integer - default: 400 - description: The HTTP status code. - required: - - reason - DataPolicyInvalidErrors: - x-implements: - - com.hivemq.api.errors.OpenApiError - allOf: - - $ref: '#/components/schemas/ValidationErrors' - - type: object - properties: - status: - type: integer - default: 400 - description: The HTTP status code. - DataPolicyRejectedError: - x-implements: - - com.hivemq.api.errors.OpenApiError - allOf: - - $ref: '#/components/schemas/ProblemDetails' - - type: object - properties: - status: - type: integer - default: 400 - description: The HTTP status code. - DataPolicyAlreadyPresentError: - x-implements: - - com.hivemq.api.errors.OpenApiError - allOf: - - $ref: '#/components/schemas/ProblemDetails' - - type: object - properties: - id: - type: string - description: The data policy id. - message: - type: string - description: The error message. - status: - type: integer - default: 409 - description: The Request Conflict HTTP Status Code. - required: - - id - DataPolicyUpdateFailureError: - x-implements: - - com.hivemq.api.errors.OpenApiError - allOf: - - $ref: '#/components/schemas/ProblemDetails' - - type: object - properties: - id: - type: string - description: The ID of the policy that failed to update. - reason: - type: string - description: The actual reason. - status: - type: integer - default: 400 - description: The HTTP status code. - required: - - id - TopicFilterMismatchError: - x-implements: - - com.hivemq.api.errors.OpenApiError - allOf: - - $ref: '#/components/schemas/ProblemDetails' - - type: object - properties: - message: - type: string - description: The error message. - parameter: - type: string - description: The parameter. - status: - type: integer - default: 400 - description: The HTTP status code. - required: - - parameter - DataPolicyNotFoundError: - x-implements: - - com.hivemq.api.errors.OpenApiError - allOf: - - $ref: '#/components/schemas/ProblemDetails' - - type: object - properties: - id: - type: string - description: The data policy id. - message: - type: string - description: The error message. - status: - type: integer - default: 404 - description: The HTTP status code. - required: - - id + properties: + createdAt: + type: string + format: date-time + description: The formatted UTC timestamp indicating when the policy was created. + readOnly: true + id: + type: string + description: The unique identifier of the policy. + lastUpdatedAt: + type: string + format: date-time + description: The formatted UTC timestamp indicating when the policy was updated the last time. + readOnly: true + matching: + $ref: '#/components/schemas/DataPolicyMatching' + onFailure: + $ref: '#/components/schemas/DataPolicyAction' + onSuccess: + $ref: '#/components/schemas/DataPolicyAction' + validation: + $ref: '#/components/schemas/DataPolicyValidation' + required: + - id + - matching + DataPolicyList: + type: object + description: A listing of data policies. + properties: + _links: + $ref: '#/components/schemas/PaginationCursor' + items: + type: array + description: List of result items that are returned by this endpoint + items: + $ref: '#/components/schemas/DataPolicy' BehaviorPolicyTransitionEvent: type: string description: Accepted event in transition @@ -5648,124 +5867,6 @@ components: description: List of result items that are returned by this endpoint items: $ref: '#/components/schemas/PolicySchema' - RequestBodyParameterMissingError: - x-implements: - - com.hivemq.api.errors.OpenApiError - allOf: - - $ref: '#/components/schemas/ProblemDetails' - - type: object - properties: - parameter: - type: string - description: The the missing request body parameter. - status: - type: integer - default: 400 - description: The HTTP status code. - SchemaInvalidErrors: - x-implements: - - com.hivemq.api.errors.OpenApiError - allOf: - - $ref: '#/components/schemas/ValidationErrors' - - type: object - properties: - status: - type: integer - default: 400 - description: The HTTP status code. - SchemaParsingFailureError: - x-implements: - - com.hivemq.api.errors.OpenApiError - allOf: - - $ref: '#/components/schemas/ProblemDetails' - - type: object - properties: - alias: - type: string - description: The schema alias. - message: - type: string - description: The error message. - status: - type: integer - default: 400 - description: The HTTP status code. - required: - - alias - - message - SchemaAlreadyPresentError: - x-implements: - - com.hivemq.api.errors.OpenApiError - allOf: - - $ref: '#/components/schemas/ProblemDetails' - - type: object - properties: - id: - type: string - description: The schema id. - status: - type: integer - default: 409 - description: The Request Conflict HTTP Status Code. - required: - - id - SchemaEtagMismatchError: - x-implements: - - com.hivemq.api.errors.OpenApiError - allOf: - - $ref: '#/components/schemas/ProblemDetails' - - type: object - properties: - id: - type: string - description: The schema id. - eTag: - type: string - description: The eTag. - status: - type: integer - default: 412 - description: The Precondition Failed HTTP Status Code. - required: - - id - SchemaNotFoundError: - x-implements: - - com.hivemq.api.errors.OpenApiError - allOf: - - $ref: '#/components/schemas/ProblemDetails' - - type: object - properties: - id: - type: string - description: The schema ID. - message: - type: string - description: The error message. - status: - type: integer - default: 404 - description: The HTTP status code. - required: - - id - SchemaReferencedError: - x-implements: - - com.hivemq.api.errors.OpenApiError - allOf: - - $ref: '#/components/schemas/ProblemDetails' - - type: object - properties: - id: - type: string - description: The schema ID. - message: - type: string - description: The error message. - status: - type: integer - default: 400 - description: The HTTP status code. - required: - - id Script: type: object properties: @@ -5807,138 +5908,6 @@ components: description: List of result items that are returned by this endpoint items: $ref: '#/components/schemas/Script' - ScriptCreationFailureError: - x-implements: - - com.hivemq.api.errors.OpenApiError - allOf: - - $ref: '#/components/schemas/ProblemDetails' - - type: object - properties: - reason: - type: string - description: The actual reason. - status: - type: integer - default: 400 - description: The HTTP status code. - required: - - reason - ScriptInvalidErrors: - x-implements: - - com.hivemq.api.errors.OpenApiError - allOf: - - $ref: '#/components/schemas/ValidationErrors' - - type: object - properties: - status: - type: integer - default: 400 - description: The HTTP status code. - ScriptParsingFailureError: - x-implements: - - com.hivemq.api.errors.OpenApiError - allOf: - - $ref: '#/components/schemas/ProblemDetails' - - type: object - properties: - reason: - type: string - description: The actual reason. - status: - type: integer - default: 400 - description: The HTTP status code. - required: - - reason - ScriptSanitationFailureError: - x-implements: - - com.hivemq.api.errors.OpenApiError - allOf: - - $ref: '#/components/schemas/ProblemDetails' - - type: object - properties: - reason: - type: string - description: The actual reason. - status: - type: integer - default: 400 - description: The HTTP status code. - required: - - reason - ScriptAlreadyPresentError: - x-implements: - - com.hivemq.api.errors.OpenApiError - allOf: - - $ref: '#/components/schemas/ProblemDetails' - - type: object - properties: - id: - type: string - description: The script id. - status: - type: integer - default: 409 - description: The Request Conflict HTTP Status Code. - required: - - id - ScriptEtagMismatchError: - x-implements: - - com.hivemq.api.errors.OpenApiError - allOf: - - $ref: '#/components/schemas/ProblemDetails' - - type: object - properties: - id: - type: string - description: The script id. - eTag: - type: string - description: The eTag. - status: - type: integer - default: 412 - description: The Precondition Failed HTTP Status Code. - required: - - id - ScriptNotFoundError: - x-implements: - - com.hivemq.api.errors.OpenApiError - allOf: - - $ref: '#/components/schemas/ProblemDetails' - - type: object - properties: - id: - type: string - description: The script ID. - message: - type: string - description: The error message. - status: - type: integer - default: 404 - description: The HTTP status code. - required: - - id - ScriptReferencedError: - x-implements: - - com.hivemq.api.errors.OpenApiError - allOf: - - $ref: '#/components/schemas/ProblemDetails' - - type: object - properties: - id: - type: string - description: The script ID. - message: - type: string - description: The error message. - status: - type: integer - default: 400 - description: The HTTP status code. - required: - - id Capability: type: object description: List of result items that are returned by this endpoint diff --git a/ext/openAPI/components/schemas/errors/ApiError.yaml b/ext/openAPI/components/schemas/errors/ApiError.yaml new file mode 100644 index 0000000000..c9a0fa36c4 --- /dev/null +++ b/ext/openAPI/components/schemas/errors/ApiError.yaml @@ -0,0 +1,45 @@ +allOf: + - $ref: "../ProblemDetails.yaml" +discriminator: + propertyName: type + mapping: + # DataHub + https://hivemq.com/edge/api/model/BehaviorPolicyAlreadyPresentError: "./datahub/BehaviorPolicyAlreadyPresentError.yaml" + https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError: "./datahub/BehaviorPolicyCreationFailureError.yaml" + https://hivemq.com/edge/api/model/BehaviorPolicyNotFoundError: "./datahub/BehaviorPolicyNotFoundError.yaml" + https://hivemq.com/edge/api/model/BehaviorPolicyRejectedError: "./datahub/BehaviorPolicyRejectedError.yaml" + https://hivemq.com/edge/api/model/BehaviorPolicyUpdateFailureError: "./datahub/BehaviorPolicyUpdateFailureError.yaml" + https://hivemq.com/edge/api/model/ClientDisconnectedError: "./datahub/ClientDisconnectedError.yaml" + https://hivemq.com/edge/api/model/ClientNotFoundError: "./datahub/ClientNotFoundError.yaml" + https://hivemq.com/edge/api/model/DataPolicyAlreadyPresentError: "./datahub/DataPolicyAlreadyPresentError.yaml" + https://hivemq.com/edge/api/model/DataPolicyCreationFailureError: "./datahub/DataPolicyCreationFailureError.yaml" + https://hivemq.com/edge/api/model/DataPolicyNotFoundError: "./datahub/DataPolicyNotFoundError.yaml" + https://hivemq.com/edge/api/model/DataPolicyRejectedError: "./datahub/DataPolicyRejectedError.yaml" + https://hivemq.com/edge/api/model/DataPolicyUpdateFailureError: "./datahub/DataPolicyUpdateFailureError.yaml" + https://hivemq.com/edge/api/model/PolicyIdMismatchError: "./datahub/PolicyIdMismatchError.yaml" + https://hivemq.com/edge/api/model/PolicyNotFoundError: "./datahub/PolicyNotFoundError.yaml" + https://hivemq.com/edge/api/model/SchemaAlreadyPresentError: "./datahub/SchemaAlreadyPresentError.yaml" + https://hivemq.com/edge/api/model/SchemaEtagMismatchError: "./datahub/SchemaEtagMismatchError.yaml" + https://hivemq.com/edge/api/model/SchemaNotFoundError: "./datahub/SchemaNotFoundError.yaml" + https://hivemq.com/edge/api/model/SchemaParsingFailureError: "./datahub/SchemaParsingFailureError.yaml" + https://hivemq.com/edge/api/model/SchemaReferencedError: "./datahub/SchemaReferencedError.yaml" + https://hivemq.com/edge/api/model/ScriptAlreadyPresentError: "./datahub/ScriptAlreadyPresentError.yaml" + https://hivemq.com/edge/api/model/ScriptCreationFailureError: "./datahub/ScriptCreationFailureError.yaml" + https://hivemq.com/edge/api/model/ScriptEtagMismatchError: "./datahub/ScriptEtagMismatchError.yaml" + https://hivemq.com/edge/api/model/ScriptNotFoundError: "./datahub/ScriptNotFoundError.yaml" + https://hivemq.com/edge/api/model/ScriptParsingFailureError: "./datahub/ScriptParsingFailureError.yaml" + https://hivemq.com/edge/api/model/ScriptReferencedError: "./datahub/ScriptReferencedError.yaml" + https://hivemq.com/edge/api/model/ScriptSanitationFailureError: "./datahub/ScriptSanitationFailureError.yaml" + https://hivemq.com/edge/api/model/TopicFilterMismatchError: "./datahub/TopicFilterMismatchError.yaml" + # HTTP + https://hivemq.com/edge/api/model/InsufficientStorageError: "./http/InsufficientStorageError.yaml" + https://hivemq.com/edge/api/model/InternalServerError: "./http/InternalServerError.yaml" + https://hivemq.com/edge/api/model/InvalidQueryParameterError: "./http/InvalidQueryParameterError.yaml" + https://hivemq.com/edge/api/model/PreconditionFailedError: "./http/PreconditionFailedError.yaml" + https://hivemq.com/edge/api/model/RequestBodyMissingError: "./http/RequestBodyMissingError.yaml" + https://hivemq.com/edge/api/model/RequestBodyParameterMissingError: "./http/RequestBodyParameterMissingError.yaml" + https://hivemq.com/edge/api/model/TemporaryNotAvailableError: "./http/TemporaryNotAvailableError.yaml" + https://hivemq.com/edge/api/model/UrlParameterMissingError: "./http/UrlParameterMissingError.yaml" + # Validation + https://hivemq.com/edge/api/model/ValidationErrors: "./validation/ValidationErrors.yaml" + diff --git a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyAlreadyPresentError.yaml b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyAlreadyPresentError.yaml index 18ad008d1b..97208807f7 100644 --- a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyAlreadyPresentError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyAlreadyPresentError.yaml @@ -1,7 +1,5 @@ -x-implements: - - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../../ProblemDetails.yaml" + - $ref: "../ApiError.yaml" - type: object properties: id: diff --git a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyCreationFailureError.yaml b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyCreationFailureError.yaml index 7784cacb04..f057bedf2b 100644 --- a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyCreationFailureError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyCreationFailureError.yaml @@ -1,7 +1,5 @@ -x-implements: - - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../../ProblemDetails.yaml" + - $ref: "../ApiError.yaml" - type: object properties: reason: diff --git a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyInvalidErrors.yaml b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyInvalidErrors.yaml index f737385842..edbf113e14 100644 --- a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyInvalidErrors.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyInvalidErrors.yaml @@ -1,4 +1,2 @@ -x-implements: - - com.hivemq.api.errors.OpenApiError allOf: - $ref: "../validation/ValidationErrors.yaml" diff --git a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyNotFoundError.yaml b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyNotFoundError.yaml index a9b5fc6062..67f2e4602d 100644 --- a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyNotFoundError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyNotFoundError.yaml @@ -1,7 +1,5 @@ -x-implements: - - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../../ProblemDetails.yaml" + - $ref: "../ApiError.yaml" - type: object properties: id: diff --git a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyRejectedError.yaml b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyRejectedError.yaml index 8d7d8b4ed0..f3e4330f07 100644 --- a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyRejectedError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyRejectedError.yaml @@ -1,7 +1,5 @@ -x-implements: - - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../../ProblemDetails.yaml" + - $ref: "../ApiError.yaml" - type: object properties: status: diff --git a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyUpdateFailureError.yaml b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyUpdateFailureError.yaml index a36f8a4cb9..ab9d0e064a 100644 --- a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyUpdateFailureError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyUpdateFailureError.yaml @@ -1,7 +1,5 @@ -x-implements: - - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../../ProblemDetails.yaml" + - $ref: "../ApiError.yaml" - type: object properties: id: diff --git a/ext/openAPI/components/schemas/errors/datahub/ClientDisconnectedError.yaml b/ext/openAPI/components/schemas/errors/datahub/ClientDisconnectedError.yaml index 2afb205bbb..77603b221c 100644 --- a/ext/openAPI/components/schemas/errors/datahub/ClientDisconnectedError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/ClientDisconnectedError.yaml @@ -1,7 +1,5 @@ -x-implements: - - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../../ProblemDetails.yaml" + - $ref: "../ApiError.yaml" - type: object properties: id: diff --git a/ext/openAPI/components/schemas/errors/datahub/ClientNotFoundError.yaml b/ext/openAPI/components/schemas/errors/datahub/ClientNotFoundError.yaml index 2afb205bbb..77603b221c 100644 --- a/ext/openAPI/components/schemas/errors/datahub/ClientNotFoundError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/ClientNotFoundError.yaml @@ -1,7 +1,5 @@ -x-implements: - - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../../ProblemDetails.yaml" + - $ref: "../ApiError.yaml" - type: object properties: id: diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyAlreadyPresentError.yaml b/ext/openAPI/components/schemas/errors/datahub/DataPolicyAlreadyPresentError.yaml index 052f69fbe2..55b3a6ee5c 100644 --- a/ext/openAPI/components/schemas/errors/datahub/DataPolicyAlreadyPresentError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/DataPolicyAlreadyPresentError.yaml @@ -1,7 +1,5 @@ -x-implements: - - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../../ProblemDetails.yaml" + - $ref: "../ApiError.yaml" - type: object properties: id: diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyCreationFailureError.yaml b/ext/openAPI/components/schemas/errors/datahub/DataPolicyCreationFailureError.yaml index 7784cacb04..f057bedf2b 100644 --- a/ext/openAPI/components/schemas/errors/datahub/DataPolicyCreationFailureError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/DataPolicyCreationFailureError.yaml @@ -1,7 +1,5 @@ -x-implements: - - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../../ProblemDetails.yaml" + - $ref: "../ApiError.yaml" - type: object properties: reason: diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyInvalidErrors.yaml b/ext/openAPI/components/schemas/errors/datahub/DataPolicyInvalidErrors.yaml index dd1411d4e4..dc723389e9 100644 --- a/ext/openAPI/components/schemas/errors/datahub/DataPolicyInvalidErrors.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/DataPolicyInvalidErrors.yaml @@ -1,5 +1,3 @@ -x-implements: - - com.hivemq.api.errors.OpenApiError allOf: - $ref: "../validation/ValidationErrors.yaml" - type: object diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyNotFoundError.yaml b/ext/openAPI/components/schemas/errors/datahub/DataPolicyNotFoundError.yaml index a9b5fc6062..67f2e4602d 100644 --- a/ext/openAPI/components/schemas/errors/datahub/DataPolicyNotFoundError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/DataPolicyNotFoundError.yaml @@ -1,7 +1,5 @@ -x-implements: - - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../../ProblemDetails.yaml" + - $ref: "../ApiError.yaml" - type: object properties: id: diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyRejectedError.yaml b/ext/openAPI/components/schemas/errors/datahub/DataPolicyRejectedError.yaml index 8d7d8b4ed0..f3e4330f07 100644 --- a/ext/openAPI/components/schemas/errors/datahub/DataPolicyRejectedError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/DataPolicyRejectedError.yaml @@ -1,7 +1,5 @@ -x-implements: - - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../../ProblemDetails.yaml" + - $ref: "../ApiError.yaml" - type: object properties: status: diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyUpdateFailureError.yaml b/ext/openAPI/components/schemas/errors/datahub/DataPolicyUpdateFailureError.yaml index a36f8a4cb9..ab9d0e064a 100644 --- a/ext/openAPI/components/schemas/errors/datahub/DataPolicyUpdateFailureError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/DataPolicyUpdateFailureError.yaml @@ -1,7 +1,5 @@ -x-implements: - - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../../ProblemDetails.yaml" + - $ref: "../ApiError.yaml" - type: object properties: id: diff --git a/ext/openAPI/components/schemas/errors/datahub/PolicyIdMismatchError.yaml b/ext/openAPI/components/schemas/errors/datahub/PolicyIdMismatchError.yaml index 22f41c1646..d0275f4869 100644 --- a/ext/openAPI/components/schemas/errors/datahub/PolicyIdMismatchError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/PolicyIdMismatchError.yaml @@ -1,7 +1,5 @@ -x-implements: - - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../../ProblemDetails.yaml" + - $ref: "../ApiError.yaml" - type: object properties: actualId: diff --git a/ext/openAPI/components/schemas/errors/datahub/PolicyNotFoundError.yaml b/ext/openAPI/components/schemas/errors/datahub/PolicyNotFoundError.yaml index 5818193349..d610ff5d76 100644 --- a/ext/openAPI/components/schemas/errors/datahub/PolicyNotFoundError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/PolicyNotFoundError.yaml @@ -1,7 +1,5 @@ -x-implements: - - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../../ProblemDetails.yaml" + - $ref: "../ApiError.yaml" - type: object properties: id: diff --git a/ext/openAPI/components/schemas/errors/datahub/SchemaAlreadyPresentError.yaml b/ext/openAPI/components/schemas/errors/datahub/SchemaAlreadyPresentError.yaml index 0b416133d8..6236d0f6f2 100644 --- a/ext/openAPI/components/schemas/errors/datahub/SchemaAlreadyPresentError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/SchemaAlreadyPresentError.yaml @@ -1,7 +1,5 @@ -x-implements: - - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../../ProblemDetails.yaml" + - $ref: "../ApiError.yaml" - type: object properties: id: diff --git a/ext/openAPI/components/schemas/errors/datahub/SchemaEtagMismatchError.yaml b/ext/openAPI/components/schemas/errors/datahub/SchemaEtagMismatchError.yaml index 9d2938e0ea..24059c9ad4 100644 --- a/ext/openAPI/components/schemas/errors/datahub/SchemaEtagMismatchError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/SchemaEtagMismatchError.yaml @@ -1,7 +1,5 @@ -x-implements: - - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../../ProblemDetails.yaml" + - $ref: "../ApiError.yaml" - type: object properties: id: diff --git a/ext/openAPI/components/schemas/errors/datahub/SchemaInvalidErrors.yaml b/ext/openAPI/components/schemas/errors/datahub/SchemaInvalidErrors.yaml index dd1411d4e4..dc723389e9 100644 --- a/ext/openAPI/components/schemas/errors/datahub/SchemaInvalidErrors.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/SchemaInvalidErrors.yaml @@ -1,5 +1,3 @@ -x-implements: - - com.hivemq.api.errors.OpenApiError allOf: - $ref: "../validation/ValidationErrors.yaml" - type: object diff --git a/ext/openAPI/components/schemas/errors/datahub/SchemaNotFoundError.yaml b/ext/openAPI/components/schemas/errors/datahub/SchemaNotFoundError.yaml index b6878bf50d..d97a5b3efe 100644 --- a/ext/openAPI/components/schemas/errors/datahub/SchemaNotFoundError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/SchemaNotFoundError.yaml @@ -1,7 +1,5 @@ -x-implements: - - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../../ProblemDetails.yaml" + - $ref: "../ApiError.yaml" - type: object properties: id: diff --git a/ext/openAPI/components/schemas/errors/datahub/SchemaParsingFailureError.yaml b/ext/openAPI/components/schemas/errors/datahub/SchemaParsingFailureError.yaml index 2037aef5ad..ce8c56bfe8 100644 --- a/ext/openAPI/components/schemas/errors/datahub/SchemaParsingFailureError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/SchemaParsingFailureError.yaml @@ -1,7 +1,5 @@ -x-implements: - - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../../ProblemDetails.yaml" + - $ref: "../ApiError.yaml" - type: object properties: alias: diff --git a/ext/openAPI/components/schemas/errors/datahub/SchemaReferencedError.yaml b/ext/openAPI/components/schemas/errors/datahub/SchemaReferencedError.yaml index a220a52516..8cc8337271 100644 --- a/ext/openAPI/components/schemas/errors/datahub/SchemaReferencedError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/SchemaReferencedError.yaml @@ -1,7 +1,5 @@ -x-implements: - - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../../ProblemDetails.yaml" + - $ref: "../ApiError.yaml" - type: object properties: id: diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptAlreadyPresentError.yaml b/ext/openAPI/components/schemas/errors/datahub/ScriptAlreadyPresentError.yaml index 530391d730..c83675a565 100644 --- a/ext/openAPI/components/schemas/errors/datahub/ScriptAlreadyPresentError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/ScriptAlreadyPresentError.yaml @@ -1,7 +1,5 @@ -x-implements: - - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../../ProblemDetails.yaml" + - $ref: "../ApiError.yaml" - type: object properties: id: diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptCreationFailureError.yaml b/ext/openAPI/components/schemas/errors/datahub/ScriptCreationFailureError.yaml index 7784cacb04..f057bedf2b 100644 --- a/ext/openAPI/components/schemas/errors/datahub/ScriptCreationFailureError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/ScriptCreationFailureError.yaml @@ -1,7 +1,5 @@ -x-implements: - - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../../ProblemDetails.yaml" + - $ref: "../ApiError.yaml" - type: object properties: reason: diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptEtagMismatchError.yaml b/ext/openAPI/components/schemas/errors/datahub/ScriptEtagMismatchError.yaml index f8d9c8658a..3b028f9679 100644 --- a/ext/openAPI/components/schemas/errors/datahub/ScriptEtagMismatchError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/ScriptEtagMismatchError.yaml @@ -1,7 +1,5 @@ -x-implements: - - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../../ProblemDetails.yaml" + - $ref: "../ApiError.yaml" - type: object properties: id: diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptInvalidErrors.yaml b/ext/openAPI/components/schemas/errors/datahub/ScriptInvalidErrors.yaml index dd1411d4e4..dc723389e9 100644 --- a/ext/openAPI/components/schemas/errors/datahub/ScriptInvalidErrors.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/ScriptInvalidErrors.yaml @@ -1,5 +1,3 @@ -x-implements: - - com.hivemq.api.errors.OpenApiError allOf: - $ref: "../validation/ValidationErrors.yaml" - type: object diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptNotFoundError.yaml b/ext/openAPI/components/schemas/errors/datahub/ScriptNotFoundError.yaml index 7755cdeb02..6ed23049c9 100644 --- a/ext/openAPI/components/schemas/errors/datahub/ScriptNotFoundError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/ScriptNotFoundError.yaml @@ -1,7 +1,5 @@ -x-implements: - - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../../ProblemDetails.yaml" + - $ref: "../ApiError.yaml" - type: object properties: id: diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptParsingFailureError.yaml b/ext/openAPI/components/schemas/errors/datahub/ScriptParsingFailureError.yaml index 7784cacb04..f057bedf2b 100644 --- a/ext/openAPI/components/schemas/errors/datahub/ScriptParsingFailureError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/ScriptParsingFailureError.yaml @@ -1,7 +1,5 @@ -x-implements: - - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../../ProblemDetails.yaml" + - $ref: "../ApiError.yaml" - type: object properties: reason: diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptReferencedError.yaml b/ext/openAPI/components/schemas/errors/datahub/ScriptReferencedError.yaml index 74ccb23143..6063961441 100644 --- a/ext/openAPI/components/schemas/errors/datahub/ScriptReferencedError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/ScriptReferencedError.yaml @@ -1,7 +1,5 @@ -x-implements: - - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../../ProblemDetails.yaml" + - $ref: "../ApiError.yaml" - type: object properties: id: diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptSanitationFailureError.yaml b/ext/openAPI/components/schemas/errors/datahub/ScriptSanitationFailureError.yaml index 7784cacb04..f057bedf2b 100644 --- a/ext/openAPI/components/schemas/errors/datahub/ScriptSanitationFailureError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/ScriptSanitationFailureError.yaml @@ -1,7 +1,5 @@ -x-implements: - - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../../ProblemDetails.yaml" + - $ref: "../ApiError.yaml" - type: object properties: reason: diff --git a/ext/openAPI/components/schemas/errors/datahub/TopicFilterMismatchError.yaml b/ext/openAPI/components/schemas/errors/datahub/TopicFilterMismatchError.yaml index b3bc2e78ae..b46b6c3860 100644 --- a/ext/openAPI/components/schemas/errors/datahub/TopicFilterMismatchError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/TopicFilterMismatchError.yaml @@ -1,7 +1,5 @@ -x-implements: - - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../../ProblemDetails.yaml" + - $ref: "../ApiError.yaml" - type: object properties: message: diff --git a/ext/openAPI/components/schemas/errors/http/InsufficientStorageError.yaml b/ext/openAPI/components/schemas/errors/http/InsufficientStorageError.yaml index d91616bae0..d73198eeee 100644 --- a/ext/openAPI/components/schemas/errors/http/InsufficientStorageError.yaml +++ b/ext/openAPI/components/schemas/errors/http/InsufficientStorageError.yaml @@ -1,7 +1,5 @@ -x-implements: - - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../../ProblemDetails.yaml" + - $ref: "../ApiError.yaml" - type: object properties: reason: diff --git a/ext/openAPI/components/schemas/errors/http/InternalServerError.yaml b/ext/openAPI/components/schemas/errors/http/InternalServerError.yaml index adb82e711a..aa2376ea32 100644 --- a/ext/openAPI/components/schemas/errors/http/InternalServerError.yaml +++ b/ext/openAPI/components/schemas/errors/http/InternalServerError.yaml @@ -1,7 +1,5 @@ -x-implements: - - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../../ProblemDetails.yaml" + - $ref: "../ApiError.yaml" - type: object properties: reason: diff --git a/ext/openAPI/components/schemas/errors/http/InvalidQueryParameterError.yaml b/ext/openAPI/components/schemas/errors/http/InvalidQueryParameterError.yaml index 772a4daa03..9017487fa4 100644 --- a/ext/openAPI/components/schemas/errors/http/InvalidQueryParameterError.yaml +++ b/ext/openAPI/components/schemas/errors/http/InvalidQueryParameterError.yaml @@ -1,7 +1,5 @@ -x-implements: - - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../../ProblemDetails.yaml" + - $ref: "../ApiError.yaml" - type: object properties: parameter: diff --git a/ext/openAPI/components/schemas/errors/http/PreconditionFailedError.yaml b/ext/openAPI/components/schemas/errors/http/PreconditionFailedError.yaml index ce1fda4f12..28bcf2ff3b 100644 --- a/ext/openAPI/components/schemas/errors/http/PreconditionFailedError.yaml +++ b/ext/openAPI/components/schemas/errors/http/PreconditionFailedError.yaml @@ -1,7 +1,5 @@ -x-implements: - - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../../ProblemDetails.yaml" + - $ref: "../ApiError.yaml" - type: object properties: reason: diff --git a/ext/openAPI/components/schemas/errors/http/RequestBodyMissingError.yaml b/ext/openAPI/components/schemas/errors/http/RequestBodyMissingError.yaml index 8d7d8b4ed0..f3e4330f07 100644 --- a/ext/openAPI/components/schemas/errors/http/RequestBodyMissingError.yaml +++ b/ext/openAPI/components/schemas/errors/http/RequestBodyMissingError.yaml @@ -1,7 +1,5 @@ -x-implements: - - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../../ProblemDetails.yaml" + - $ref: "../ApiError.yaml" - type: object properties: status: diff --git a/ext/openAPI/components/schemas/errors/http/RequestBodyParameterMissingError.yaml b/ext/openAPI/components/schemas/errors/http/RequestBodyParameterMissingError.yaml index 8bfadcc89b..6288470eca 100644 --- a/ext/openAPI/components/schemas/errors/http/RequestBodyParameterMissingError.yaml +++ b/ext/openAPI/components/schemas/errors/http/RequestBodyParameterMissingError.yaml @@ -1,7 +1,5 @@ -x-implements: - - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../../ProblemDetails.yaml" + - $ref: "../ApiError.yaml" - type: object properties: parameter: diff --git a/ext/openAPI/components/schemas/errors/http/TemporaryNotAvailableError.yaml b/ext/openAPI/components/schemas/errors/http/TemporaryNotAvailableError.yaml index 01ec74f68b..ba715917fd 100644 --- a/ext/openAPI/components/schemas/errors/http/TemporaryNotAvailableError.yaml +++ b/ext/openAPI/components/schemas/errors/http/TemporaryNotAvailableError.yaml @@ -1,7 +1,5 @@ -x-implements: - - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../../ProblemDetails.yaml" + - $ref: "../ApiError.yaml" - type: object properties: status: diff --git a/ext/openAPI/components/schemas/errors/http/UrlParameterMissingError.yaml b/ext/openAPI/components/schemas/errors/http/UrlParameterMissingError.yaml index 5a4bdd2c8e..30e156d0af 100644 --- a/ext/openAPI/components/schemas/errors/http/UrlParameterMissingError.yaml +++ b/ext/openAPI/components/schemas/errors/http/UrlParameterMissingError.yaml @@ -1,7 +1,5 @@ -x-implements: - - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../../ProblemDetails.yaml" + - $ref: "../ApiError.yaml" - type: object properties: parameter: diff --git a/ext/openAPI/components/schemas/errors/validation/ValidationError.yaml b/ext/openAPI/components/schemas/errors/validation/ValidationError.yaml index e730b37389..516d9b2c5d 100644 --- a/ext/openAPI/components/schemas/errors/validation/ValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/validation/ValidationError.yaml @@ -13,17 +13,17 @@ required: discriminator: propertyName: type mapping: - AtLeastOneFieldMissingValidationError: "./AtLeastOneFieldMissingValidationError.yaml" - AtMostOneFunctionValidationError: "../datahub/AtMostOneFunctionValidationError.yaml" - EmptyFieldValidationError: "./EmptyFieldValidationError.yaml" - FunctionMustBePairedValidationError: "../datahub/FunctionMustBePairedValidationError.yaml" - GeneralPolicyValidationError: "../datahub/GeneralPolicyValidationError.yaml" - IllegalFunctionValidationError: "../datahub/IllegalFunctionValidationError.yaml" - IllegalTransitionValidationError: "../datahub/IllegalTransitionValidationError.yaml" - InvalidFieldLengthValidationError: "./InvalidFieldLengthValidationError.yaml" - InvalidFieldValueValidationError: "./InvalidFieldValueValidationError.yaml" - InvalidFunctionOrderValidationError: "../datahub/InvalidFunctionOrderValidationError.yaml" - InvalidIdentifierValidationError: "./InvalidIdentifierValidationError.yaml" - MissingFieldValidationError: "./MissingFieldValidationError.yaml" - UnknownVariableValidationError: "../datahub/UnknownVariableValidationError.yaml" - UnsupportedFieldValidationError: "./UnsupportedFieldValidationError.yaml" + https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError: "./AtLeastOneFieldMissingValidationError.yaml" + https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError: "../datahub/AtMostOneFunctionValidationError.yaml" + https://hivemq.com/edge/api/model/EmptyFieldValidationError: "./EmptyFieldValidationError.yaml" + https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError: "../datahub/FunctionMustBePairedValidationError.yaml" + https://hivemq.com/edge/api/model/GeneralPolicyValidationError: "../datahub/GeneralPolicyValidationError.yaml" + https://hivemq.com/edge/api/model/IllegalFunctionValidationError: "../datahub/IllegalFunctionValidationError.yaml" + https://hivemq.com/edge/api/model/IllegalTransitionValidationError: "../datahub/IllegalTransitionValidationError.yaml" + https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: "./InvalidFieldLengthValidationError.yaml" + https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: "./InvalidFieldValueValidationError.yaml" + https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError: "../datahub/InvalidFunctionOrderValidationError.yaml" + https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: "./InvalidIdentifierValidationError.yaml" + https://hivemq.com/edge/api/model/MissingFieldValidationError: "./MissingFieldValidationError.yaml" + https://hivemq.com/edge/api/model/UnknownVariableValidationError: "../datahub/UnknownVariableValidationError.yaml" + https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: "./UnsupportedFieldValidationError.yaml" diff --git a/ext/openAPI/components/schemas/errors/validation/ValidationErrors.yaml b/ext/openAPI/components/schemas/errors/validation/ValidationErrors.yaml index c4616d7c85..08bc25dfe5 100644 --- a/ext/openAPI/components/schemas/errors/validation/ValidationErrors.yaml +++ b/ext/openAPI/components/schemas/errors/validation/ValidationErrors.yaml @@ -1,12 +1,10 @@ -x-implements: - - com.hivemq.api.errors.OpenApiError allOf: - - $ref: "../../ProblemDetails.yaml" + - $ref: "../ApiError.yaml" - type: object properties: - errors: + childErrors: type: array - description: List of validation errors. + description: List of child validation errors. items: $ref: "./ValidationError.yaml" status: @@ -14,4 +12,11 @@ allOf: default: 400 description: The HTTP status code. required: - - errors + - childErrors +discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors: "../datahub/BehaviorPolicyInvalidErrors.yaml" + https://hivemq.com/edge/api/model/DataPolicyInvalidErrors: "../datahub/DataPolicyInvalidErrors.yaml" + https://hivemq.com/edge/api/model/SchemaInvalidErrors: "../datahub/SchemaInvalidErrors.yaml" + https://hivemq.com/edge/api/model/ScriptInvalidErrors: "../datahub/ScriptInvalidErrors.yaml" diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/OpenApiError.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/OpenApiError.java deleted file mode 100644 index de3f4f98e7..0000000000 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/OpenApiError.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2019-present HiveMQ GmbH - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.hivemq.api.errors; - -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import java.net.URI; - -public interface OpenApiError { - @Nullable String getCode(); - - void setCode(@Nullable String code); - - @Nullable String getDetail(); - - void setDetail(@Nullable String detail); - - @NotNull String getTitle(); - - void setTitle(@NotNull String title); - - @NotNull URI getType(); - - void setType(@NotNull URI type); - - @NotNull Integer getStatus(); - - void setStatus(@NotNull Integer status); -} diff --git a/hivemq-edge/src/main/java/com/hivemq/util/ErrorResponseUtil.java b/hivemq-edge/src/main/java/com/hivemq/util/ErrorResponseUtil.java index 7f14275922..347c452b72 100644 --- a/hivemq-edge/src/main/java/com/hivemq/util/ErrorResponseUtil.java +++ b/hivemq-edge/src/main/java/com/hivemq/util/ErrorResponseUtil.java @@ -15,7 +15,7 @@ */ package com.hivemq.util; -import com.hivemq.api.errors.OpenApiError; +import com.hivemq.edge.api.model.ApiError; import com.hivemq.http.error.ProblemDetails; import org.jetbrains.annotations.NotNull; @@ -25,7 +25,7 @@ * @author Christoph Schäbel */ public class ErrorResponseUtil { - public static @NotNull Response errorResponse(final @NotNull OpenApiError error) { + public static @NotNull Response errorResponse(final @NotNull ApiError error) { return Response.status(error.getStatus()) .entity(error) .header("Content-Type", "application/json;charset=utf-8") From 8aab18365d111ebe8508930bfc2ee1ad4c0ad6ad Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Wed, 4 Jun 2025 12:35:59 +0200 Subject: [PATCH 039/121] refactor: Restore errors, remove childErrors --- ext/hivemq-edge-openapi-2025.9.yaml | 11 +++++++++-- ext/openAPI/components/schemas/errors/ApiError.yaml | 9 +++++++++ .../schemas/errors/validation/ValidationErrors.yaml | 4 ++-- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index 34dc47c41e..d539d4c444 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -4772,6 +4772,13 @@ components: ApiError: allOf: - $ref: '#/components/schemas/ProblemDetails' + - type: object + properties: + errors: + type: array + description: List of child validation errors. + items: + $ref: '#/components/schemas/ValidationError' discriminator: propertyName: type mapping: @@ -5331,7 +5338,7 @@ components: - $ref: '#/components/schemas/ApiError' - type: object properties: - childErrors: + errors: type: array description: List of child validation errors. items: @@ -5341,7 +5348,7 @@ components: default: 400 description: The HTTP status code. required: - - childErrors + - errors discriminator: propertyName: type mapping: diff --git a/ext/openAPI/components/schemas/errors/ApiError.yaml b/ext/openAPI/components/schemas/errors/ApiError.yaml index c9a0fa36c4..710f6d64f0 100644 --- a/ext/openAPI/components/schemas/errors/ApiError.yaml +++ b/ext/openAPI/components/schemas/errors/ApiError.yaml @@ -1,5 +1,14 @@ allOf: - $ref: "../ProblemDetails.yaml" + - type: object + properties: + # Overwrite the errors from ProblemDetails. + # To be removed in the future. + errors: + type: array + description: List of child validation errors. + items: + $ref: "./validation/ValidationError.yaml" discriminator: propertyName: type mapping: diff --git a/ext/openAPI/components/schemas/errors/validation/ValidationErrors.yaml b/ext/openAPI/components/schemas/errors/validation/ValidationErrors.yaml index 08bc25dfe5..79058fdf6e 100644 --- a/ext/openAPI/components/schemas/errors/validation/ValidationErrors.yaml +++ b/ext/openAPI/components/schemas/errors/validation/ValidationErrors.yaml @@ -2,7 +2,7 @@ allOf: - $ref: "../ApiError.yaml" - type: object properties: - childErrors: + errors: type: array description: List of child validation errors. items: @@ -12,7 +12,7 @@ allOf: default: 400 description: The HTTP status code. required: - - childErrors + - errors discriminator: propertyName: type mapping: From 1730610ebf085373369ee495aa1b385086e9c92b Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Wed, 4 Jun 2025 15:22:00 +0200 Subject: [PATCH 040/121] fix: Fix function specs --- ext/hivemq-edge-openapi-2025.9.yaml | 2 +- .../openapi/paths/api_v1_data-hub_function-specs.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index d539d4c444..c1f60b5dcc 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -1782,7 +1782,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error summary: Get all functions as a list of function specifications tags: diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_function-specs.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_function-specs.yaml index b19bb869ec..0b94ed4ee9 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_function-specs.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_function-specs.yaml @@ -14,7 +14,7 @@ get: content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml + $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal server error summary: Get all functions as a list of function specifications tags: From cf0cf7f061bf05081d1371fb2def719e1ca09535 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Wed, 4 Jun 2025 16:00:16 +0200 Subject: [PATCH 041/121] fix: Remove default status from errors --- ext/hivemq-edge-openapi-2025.9.yaml | 166 ------------------ .../BehaviorPolicyAlreadyPresentError.yaml | 4 - .../BehaviorPolicyCreationFailureError.yaml | 4 - .../datahub/BehaviorPolicyNotFoundError.yaml | 4 - .../datahub/BehaviorPolicyRejectedError.yaml | 6 - .../BehaviorPolicyUpdateFailureError.yaml | 4 - .../datahub/ClientDisconnectedError.yaml | 4 - .../errors/datahub/ClientNotFoundError.yaml | 4 - .../DataPolicyAlreadyPresentError.yaml | 4 - .../DataPolicyCreationFailureError.yaml | 4 - .../datahub/DataPolicyInvalidErrors.yaml | 6 - .../datahub/DataPolicyNotFoundError.yaml | 4 - .../datahub/DataPolicyRejectedError.yaml | 6 - .../datahub/DataPolicyUpdateFailureError.yaml | 4 - .../errors/datahub/PolicyIdMismatchError.yaml | 4 - .../errors/datahub/PolicyNotFoundError.yaml | 4 - .../datahub/SchemaAlreadyPresentError.yaml | 4 - .../datahub/SchemaEtagMismatchError.yaml | 4 - .../errors/datahub/SchemaInvalidErrors.yaml | 6 - .../errors/datahub/SchemaNotFoundError.yaml | 4 - .../datahub/SchemaParsingFailureError.yaml | 4 - .../errors/datahub/SchemaReferencedError.yaml | 4 - .../datahub/ScriptAlreadyPresentError.yaml | 4 - .../datahub/ScriptCreationFailureError.yaml | 4 - .../datahub/ScriptEtagMismatchError.yaml | 4 - .../errors/datahub/ScriptInvalidErrors.yaml | 6 - .../errors/datahub/ScriptNotFoundError.yaml | 4 - .../datahub/ScriptParsingFailureError.yaml | 4 - .../errors/datahub/ScriptReferencedError.yaml | 4 - .../datahub/ScriptSanitationFailureError.yaml | 4 - .../datahub/TopicFilterMismatchError.yaml | 4 - .../errors/http/InsufficientStorageError.yaml | 4 - .../errors/http/InternalServerError.yaml | 4 - .../http/InvalidQueryParameterError.yaml | 4 - .../errors/http/PreconditionFailedError.yaml | 4 - .../errors/http/RequestBodyMissingError.yaml | 6 - .../RequestBodyParameterMissingError.yaml | 4 - .../http/TemporaryNotAvailableError.yaml | 6 - .../errors/http/UrlParameterMissingError.yaml | 4 - .../hivemq/api/errors/HttpErrorFactory.java | 9 + 40 files changed, 9 insertions(+), 332 deletions(-) diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index c1f60b5dcc..cc7cc9d3af 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -4829,10 +4829,6 @@ components: message: type: string description: The error message. - status: - type: integer - default: 409 - description: The HTTP status code. required: - id BehaviorPolicyCreationFailureError: @@ -4843,10 +4839,6 @@ components: reason: type: string description: The actual reason. - status: - type: integer - default: 400 - description: The HTTP status code. required: - reason BehaviorPolicyNotFoundError: @@ -4860,21 +4852,11 @@ components: message: type: string description: The error message. - status: - type: integer - default: 404 - description: The HTTP status code. required: - id BehaviorPolicyRejectedError: allOf: - $ref: '#/components/schemas/ApiError' - - type: object - properties: - status: - type: integer - default: 400 - description: The HTTP status code. BehaviorPolicyUpdateFailureError: allOf: - $ref: '#/components/schemas/ApiError' @@ -4886,10 +4868,6 @@ components: reason: type: string description: The actual reason. - status: - type: integer - default: 400 - description: The HTTP status code. required: - id ClientDisconnectedError: @@ -4900,10 +4878,6 @@ components: id: type: string description: The client id. - status: - type: integer - default: 404 - description: The HTTP status code. required: - id ClientNotFoundError: @@ -4914,10 +4888,6 @@ components: id: type: string description: The client id. - status: - type: integer - default: 404 - description: The HTTP status code. required: - id DataPolicyAlreadyPresentError: @@ -4931,10 +4901,6 @@ components: message: type: string description: The error message. - status: - type: integer - default: 409 - description: The Request Conflict HTTP Status Code. required: - id DataPolicyCreationFailureError: @@ -4945,10 +4911,6 @@ components: reason: type: string description: The actual reason. - status: - type: integer - default: 400 - description: The HTTP status code. required: - reason DataPolicyNotFoundError: @@ -4962,21 +4924,11 @@ components: message: type: string description: The error message. - status: - type: integer - default: 404 - description: The HTTP status code. required: - id DataPolicyRejectedError: allOf: - $ref: '#/components/schemas/ApiError' - - type: object - properties: - status: - type: integer - default: 400 - description: The HTTP status code. DataPolicyUpdateFailureError: allOf: - $ref: '#/components/schemas/ApiError' @@ -4988,10 +4940,6 @@ components: reason: type: string description: The actual reason. - status: - type: integer - default: 400 - description: The HTTP status code. required: - id PolicyIdMismatchError: @@ -5005,10 +4953,6 @@ components: expectedId: type: string description: The expected id. - status: - type: integer - default: 400 - description: The HTTP status code. required: - actualId - expectedId @@ -5020,10 +4964,6 @@ components: id: type: string description: The policy id. - status: - type: integer - default: 404 - description: The HTTP status code. required: - id SchemaAlreadyPresentError: @@ -5034,10 +4974,6 @@ components: id: type: string description: The schema id. - status: - type: integer - default: 409 - description: The Request Conflict HTTP Status Code. required: - id SchemaEtagMismatchError: @@ -5051,10 +4987,6 @@ components: eTag: type: string description: The eTag. - status: - type: integer - default: 412 - description: The Precondition Failed HTTP Status Code. required: - id SchemaNotFoundError: @@ -5068,10 +5000,6 @@ components: message: type: string description: The error message. - status: - type: integer - default: 404 - description: The HTTP status code. required: - id SchemaParsingFailureError: @@ -5085,10 +5013,6 @@ components: message: type: string description: The error message. - status: - type: integer - default: 400 - description: The HTTP status code. required: - alias - message @@ -5103,10 +5027,6 @@ components: message: type: string description: The error message. - status: - type: integer - default: 400 - description: The HTTP status code. required: - id ScriptAlreadyPresentError: @@ -5117,10 +5037,6 @@ components: id: type: string description: The script id. - status: - type: integer - default: 409 - description: The Request Conflict HTTP Status Code. required: - id ScriptCreationFailureError: @@ -5131,10 +5047,6 @@ components: reason: type: string description: The actual reason. - status: - type: integer - default: 400 - description: The HTTP status code. required: - reason ScriptEtagMismatchError: @@ -5148,10 +5060,6 @@ components: eTag: type: string description: The eTag. - status: - type: integer - default: 412 - description: The Precondition Failed HTTP Status Code. required: - id ScriptNotFoundError: @@ -5165,10 +5073,6 @@ components: message: type: string description: The error message. - status: - type: integer - default: 404 - description: The HTTP status code. required: - id ScriptParsingFailureError: @@ -5179,10 +5083,6 @@ components: reason: type: string description: The actual reason. - status: - type: integer - default: 400 - description: The HTTP status code. required: - reason ScriptReferencedError: @@ -5196,10 +5096,6 @@ components: message: type: string description: The error message. - status: - type: integer - default: 400 - description: The HTTP status code. required: - id ScriptSanitationFailureError: @@ -5210,10 +5106,6 @@ components: reason: type: string description: The actual reason. - status: - type: integer - default: 400 - description: The HTTP status code. required: - reason TopicFilterMismatchError: @@ -5227,10 +5119,6 @@ components: parameter: type: string description: The parameter. - status: - type: integer - default: 400 - description: The HTTP status code. required: - parameter InsufficientStorageError: @@ -5241,10 +5129,6 @@ components: reason: type: string description: The actual reason. - status: - type: integer - default: 507 - description: The HTTP status code. InternalServerError: allOf: - $ref: '#/components/schemas/ApiError' @@ -5253,10 +5137,6 @@ components: reason: type: string description: The actual reason. - status: - type: integer - default: 500 - description: The HTTP status code. InvalidQueryParameterError: allOf: - $ref: '#/components/schemas/ApiError' @@ -5268,10 +5148,6 @@ components: reason: type: string description: The reason. - status: - type: integer - default: 400 - description: The HTTP status code. required: - parameter - reason @@ -5283,21 +5159,11 @@ components: reason: type: string description: The actual reason. - status: - type: integer - default: 412 - description: The HTTP status code. required: - reason RequestBodyMissingError: allOf: - $ref: '#/components/schemas/ApiError' - - type: object - properties: - status: - type: integer - default: 400 - description: The HTTP status code. RequestBodyParameterMissingError: allOf: - $ref: '#/components/schemas/ApiError' @@ -5306,19 +5172,9 @@ components: parameter: type: string description: The the missing request body parameter. - status: - type: integer - default: 400 - description: The HTTP status code. TemporaryNotAvailableError: allOf: - $ref: '#/components/schemas/ApiError' - - type: object - properties: - status: - type: integer - default: 503 - description: The HTTP status code. UrlParameterMissingError: allOf: - $ref: '#/components/schemas/ApiError' @@ -5327,10 +5183,6 @@ components: parameter: type: string description: The name of the missing parameter. - status: - type: integer - default: 400 - description: The HTTP status code. required: - parameter ValidationErrors: @@ -5362,30 +5214,12 @@ components: DataPolicyInvalidErrors: allOf: - $ref: '#/components/schemas/ValidationErrors' - - type: object - properties: - status: - type: integer - default: 400 - description: The HTTP status code. SchemaInvalidErrors: allOf: - $ref: '#/components/schemas/ValidationErrors' - - type: object - properties: - status: - type: integer - default: 400 - description: The HTTP status code. ScriptInvalidErrors: allOf: - $ref: '#/components/schemas/ValidationErrors' - - type: object - properties: - status: - type: integer - default: 400 - description: The HTTP status code. ValidationError: type: object properties: diff --git a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyAlreadyPresentError.yaml b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyAlreadyPresentError.yaml index 97208807f7..c7c394b81a 100644 --- a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyAlreadyPresentError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyAlreadyPresentError.yaml @@ -8,9 +8,5 @@ allOf: message: type: string description: The error message. - status: - type: integer - default: 409 - description: The HTTP status code. required: - id diff --git a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyCreationFailureError.yaml b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyCreationFailureError.yaml index f057bedf2b..ea854eb9cc 100644 --- a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyCreationFailureError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyCreationFailureError.yaml @@ -5,9 +5,5 @@ allOf: reason: type: string description: The actual reason. - status: - type: integer - default: 400 - description: The HTTP status code. required: - reason diff --git a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyNotFoundError.yaml b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyNotFoundError.yaml index 67f2e4602d..725d9fbdb6 100644 --- a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyNotFoundError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyNotFoundError.yaml @@ -8,9 +8,5 @@ allOf: message: type: string description: The error message. - status: - type: integer - default: 404 - description: The HTTP status code. required: - id diff --git a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyRejectedError.yaml b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyRejectedError.yaml index f3e4330f07..1e5857dabc 100644 --- a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyRejectedError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyRejectedError.yaml @@ -1,8 +1,2 @@ allOf: - $ref: "../ApiError.yaml" - - type: object - properties: - status: - type: integer - default: 400 - description: The HTTP status code. diff --git a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyUpdateFailureError.yaml b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyUpdateFailureError.yaml index ab9d0e064a..023c38904f 100644 --- a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyUpdateFailureError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyUpdateFailureError.yaml @@ -8,9 +8,5 @@ allOf: reason: type: string description: The actual reason. - status: - type: integer - default: 400 - description: The HTTP status code. required: - id diff --git a/ext/openAPI/components/schemas/errors/datahub/ClientDisconnectedError.yaml b/ext/openAPI/components/schemas/errors/datahub/ClientDisconnectedError.yaml index 77603b221c..c0478f4549 100644 --- a/ext/openAPI/components/schemas/errors/datahub/ClientDisconnectedError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/ClientDisconnectedError.yaml @@ -5,9 +5,5 @@ allOf: id: type: string description: The client id. - status: - type: integer - default: 404 - description: The HTTP status code. required: - id diff --git a/ext/openAPI/components/schemas/errors/datahub/ClientNotFoundError.yaml b/ext/openAPI/components/schemas/errors/datahub/ClientNotFoundError.yaml index 77603b221c..c0478f4549 100644 --- a/ext/openAPI/components/schemas/errors/datahub/ClientNotFoundError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/ClientNotFoundError.yaml @@ -5,9 +5,5 @@ allOf: id: type: string description: The client id. - status: - type: integer - default: 404 - description: The HTTP status code. required: - id diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyAlreadyPresentError.yaml b/ext/openAPI/components/schemas/errors/datahub/DataPolicyAlreadyPresentError.yaml index 55b3a6ee5c..725d9fbdb6 100644 --- a/ext/openAPI/components/schemas/errors/datahub/DataPolicyAlreadyPresentError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/DataPolicyAlreadyPresentError.yaml @@ -8,9 +8,5 @@ allOf: message: type: string description: The error message. - status: - type: integer - default: 409 - description: The Request Conflict HTTP Status Code. required: - id diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyCreationFailureError.yaml b/ext/openAPI/components/schemas/errors/datahub/DataPolicyCreationFailureError.yaml index f057bedf2b..ea854eb9cc 100644 --- a/ext/openAPI/components/schemas/errors/datahub/DataPolicyCreationFailureError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/DataPolicyCreationFailureError.yaml @@ -5,9 +5,5 @@ allOf: reason: type: string description: The actual reason. - status: - type: integer - default: 400 - description: The HTTP status code. required: - reason diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyInvalidErrors.yaml b/ext/openAPI/components/schemas/errors/datahub/DataPolicyInvalidErrors.yaml index dc723389e9..edbf113e14 100644 --- a/ext/openAPI/components/schemas/errors/datahub/DataPolicyInvalidErrors.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/DataPolicyInvalidErrors.yaml @@ -1,8 +1,2 @@ allOf: - $ref: "../validation/ValidationErrors.yaml" - - type: object - properties: - status: - type: integer - default: 400 - description: The HTTP status code. diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyNotFoundError.yaml b/ext/openAPI/components/schemas/errors/datahub/DataPolicyNotFoundError.yaml index 67f2e4602d..725d9fbdb6 100644 --- a/ext/openAPI/components/schemas/errors/datahub/DataPolicyNotFoundError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/DataPolicyNotFoundError.yaml @@ -8,9 +8,5 @@ allOf: message: type: string description: The error message. - status: - type: integer - default: 404 - description: The HTTP status code. required: - id diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyRejectedError.yaml b/ext/openAPI/components/schemas/errors/datahub/DataPolicyRejectedError.yaml index f3e4330f07..1e5857dabc 100644 --- a/ext/openAPI/components/schemas/errors/datahub/DataPolicyRejectedError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/DataPolicyRejectedError.yaml @@ -1,8 +1,2 @@ allOf: - $ref: "../ApiError.yaml" - - type: object - properties: - status: - type: integer - default: 400 - description: The HTTP status code. diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyUpdateFailureError.yaml b/ext/openAPI/components/schemas/errors/datahub/DataPolicyUpdateFailureError.yaml index ab9d0e064a..023c38904f 100644 --- a/ext/openAPI/components/schemas/errors/datahub/DataPolicyUpdateFailureError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/DataPolicyUpdateFailureError.yaml @@ -8,9 +8,5 @@ allOf: reason: type: string description: The actual reason. - status: - type: integer - default: 400 - description: The HTTP status code. required: - id diff --git a/ext/openAPI/components/schemas/errors/datahub/PolicyIdMismatchError.yaml b/ext/openAPI/components/schemas/errors/datahub/PolicyIdMismatchError.yaml index d0275f4869..bddc51a565 100644 --- a/ext/openAPI/components/schemas/errors/datahub/PolicyIdMismatchError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/PolicyIdMismatchError.yaml @@ -8,10 +8,6 @@ allOf: expectedId: type: string description: The expected id. - status: - type: integer - default: 400 - description: The HTTP status code. required: - actualId - expectedId diff --git a/ext/openAPI/components/schemas/errors/datahub/PolicyNotFoundError.yaml b/ext/openAPI/components/schemas/errors/datahub/PolicyNotFoundError.yaml index d610ff5d76..229810520b 100644 --- a/ext/openAPI/components/schemas/errors/datahub/PolicyNotFoundError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/PolicyNotFoundError.yaml @@ -5,9 +5,5 @@ allOf: id: type: string description: The policy id. - status: - type: integer - default: 404 - description: The HTTP status code. required: - id diff --git a/ext/openAPI/components/schemas/errors/datahub/SchemaAlreadyPresentError.yaml b/ext/openAPI/components/schemas/errors/datahub/SchemaAlreadyPresentError.yaml index 6236d0f6f2..5a0d18a8d0 100644 --- a/ext/openAPI/components/schemas/errors/datahub/SchemaAlreadyPresentError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/SchemaAlreadyPresentError.yaml @@ -5,9 +5,5 @@ allOf: id: type: string description: The schema id. - status: - type: integer - default: 409 - description: The Request Conflict HTTP Status Code. required: - id diff --git a/ext/openAPI/components/schemas/errors/datahub/SchemaEtagMismatchError.yaml b/ext/openAPI/components/schemas/errors/datahub/SchemaEtagMismatchError.yaml index 24059c9ad4..2fd9e5c8fe 100644 --- a/ext/openAPI/components/schemas/errors/datahub/SchemaEtagMismatchError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/SchemaEtagMismatchError.yaml @@ -8,9 +8,5 @@ allOf: eTag: type: string description: The eTag. - status: - type: integer - default: 412 - description: The Precondition Failed HTTP Status Code. required: - id diff --git a/ext/openAPI/components/schemas/errors/datahub/SchemaInvalidErrors.yaml b/ext/openAPI/components/schemas/errors/datahub/SchemaInvalidErrors.yaml index dc723389e9..edbf113e14 100644 --- a/ext/openAPI/components/schemas/errors/datahub/SchemaInvalidErrors.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/SchemaInvalidErrors.yaml @@ -1,8 +1,2 @@ allOf: - $ref: "../validation/ValidationErrors.yaml" - - type: object - properties: - status: - type: integer - default: 400 - description: The HTTP status code. diff --git a/ext/openAPI/components/schemas/errors/datahub/SchemaNotFoundError.yaml b/ext/openAPI/components/schemas/errors/datahub/SchemaNotFoundError.yaml index d97a5b3efe..afd6212933 100644 --- a/ext/openAPI/components/schemas/errors/datahub/SchemaNotFoundError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/SchemaNotFoundError.yaml @@ -8,9 +8,5 @@ allOf: message: type: string description: The error message. - status: - type: integer - default: 404 - description: The HTTP status code. required: - id diff --git a/ext/openAPI/components/schemas/errors/datahub/SchemaParsingFailureError.yaml b/ext/openAPI/components/schemas/errors/datahub/SchemaParsingFailureError.yaml index ce8c56bfe8..4328751489 100644 --- a/ext/openAPI/components/schemas/errors/datahub/SchemaParsingFailureError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/SchemaParsingFailureError.yaml @@ -8,10 +8,6 @@ allOf: message: type: string description: The error message. - status: - type: integer - default: 400 - description: The HTTP status code. required: - alias - message diff --git a/ext/openAPI/components/schemas/errors/datahub/SchemaReferencedError.yaml b/ext/openAPI/components/schemas/errors/datahub/SchemaReferencedError.yaml index 8cc8337271..afd6212933 100644 --- a/ext/openAPI/components/schemas/errors/datahub/SchemaReferencedError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/SchemaReferencedError.yaml @@ -8,9 +8,5 @@ allOf: message: type: string description: The error message. - status: - type: integer - default: 400 - description: The HTTP status code. required: - id diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptAlreadyPresentError.yaml b/ext/openAPI/components/schemas/errors/datahub/ScriptAlreadyPresentError.yaml index c83675a565..b1c14b6930 100644 --- a/ext/openAPI/components/schemas/errors/datahub/ScriptAlreadyPresentError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/ScriptAlreadyPresentError.yaml @@ -5,9 +5,5 @@ allOf: id: type: string description: The script id. - status: - type: integer - default: 409 - description: The Request Conflict HTTP Status Code. required: - id diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptCreationFailureError.yaml b/ext/openAPI/components/schemas/errors/datahub/ScriptCreationFailureError.yaml index f057bedf2b..ea854eb9cc 100644 --- a/ext/openAPI/components/schemas/errors/datahub/ScriptCreationFailureError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/ScriptCreationFailureError.yaml @@ -5,9 +5,5 @@ allOf: reason: type: string description: The actual reason. - status: - type: integer - default: 400 - description: The HTTP status code. required: - reason diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptEtagMismatchError.yaml b/ext/openAPI/components/schemas/errors/datahub/ScriptEtagMismatchError.yaml index 3b028f9679..8431554b06 100644 --- a/ext/openAPI/components/schemas/errors/datahub/ScriptEtagMismatchError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/ScriptEtagMismatchError.yaml @@ -8,9 +8,5 @@ allOf: eTag: type: string description: The eTag. - status: - type: integer - default: 412 - description: The Precondition Failed HTTP Status Code. required: - id diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptInvalidErrors.yaml b/ext/openAPI/components/schemas/errors/datahub/ScriptInvalidErrors.yaml index dc723389e9..edbf113e14 100644 --- a/ext/openAPI/components/schemas/errors/datahub/ScriptInvalidErrors.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/ScriptInvalidErrors.yaml @@ -1,8 +1,2 @@ allOf: - $ref: "../validation/ValidationErrors.yaml" - - type: object - properties: - status: - type: integer - default: 400 - description: The HTTP status code. diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptNotFoundError.yaml b/ext/openAPI/components/schemas/errors/datahub/ScriptNotFoundError.yaml index 6ed23049c9..80ef98c1ab 100644 --- a/ext/openAPI/components/schemas/errors/datahub/ScriptNotFoundError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/ScriptNotFoundError.yaml @@ -8,9 +8,5 @@ allOf: message: type: string description: The error message. - status: - type: integer - default: 404 - description: The HTTP status code. required: - id diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptParsingFailureError.yaml b/ext/openAPI/components/schemas/errors/datahub/ScriptParsingFailureError.yaml index f057bedf2b..ea854eb9cc 100644 --- a/ext/openAPI/components/schemas/errors/datahub/ScriptParsingFailureError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/ScriptParsingFailureError.yaml @@ -5,9 +5,5 @@ allOf: reason: type: string description: The actual reason. - status: - type: integer - default: 400 - description: The HTTP status code. required: - reason diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptReferencedError.yaml b/ext/openAPI/components/schemas/errors/datahub/ScriptReferencedError.yaml index 6063961441..80ef98c1ab 100644 --- a/ext/openAPI/components/schemas/errors/datahub/ScriptReferencedError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/ScriptReferencedError.yaml @@ -8,9 +8,5 @@ allOf: message: type: string description: The error message. - status: - type: integer - default: 400 - description: The HTTP status code. required: - id diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptSanitationFailureError.yaml b/ext/openAPI/components/schemas/errors/datahub/ScriptSanitationFailureError.yaml index f057bedf2b..ea854eb9cc 100644 --- a/ext/openAPI/components/schemas/errors/datahub/ScriptSanitationFailureError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/ScriptSanitationFailureError.yaml @@ -5,9 +5,5 @@ allOf: reason: type: string description: The actual reason. - status: - type: integer - default: 400 - description: The HTTP status code. required: - reason diff --git a/ext/openAPI/components/schemas/errors/datahub/TopicFilterMismatchError.yaml b/ext/openAPI/components/schemas/errors/datahub/TopicFilterMismatchError.yaml index b46b6c3860..03103cc778 100644 --- a/ext/openAPI/components/schemas/errors/datahub/TopicFilterMismatchError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/TopicFilterMismatchError.yaml @@ -8,9 +8,5 @@ allOf: parameter: type: string description: The parameter. - status: - type: integer - default: 400 - description: The HTTP status code. required: - parameter diff --git a/ext/openAPI/components/schemas/errors/http/InsufficientStorageError.yaml b/ext/openAPI/components/schemas/errors/http/InsufficientStorageError.yaml index d73198eeee..10ec6cc097 100644 --- a/ext/openAPI/components/schemas/errors/http/InsufficientStorageError.yaml +++ b/ext/openAPI/components/schemas/errors/http/InsufficientStorageError.yaml @@ -5,7 +5,3 @@ allOf: reason: type: string description: The actual reason. - status: - type: integer - default: 507 - description: The HTTP status code. diff --git a/ext/openAPI/components/schemas/errors/http/InternalServerError.yaml b/ext/openAPI/components/schemas/errors/http/InternalServerError.yaml index aa2376ea32..10ec6cc097 100644 --- a/ext/openAPI/components/schemas/errors/http/InternalServerError.yaml +++ b/ext/openAPI/components/schemas/errors/http/InternalServerError.yaml @@ -5,7 +5,3 @@ allOf: reason: type: string description: The actual reason. - status: - type: integer - default: 500 - description: The HTTP status code. diff --git a/ext/openAPI/components/schemas/errors/http/InvalidQueryParameterError.yaml b/ext/openAPI/components/schemas/errors/http/InvalidQueryParameterError.yaml index 9017487fa4..8a5bc13b0a 100644 --- a/ext/openAPI/components/schemas/errors/http/InvalidQueryParameterError.yaml +++ b/ext/openAPI/components/schemas/errors/http/InvalidQueryParameterError.yaml @@ -8,10 +8,6 @@ allOf: reason: type: string description: The reason. - status: - type: integer - default: 400 - description: The HTTP status code. required: - parameter - reason diff --git a/ext/openAPI/components/schemas/errors/http/PreconditionFailedError.yaml b/ext/openAPI/components/schemas/errors/http/PreconditionFailedError.yaml index 28bcf2ff3b..ea854eb9cc 100644 --- a/ext/openAPI/components/schemas/errors/http/PreconditionFailedError.yaml +++ b/ext/openAPI/components/schemas/errors/http/PreconditionFailedError.yaml @@ -5,9 +5,5 @@ allOf: reason: type: string description: The actual reason. - status: - type: integer - default: 412 - description: The HTTP status code. required: - reason diff --git a/ext/openAPI/components/schemas/errors/http/RequestBodyMissingError.yaml b/ext/openAPI/components/schemas/errors/http/RequestBodyMissingError.yaml index f3e4330f07..1e5857dabc 100644 --- a/ext/openAPI/components/schemas/errors/http/RequestBodyMissingError.yaml +++ b/ext/openAPI/components/schemas/errors/http/RequestBodyMissingError.yaml @@ -1,8 +1,2 @@ allOf: - $ref: "../ApiError.yaml" - - type: object - properties: - status: - type: integer - default: 400 - description: The HTTP status code. diff --git a/ext/openAPI/components/schemas/errors/http/RequestBodyParameterMissingError.yaml b/ext/openAPI/components/schemas/errors/http/RequestBodyParameterMissingError.yaml index 6288470eca..65aa761137 100644 --- a/ext/openAPI/components/schemas/errors/http/RequestBodyParameterMissingError.yaml +++ b/ext/openAPI/components/schemas/errors/http/RequestBodyParameterMissingError.yaml @@ -5,7 +5,3 @@ allOf: parameter: type: string description: The the missing request body parameter. - status: - type: integer - default: 400 - description: The HTTP status code. diff --git a/ext/openAPI/components/schemas/errors/http/TemporaryNotAvailableError.yaml b/ext/openAPI/components/schemas/errors/http/TemporaryNotAvailableError.yaml index ba715917fd..1e5857dabc 100644 --- a/ext/openAPI/components/schemas/errors/http/TemporaryNotAvailableError.yaml +++ b/ext/openAPI/components/schemas/errors/http/TemporaryNotAvailableError.yaml @@ -1,8 +1,2 @@ allOf: - $ref: "../ApiError.yaml" - - type: object - properties: - status: - type: integer - default: 503 - description: The HTTP status code. diff --git a/ext/openAPI/components/schemas/errors/http/UrlParameterMissingError.yaml b/ext/openAPI/components/schemas/errors/http/UrlParameterMissingError.yaml index 30e156d0af..7a9c0e2836 100644 --- a/ext/openAPI/components/schemas/errors/http/UrlParameterMissingError.yaml +++ b/ext/openAPI/components/schemas/errors/http/UrlParameterMissingError.yaml @@ -5,9 +5,5 @@ allOf: parameter: type: string description: The name of the missing parameter. - status: - type: integer - default: 400 - description: The HTTP status code. required: - parameter diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java index e373728482..018de1510a 100644 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java @@ -24,6 +24,7 @@ import com.hivemq.edge.api.model.RequestBodyParameterMissingError; import com.hivemq.edge.api.model.TemporaryNotAvailableError; import com.hivemq.edge.api.model.UrlParameterMissingError; +import com.hivemq.http.HttpStatus; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -42,6 +43,7 @@ private HttpErrorFactory() { .title("Insufficient Storage") .detail(reason == null ? "Insufficient Storage." : "Insufficient Storage: " + reason) .reason(reason) + .status(HttpStatus.INSUFFICIENT_STORAGE_507) .build(); } @@ -51,6 +53,7 @@ private HttpErrorFactory() { .title("Internal Error") .detail(reason == null ? "An unexpected error occurred, check the logs." : reason) .reason(reason) + .status(HttpStatus.INTERNAL_SERVER_ERROR_500) .build(); } @@ -63,6 +66,7 @@ private HttpErrorFactory() { .detail("Query parameter '" + parameter + "' is invalid: " + reason) .parameter(parameter) .reason(reason) + .status(HttpStatus.BAD_REQUEST_400) .build(); } @@ -73,6 +77,7 @@ private HttpErrorFactory() { .title("Precondition Failed") .detail("A precondition required for fulfilling the request was not fulfilled: " + reason) .reason(reason) + .status(HttpStatus.PRECONDITION_FAILED_412) .build(); } @@ -81,6 +86,7 @@ private HttpErrorFactory() { .type(type(RequestBodyMissingError.class)) .title("Required request body missing") .detail("Required request body missing.") + .status(HttpStatus.BAD_REQUEST_400) .build(); } @@ -90,6 +96,7 @@ private HttpErrorFactory() { .title("Required request body parameter missing") .detail("Required request body parameter '" + parameter + "' missing.") .parameter(parameter) + .status(HttpStatus.BAD_REQUEST_400) .build(); } @@ -98,6 +105,7 @@ private HttpErrorFactory() { .type(type(TemporaryNotAvailableError.class)) .title("The endpoint is temporarily not available") .detail("The endpoint is temporarily not available, please try again later") + .status(HttpStatus.SERVICE_UNAVAILABLE_503) .build(); } @@ -107,6 +115,7 @@ private HttpErrorFactory() { .title("Required url parameter missing") .detail("Required url parameter '" + parameter + "' missing") .parameter(parameter) + .status(HttpStatus.BAD_REQUEST_400) .build(); } } From c17d8e1068aa11fc7abf41919829f552bf5886bc Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Thu, 5 Jun 2025 12:07:36 +0200 Subject: [PATCH 042/121] refactor: Add childErrors --- ext/hivemq-edge-openapi-2025.9.yaml | 170 ++++++++++++++---- .../components/schemas/errors/ApiError.yaml | 10 -- .../datahub/BehaviorPolicyInvalidErrors.yaml | 9 + .../BehaviorPolicyValidationError.yaml | 26 +++ .../datahub/DataPolicyInvalidErrors.yaml | 9 + .../datahub/DataPolicyValidationError.yaml | 26 +++ .../errors/datahub/SchemaInvalidErrors.yaml | 9 + .../errors/datahub/SchemaValidationError.yaml | 18 ++ .../errors/datahub/ScriptInvalidErrors.yaml | 9 + .../errors/datahub/ScriptValidationError.yaml | 16 ++ .../errors/validation/ValidationErrors.yaml | 13 -- 11 files changed, 260 insertions(+), 55 deletions(-) create mode 100644 ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyValidationError.yaml create mode 100644 ext/openAPI/components/schemas/errors/datahub/DataPolicyValidationError.yaml create mode 100644 ext/openAPI/components/schemas/errors/datahub/SchemaValidationError.yaml create mode 100644 ext/openAPI/components/schemas/errors/datahub/ScriptValidationError.yaml diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index cc7cc9d3af..ac2b63f7a7 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -4772,13 +4772,6 @@ components: ApiError: allOf: - $ref: '#/components/schemas/ProblemDetails' - - type: object - properties: - errors: - type: array - description: List of child validation errors. - items: - $ref: '#/components/schemas/ValidationError' discriminator: propertyName: type mapping: @@ -5188,19 +5181,6 @@ components: ValidationErrors: allOf: - $ref: '#/components/schemas/ApiError' - - type: object - properties: - errors: - type: array - description: List of child validation errors. - items: - $ref: '#/components/schemas/ValidationError' - status: - type: integer - default: 400 - description: The HTTP status code. - required: - - errors discriminator: propertyName: type mapping: @@ -5208,18 +5188,6 @@ components: https://hivemq.com/edge/api/model/DataPolicyInvalidErrors: '#/components/schemas/DataPolicyInvalidErrors' https://hivemq.com/edge/api/model/SchemaInvalidErrors: '#/components/schemas/SchemaInvalidErrors' https://hivemq.com/edge/api/model/ScriptInvalidErrors: '#/components/schemas/ScriptInvalidErrors' - BehaviorPolicyInvalidErrors: - allOf: - - $ref: '#/components/schemas/ValidationErrors' - DataPolicyInvalidErrors: - allOf: - - $ref: '#/components/schemas/ValidationErrors' - SchemaInvalidErrors: - allOf: - - $ref: '#/components/schemas/ValidationErrors' - ScriptInvalidErrors: - allOf: - - $ref: '#/components/schemas/ValidationErrors' ValidationError: type: object properties: @@ -5484,6 +5452,144 @@ components: - actualValue - expectedValue - field + BehaviorPolicyValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - oneOf: + - $ref: '#/components/schemas/GeneralPolicyValidationError' + - $ref: '#/components/schemas/IllegalFunctionValidationError' + - $ref: '#/components/schemas/IllegalTransitionValidationError' + - $ref: '#/components/schemas/AtLeastOneFieldMissingValidationError' + - $ref: '#/components/schemas/EmptyFieldValidationError' + - $ref: '#/components/schemas/InvalidFieldLengthValidationError' + - $ref: '#/components/schemas/InvalidFieldValueValidationError' + - $ref: '#/components/schemas/InvalidIdentifierValidationError' + - $ref: '#/components/schemas/MissingFieldValidationError' + - $ref: '#/components/schemas/UnsupportedFieldValidationError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/GeneralPolicyValidationError: '#/components/schemas/GeneralPolicyValidationError' + https://hivemq.com/edge/api/model/IllegalFunctionValidationError: '#/components/schemas/IllegalFunctionValidationError' + https://hivemq.com/edge/api/model/IllegalTransitionValidationError: '#/components/schemas/IllegalTransitionValidationError' + https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError: '#/components/schemas/AtLeastOneFieldMissingValidationError' + https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' + https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' + https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' + https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' + https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' + https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' + BehaviorPolicyInvalidErrors: + allOf: + - $ref: '#/components/schemas/ValidationErrors' + - type: object + properties: + childErrors: + type: array + description: List of child validation errors. + items: + $ref: '#/components/schemas/BehaviorPolicyValidationError' + required: + - childErrors + DataPolicyValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - oneOf: + - $ref: '#/components/schemas/AtMostOneFunctionValidationError' + - $ref: '#/components/schemas/FunctionMustBePairedValidationError' + - $ref: '#/components/schemas/InvalidFunctionOrderValidationError' + - $ref: '#/components/schemas/UnknownVariableValidationError' + - $ref: '#/components/schemas/EmptyFieldValidationError' + - $ref: '#/components/schemas/InvalidFieldLengthValidationError' + - $ref: '#/components/schemas/InvalidFieldValueValidationError' + - $ref: '#/components/schemas/InvalidIdentifierValidationError' + - $ref: '#/components/schemas/MissingFieldValidationError' + - $ref: '#/components/schemas/UnsupportedFieldValidationError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError: '#/components/schemas/AtMostOneFunctionValidationError' + https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError: '#/components/schemas/FunctionMustBePairedValidationError' + https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError: '#/components/schemas/InvalidFunctionOrderValidationError' + https://hivemq.com/edge/api/model/UnknownVariableValidationError: '#/components/schemas/UnknownVariableValidationError' + https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' + https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' + https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' + https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' + https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' + https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' + DataPolicyInvalidErrors: + allOf: + - $ref: '#/components/schemas/ValidationErrors' + - type: object + properties: + childErrors: + type: array + description: List of child validation errors. + items: + $ref: '#/components/schemas/DataPolicyValidationError' + required: + - childErrors + SchemaValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - oneOf: + - $ref: '#/components/schemas/EmptyFieldValidationError' + - $ref: '#/components/schemas/InvalidFieldLengthValidationError' + - $ref: '#/components/schemas/InvalidFieldValueValidationError' + - $ref: '#/components/schemas/InvalidIdentifierValidationError' + - $ref: '#/components/schemas/MissingFieldValidationError' + - $ref: '#/components/schemas/UnsupportedFieldValidationError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' + https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' + https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' + https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' + https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' + https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' + SchemaInvalidErrors: + allOf: + - $ref: '#/components/schemas/ValidationErrors' + - type: object + properties: + childErrors: + type: array + description: List of child validation errors. + items: + $ref: '#/components/schemas/SchemaValidationError' + required: + - childErrors + ScriptValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - oneOf: + - $ref: '#/components/schemas/InvalidFieldLengthValidationError' + - $ref: '#/components/schemas/InvalidFieldValueValidationError' + - $ref: '#/components/schemas/InvalidIdentifierValidationError' + - $ref: '#/components/schemas/MissingFieldValidationError' + - $ref: '#/components/schemas/UnsupportedFieldValidationError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' + https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' + https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' + https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' + https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' + ScriptInvalidErrors: + allOf: + - $ref: '#/components/schemas/ValidationErrors' + - type: object + properties: + childErrors: + type: array + description: List of child validation errors. + items: + $ref: '#/components/schemas/ScriptValidationError' + required: + - childErrors JsonNode: type: object description: The arguments of the fsm derived from the behavior policy. diff --git a/ext/openAPI/components/schemas/errors/ApiError.yaml b/ext/openAPI/components/schemas/errors/ApiError.yaml index 710f6d64f0..539355728c 100644 --- a/ext/openAPI/components/schemas/errors/ApiError.yaml +++ b/ext/openAPI/components/schemas/errors/ApiError.yaml @@ -1,14 +1,5 @@ allOf: - $ref: "../ProblemDetails.yaml" - - type: object - properties: - # Overwrite the errors from ProblemDetails. - # To be removed in the future. - errors: - type: array - description: List of child validation errors. - items: - $ref: "./validation/ValidationError.yaml" discriminator: propertyName: type mapping: @@ -51,4 +42,3 @@ discriminator: https://hivemq.com/edge/api/model/UrlParameterMissingError: "./http/UrlParameterMissingError.yaml" # Validation https://hivemq.com/edge/api/model/ValidationErrors: "./validation/ValidationErrors.yaml" - diff --git a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyInvalidErrors.yaml b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyInvalidErrors.yaml index edbf113e14..f1552c3fb9 100644 --- a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyInvalidErrors.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyInvalidErrors.yaml @@ -1,2 +1,11 @@ allOf: - $ref: "../validation/ValidationErrors.yaml" + - type: object + properties: + childErrors: + type: array + description: List of child validation errors. + items: + $ref: "./BehaviorPolicyValidationError.yaml" + required: + - childErrors diff --git a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyValidationError.yaml b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyValidationError.yaml new file mode 100644 index 0000000000..d4c46b69f4 --- /dev/null +++ b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyValidationError.yaml @@ -0,0 +1,26 @@ +allOf: + - $ref: "../validation/ValidationError.yaml" + - oneOf: + - $ref: "./GeneralPolicyValidationError.yaml" + - $ref: "./IllegalFunctionValidationError.yaml" + - $ref: "./IllegalTransitionValidationError.yaml" + - $ref: "../validation/AtLeastOneFieldMissingValidationError.yaml" + - $ref: "../validation/EmptyFieldValidationError.yaml" + - $ref: "../validation/InvalidFieldLengthValidationError.yaml" + - $ref: "../validation/InvalidFieldValueValidationError.yaml" + - $ref: "../validation/InvalidIdentifierValidationError.yaml" + - $ref: "../validation/MissingFieldValidationError.yaml" + - $ref: "../validation/UnsupportedFieldValidationError.yaml" +discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/GeneralPolicyValidationError: "./GeneralPolicyValidationError.yaml" + https://hivemq.com/edge/api/model/IllegalFunctionValidationError: "./IllegalFunctionValidationError.yaml" + https://hivemq.com/edge/api/model/IllegalTransitionValidationError: "./IllegalTransitionValidationError.yaml" + https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError: "../validation/AtLeastOneFieldMissingValidationError.yaml" + https://hivemq.com/edge/api/model/EmptyFieldValidationError: "../validation/EmptyFieldValidationError.yaml" + https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: "../validation/InvalidFieldLengthValidationError.yaml" + https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: "../validation/InvalidFieldValueValidationError.yaml" + https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: "../validation/InvalidIdentifierValidationError.yaml" + https://hivemq.com/edge/api/model/MissingFieldValidationError: "../validation/MissingFieldValidationError.yaml" + https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: "../validation/UnsupportedFieldValidationError.yaml" diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyInvalidErrors.yaml b/ext/openAPI/components/schemas/errors/datahub/DataPolicyInvalidErrors.yaml index edbf113e14..a658705f35 100644 --- a/ext/openAPI/components/schemas/errors/datahub/DataPolicyInvalidErrors.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/DataPolicyInvalidErrors.yaml @@ -1,2 +1,11 @@ allOf: - $ref: "../validation/ValidationErrors.yaml" + - type: object + properties: + childErrors: + type: array + description: List of child validation errors. + items: + $ref: "./DataPolicyValidationError.yaml" + required: + - childErrors diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyValidationError.yaml b/ext/openAPI/components/schemas/errors/datahub/DataPolicyValidationError.yaml new file mode 100644 index 0000000000..d3db30772b --- /dev/null +++ b/ext/openAPI/components/schemas/errors/datahub/DataPolicyValidationError.yaml @@ -0,0 +1,26 @@ +allOf: + - $ref: "../validation/ValidationError.yaml" + - oneOf: + - $ref: "./AtMostOneFunctionValidationError.yaml" + - $ref: "./FunctionMustBePairedValidationError.yaml" + - $ref: "./InvalidFunctionOrderValidationError.yaml" + - $ref: "./UnknownVariableValidationError.yaml" + - $ref: "../validation/EmptyFieldValidationError.yaml" + - $ref: "../validation/InvalidFieldLengthValidationError.yaml" + - $ref: "../validation/InvalidFieldValueValidationError.yaml" + - $ref: "../validation/InvalidIdentifierValidationError.yaml" + - $ref: "../validation/MissingFieldValidationError.yaml" + - $ref: "../validation/UnsupportedFieldValidationError.yaml" +discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError: "./AtMostOneFunctionValidationError.yaml" + https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError: "./FunctionMustBePairedValidationError.yaml" + https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError: "./InvalidFunctionOrderValidationError.yaml" + https://hivemq.com/edge/api/model/UnknownVariableValidationError: "./UnknownVariableValidationError.yaml" + https://hivemq.com/edge/api/model/EmptyFieldValidationError: "../validation/EmptyFieldValidationError.yaml" + https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: "../validation/InvalidFieldLengthValidationError.yaml" + https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: "../validation/InvalidFieldValueValidationError.yaml" + https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: "../validation/InvalidIdentifierValidationError.yaml" + https://hivemq.com/edge/api/model/MissingFieldValidationError: "../validation/MissingFieldValidationError.yaml" + https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: "../validation/UnsupportedFieldValidationError.yaml" diff --git a/ext/openAPI/components/schemas/errors/datahub/SchemaInvalidErrors.yaml b/ext/openAPI/components/schemas/errors/datahub/SchemaInvalidErrors.yaml index edbf113e14..76ceac773d 100644 --- a/ext/openAPI/components/schemas/errors/datahub/SchemaInvalidErrors.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/SchemaInvalidErrors.yaml @@ -1,2 +1,11 @@ allOf: - $ref: "../validation/ValidationErrors.yaml" + - type: object + properties: + childErrors: + type: array + description: List of child validation errors. + items: + $ref: "./SchemaValidationError.yaml" + required: + - childErrors diff --git a/ext/openAPI/components/schemas/errors/datahub/SchemaValidationError.yaml b/ext/openAPI/components/schemas/errors/datahub/SchemaValidationError.yaml new file mode 100644 index 0000000000..cd314c7c79 --- /dev/null +++ b/ext/openAPI/components/schemas/errors/datahub/SchemaValidationError.yaml @@ -0,0 +1,18 @@ +allOf: + - $ref: "../validation/ValidationError.yaml" + - oneOf: + - $ref: "../validation/EmptyFieldValidationError.yaml" + - $ref: "../validation/InvalidFieldLengthValidationError.yaml" + - $ref: "../validation/InvalidFieldValueValidationError.yaml" + - $ref: "../validation/InvalidIdentifierValidationError.yaml" + - $ref: "../validation/MissingFieldValidationError.yaml" + - $ref: "../validation/UnsupportedFieldValidationError.yaml" +discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/EmptyFieldValidationError: "../validation/EmptyFieldValidationError.yaml" + https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: "../validation/InvalidFieldLengthValidationError.yaml" + https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: "../validation/InvalidFieldValueValidationError.yaml" + https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: "../validation/InvalidIdentifierValidationError.yaml" + https://hivemq.com/edge/api/model/MissingFieldValidationError: "../validation/MissingFieldValidationError.yaml" + https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: "../validation/UnsupportedFieldValidationError.yaml" diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptInvalidErrors.yaml b/ext/openAPI/components/schemas/errors/datahub/ScriptInvalidErrors.yaml index edbf113e14..961f926917 100644 --- a/ext/openAPI/components/schemas/errors/datahub/ScriptInvalidErrors.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/ScriptInvalidErrors.yaml @@ -1,2 +1,11 @@ allOf: - $ref: "../validation/ValidationErrors.yaml" + - type: object + properties: + childErrors: + type: array + description: List of child validation errors. + items: + $ref: "./ScriptValidationError.yaml" + required: + - childErrors diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptValidationError.yaml b/ext/openAPI/components/schemas/errors/datahub/ScriptValidationError.yaml new file mode 100644 index 0000000000..bf16f13445 --- /dev/null +++ b/ext/openAPI/components/schemas/errors/datahub/ScriptValidationError.yaml @@ -0,0 +1,16 @@ +allOf: + - $ref: "../validation/ValidationError.yaml" + - oneOf: + - $ref: "../validation/InvalidFieldLengthValidationError.yaml" + - $ref: "../validation/InvalidFieldValueValidationError.yaml" + - $ref: "../validation/InvalidIdentifierValidationError.yaml" + - $ref: "../validation/MissingFieldValidationError.yaml" + - $ref: "../validation/UnsupportedFieldValidationError.yaml" +discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: "../validation/InvalidFieldLengthValidationError.yaml" + https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: "../validation/InvalidFieldValueValidationError.yaml" + https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: "../validation/InvalidIdentifierValidationError.yaml" + https://hivemq.com/edge/api/model/MissingFieldValidationError: "../validation/MissingFieldValidationError.yaml" + https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: "../validation/UnsupportedFieldValidationError.yaml" diff --git a/ext/openAPI/components/schemas/errors/validation/ValidationErrors.yaml b/ext/openAPI/components/schemas/errors/validation/ValidationErrors.yaml index 79058fdf6e..abe27b4703 100644 --- a/ext/openAPI/components/schemas/errors/validation/ValidationErrors.yaml +++ b/ext/openAPI/components/schemas/errors/validation/ValidationErrors.yaml @@ -1,18 +1,5 @@ allOf: - $ref: "../ApiError.yaml" - - type: object - properties: - errors: - type: array - description: List of child validation errors. - items: - $ref: "./ValidationError.yaml" - status: - type: integer - default: 400 - description: The HTTP status code. - required: - - errors discriminator: propertyName: type mapping: From b7db5b9f87fbe9aa85dc4342212a95a7223952dc Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Thu, 5 Jun 2025 13:21:14 +0200 Subject: [PATCH 043/121] refactor: Remove ValidationErrors --- ext/hivemq-edge-openapi-2025.9.yaml | 211 +++++++++--------- .../components/schemas/errors/ApiError.yaml | 2 - .../datahub/BehaviorPolicyInvalidErrors.yaml | 2 +- .../datahub/DataPolicyInvalidErrors.yaml | 2 +- .../errors/datahub/SchemaInvalidErrors.yaml | 2 +- .../errors/datahub/ScriptInvalidErrors.yaml | 2 +- .../errors/validation/ValidationErrors.yaml | 9 - 7 files changed, 104 insertions(+), 126 deletions(-) delete mode 100644 ext/openAPI/components/schemas/errors/validation/ValidationErrors.yaml diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index ac2b63f7a7..ce99f8c098 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -4810,7 +4810,6 @@ components: https://hivemq.com/edge/api/model/RequestBodyParameterMissingError: '#/components/schemas/RequestBodyParameterMissingError' https://hivemq.com/edge/api/model/TemporaryNotAvailableError: '#/components/schemas/TemporaryNotAvailableError' https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' - https://hivemq.com/edge/api/model/ValidationErrors: '#/components/schemas/ValidationErrors' BehaviorPolicyAlreadyPresentError: allOf: - $ref: '#/components/schemas/ApiError' @@ -5178,16 +5177,6 @@ components: description: The name of the missing parameter. required: - parameter - ValidationErrors: - allOf: - - $ref: '#/components/schemas/ApiError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors: '#/components/schemas/BehaviorPolicyInvalidErrors' - https://hivemq.com/edge/api/model/DataPolicyInvalidErrors: '#/components/schemas/DataPolicyInvalidErrors' - https://hivemq.com/edge/api/model/SchemaInvalidErrors: '#/components/schemas/SchemaInvalidErrors' - https://hivemq.com/edge/api/model/ScriptInvalidErrors: '#/components/schemas/ScriptInvalidErrors' ValidationError: type: object properties: @@ -5481,7 +5470,7 @@ components: https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' BehaviorPolicyInvalidErrors: allOf: - - $ref: '#/components/schemas/ValidationErrors' + - $ref: '#/components/schemas/ApiError' - type: object properties: childErrors: @@ -5491,105 +5480,6 @@ components: $ref: '#/components/schemas/BehaviorPolicyValidationError' required: - childErrors - DataPolicyValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - oneOf: - - $ref: '#/components/schemas/AtMostOneFunctionValidationError' - - $ref: '#/components/schemas/FunctionMustBePairedValidationError' - - $ref: '#/components/schemas/InvalidFunctionOrderValidationError' - - $ref: '#/components/schemas/UnknownVariableValidationError' - - $ref: '#/components/schemas/EmptyFieldValidationError' - - $ref: '#/components/schemas/InvalidFieldLengthValidationError' - - $ref: '#/components/schemas/InvalidFieldValueValidationError' - - $ref: '#/components/schemas/InvalidIdentifierValidationError' - - $ref: '#/components/schemas/MissingFieldValidationError' - - $ref: '#/components/schemas/UnsupportedFieldValidationError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError: '#/components/schemas/AtMostOneFunctionValidationError' - https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError: '#/components/schemas/FunctionMustBePairedValidationError' - https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError: '#/components/schemas/InvalidFunctionOrderValidationError' - https://hivemq.com/edge/api/model/UnknownVariableValidationError: '#/components/schemas/UnknownVariableValidationError' - https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' - https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' - https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' - https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' - https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' - https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' - DataPolicyInvalidErrors: - allOf: - - $ref: '#/components/schemas/ValidationErrors' - - type: object - properties: - childErrors: - type: array - description: List of child validation errors. - items: - $ref: '#/components/schemas/DataPolicyValidationError' - required: - - childErrors - SchemaValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - oneOf: - - $ref: '#/components/schemas/EmptyFieldValidationError' - - $ref: '#/components/schemas/InvalidFieldLengthValidationError' - - $ref: '#/components/schemas/InvalidFieldValueValidationError' - - $ref: '#/components/schemas/InvalidIdentifierValidationError' - - $ref: '#/components/schemas/MissingFieldValidationError' - - $ref: '#/components/schemas/UnsupportedFieldValidationError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' - https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' - https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' - https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' - https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' - https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' - SchemaInvalidErrors: - allOf: - - $ref: '#/components/schemas/ValidationErrors' - - type: object - properties: - childErrors: - type: array - description: List of child validation errors. - items: - $ref: '#/components/schemas/SchemaValidationError' - required: - - childErrors - ScriptValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - oneOf: - - $ref: '#/components/schemas/InvalidFieldLengthValidationError' - - $ref: '#/components/schemas/InvalidFieldValueValidationError' - - $ref: '#/components/schemas/InvalidIdentifierValidationError' - - $ref: '#/components/schemas/MissingFieldValidationError' - - $ref: '#/components/schemas/UnsupportedFieldValidationError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' - https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' - https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' - https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' - https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' - ScriptInvalidErrors: - allOf: - - $ref: '#/components/schemas/ValidationErrors' - - type: object - properties: - childErrors: - type: array - description: List of child validation errors. - items: - $ref: '#/components/schemas/ScriptValidationError' - required: - - childErrors JsonNode: type: object description: The arguments of the fsm derived from the behavior policy. @@ -5711,6 +5601,45 @@ components: description: List of result items that are returned by this endpoint items: $ref: '#/components/schemas/DataPolicy' + DataPolicyValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - oneOf: + - $ref: '#/components/schemas/AtMostOneFunctionValidationError' + - $ref: '#/components/schemas/FunctionMustBePairedValidationError' + - $ref: '#/components/schemas/InvalidFunctionOrderValidationError' + - $ref: '#/components/schemas/UnknownVariableValidationError' + - $ref: '#/components/schemas/EmptyFieldValidationError' + - $ref: '#/components/schemas/InvalidFieldLengthValidationError' + - $ref: '#/components/schemas/InvalidFieldValueValidationError' + - $ref: '#/components/schemas/InvalidIdentifierValidationError' + - $ref: '#/components/schemas/MissingFieldValidationError' + - $ref: '#/components/schemas/UnsupportedFieldValidationError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError: '#/components/schemas/AtMostOneFunctionValidationError' + https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError: '#/components/schemas/FunctionMustBePairedValidationError' + https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError: '#/components/schemas/InvalidFunctionOrderValidationError' + https://hivemq.com/edge/api/model/UnknownVariableValidationError: '#/components/schemas/UnknownVariableValidationError' + https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' + https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' + https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' + https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' + https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' + https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' + DataPolicyInvalidErrors: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + childErrors: + type: array + description: List of child validation errors. + items: + $ref: '#/components/schemas/DataPolicyValidationError' + required: + - childErrors BehaviorPolicyTransitionEvent: type: string description: Accepted event in transition @@ -5814,6 +5743,37 @@ components: description: List of result items that are returned by this endpoint items: $ref: '#/components/schemas/PolicySchema' + SchemaValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - oneOf: + - $ref: '#/components/schemas/EmptyFieldValidationError' + - $ref: '#/components/schemas/InvalidFieldLengthValidationError' + - $ref: '#/components/schemas/InvalidFieldValueValidationError' + - $ref: '#/components/schemas/InvalidIdentifierValidationError' + - $ref: '#/components/schemas/MissingFieldValidationError' + - $ref: '#/components/schemas/UnsupportedFieldValidationError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' + https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' + https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' + https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' + https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' + https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' + SchemaInvalidErrors: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + childErrors: + type: array + description: List of child validation errors. + items: + $ref: '#/components/schemas/SchemaValidationError' + required: + - childErrors Script: type: object properties: @@ -5855,6 +5815,35 @@ components: description: List of result items that are returned by this endpoint items: $ref: '#/components/schemas/Script' + ScriptValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - oneOf: + - $ref: '#/components/schemas/InvalidFieldLengthValidationError' + - $ref: '#/components/schemas/InvalidFieldValueValidationError' + - $ref: '#/components/schemas/InvalidIdentifierValidationError' + - $ref: '#/components/schemas/MissingFieldValidationError' + - $ref: '#/components/schemas/UnsupportedFieldValidationError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' + https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' + https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' + https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' + https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' + ScriptInvalidErrors: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + childErrors: + type: array + description: List of child validation errors. + items: + $ref: '#/components/schemas/ScriptValidationError' + required: + - childErrors Capability: type: object description: List of result items that are returned by this endpoint diff --git a/ext/openAPI/components/schemas/errors/ApiError.yaml b/ext/openAPI/components/schemas/errors/ApiError.yaml index 539355728c..43e01fbbf0 100644 --- a/ext/openAPI/components/schemas/errors/ApiError.yaml +++ b/ext/openAPI/components/schemas/errors/ApiError.yaml @@ -40,5 +40,3 @@ discriminator: https://hivemq.com/edge/api/model/RequestBodyParameterMissingError: "./http/RequestBodyParameterMissingError.yaml" https://hivemq.com/edge/api/model/TemporaryNotAvailableError: "./http/TemporaryNotAvailableError.yaml" https://hivemq.com/edge/api/model/UrlParameterMissingError: "./http/UrlParameterMissingError.yaml" - # Validation - https://hivemq.com/edge/api/model/ValidationErrors: "./validation/ValidationErrors.yaml" diff --git a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyInvalidErrors.yaml b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyInvalidErrors.yaml index f1552c3fb9..fe57f77b68 100644 --- a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyInvalidErrors.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyInvalidErrors.yaml @@ -1,5 +1,5 @@ allOf: - - $ref: "../validation/ValidationErrors.yaml" + - $ref: "../ApiError.yaml" - type: object properties: childErrors: diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyInvalidErrors.yaml b/ext/openAPI/components/schemas/errors/datahub/DataPolicyInvalidErrors.yaml index a658705f35..eb1641b65d 100644 --- a/ext/openAPI/components/schemas/errors/datahub/DataPolicyInvalidErrors.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/DataPolicyInvalidErrors.yaml @@ -1,5 +1,5 @@ allOf: - - $ref: "../validation/ValidationErrors.yaml" + - $ref: "../ApiError.yaml" - type: object properties: childErrors: diff --git a/ext/openAPI/components/schemas/errors/datahub/SchemaInvalidErrors.yaml b/ext/openAPI/components/schemas/errors/datahub/SchemaInvalidErrors.yaml index 76ceac773d..4f05627d43 100644 --- a/ext/openAPI/components/schemas/errors/datahub/SchemaInvalidErrors.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/SchemaInvalidErrors.yaml @@ -1,5 +1,5 @@ allOf: - - $ref: "../validation/ValidationErrors.yaml" + - $ref: "../ApiError.yaml" - type: object properties: childErrors: diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptInvalidErrors.yaml b/ext/openAPI/components/schemas/errors/datahub/ScriptInvalidErrors.yaml index 961f926917..31be71e682 100644 --- a/ext/openAPI/components/schemas/errors/datahub/ScriptInvalidErrors.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/ScriptInvalidErrors.yaml @@ -1,5 +1,5 @@ allOf: - - $ref: "../validation/ValidationErrors.yaml" + - $ref: "../ApiError.yaml" - type: object properties: childErrors: diff --git a/ext/openAPI/components/schemas/errors/validation/ValidationErrors.yaml b/ext/openAPI/components/schemas/errors/validation/ValidationErrors.yaml deleted file mode 100644 index abe27b4703..0000000000 --- a/ext/openAPI/components/schemas/errors/validation/ValidationErrors.yaml +++ /dev/null @@ -1,9 +0,0 @@ -allOf: - - $ref: "../ApiError.yaml" -discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors: "../datahub/BehaviorPolicyInvalidErrors.yaml" - https://hivemq.com/edge/api/model/DataPolicyInvalidErrors: "../datahub/DataPolicyInvalidErrors.yaml" - https://hivemq.com/edge/api/model/SchemaInvalidErrors: "../datahub/SchemaInvalidErrors.yaml" - https://hivemq.com/edge/api/model/ScriptInvalidErrors: "../datahub/ScriptInvalidErrors.yaml" From c9bb31c9d2a2709e280ec711c6aaa19a3e1f5592 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Thu, 5 Jun 2025 16:37:33 +0200 Subject: [PATCH 044/121] refactor: field to path --- ext/hivemq-edge-openapi-2025.9.yaml | 275 +++++++++--------- .../AtMostOneFunctionValidationError.yaml | 3 +- .../BehaviorPolicyValidationError.yaml | 4 +- ...llegalEventTransitionValidationError.yaml} | 6 +- .../IllegalFunctionValidationError.yaml | 3 +- .../InvalidFunctionOrderValidationError.yaml | 9 +- .../datahub/TopicFilterMismatchError.yaml | 6 +- ...AtLeastOneFieldMissingValidationError.yaml | 8 +- .../validation/EmptyFieldValidationError.yaml | 5 +- .../InvalidFieldLengthValidationError.yaml | 7 +- .../InvalidFieldValueValidationError.yaml | 7 +- .../InvalidIdentifierValidationError.yaml | 7 +- .../MissingFieldValidationError.yaml | 7 +- .../UnsupportedFieldValidationError.yaml | 7 +- .../errors/validation/ValidationError.yaml | 2 +- ...data-hub_behavior-validation_policies.yaml | 14 +- ...havior-validation_policies_{policyId}.yaml | 30 +- ...behavior-validation_states_{clientId}.yaml | 6 +- ..._v1_data-hub_data-validation_policies.yaml | 14 +- ...b_data-validation_policies_{policyId}.yaml | 30 +- .../openapi/paths/api_v1_data-hub_fsm.yaml | 2 +- .../paths/api_v1_data-hub_function-specs.yaml | 2 +- .../paths/api_v1_data-hub_functions.yaml | 2 +- .../paths/api_v1_data-hub_schemas.yaml | 16 +- .../api_v1_data-hub_schemas_{schemaId}.yaml | 18 +- .../paths/api_v1_data-hub_scripts.yaml | 16 +- .../api_v1_data-hub_scripts_{scriptId}.yaml | 18 +- .../api/errors/ValidationErrorFactory.java | 50 ++-- 28 files changed, 298 insertions(+), 276 deletions(-) rename ext/openAPI/components/schemas/errors/datahub/{IllegalTransitionValidationError.yaml => IllegalEventTransitionValidationError.yaml} (77%) diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index ce99f8c098..135e80c95b 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -354,7 +354,7 @@ paths: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: '#/components/schemas/InvalidQueryParameterError' @@ -363,7 +363,7 @@ paths: description: URL parameter missing '503': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable @@ -451,7 +451,7 @@ paths: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: '#/components/schemas/RequestBodyMissingError' @@ -463,25 +463,25 @@ paths: description: Policy creation failed '409': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/BehaviorPolicyAlreadyPresentError' description: Behavior policy already present '500': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable '507': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/InsufficientStorageError' description: Insufficient storage @@ -514,7 +514,7 @@ paths: description: Success, no response body '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: '#/components/schemas/UrlParameterMissingError' @@ -523,25 +523,25 @@ paths: description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/PolicyNotFoundError' description: Behavior policy not found '412': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/PreconditionFailedError' description: Precondition failed '500': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable @@ -612,7 +612,7 @@ paths: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: '#/components/schemas/UrlParameterMissingError' @@ -621,19 +621,19 @@ paths: description: Bad request '404': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/BehaviorPolicyNotFoundError' description: Policy not found '500': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable @@ -737,7 +737,7 @@ paths: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: '#/components/schemas/RequestBodyMissingError' @@ -749,31 +749,31 @@ paths: description: Behavior policy creation failed '404': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/BehaviorPolicyNotFoundError' description: Data policy not found '412': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/PreconditionFailedError' description: Precondition failed '500': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable '507': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/InsufficientStorageError' description: Insufficient storage @@ -821,7 +821,7 @@ paths: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: '#/components/schemas/UrlParameterMissingError' @@ -830,7 +830,7 @@ paths: description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: oneOf: - $ref: '#/components/schemas/ClientDisconnectedError' @@ -840,7 +840,7 @@ paths: description: Client error '500': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/InternalServerError' description: Internal server error @@ -1092,7 +1092,7 @@ paths: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: '#/components/schemas/InvalidQueryParameterError' @@ -1101,7 +1101,7 @@ paths: description: URL parameter missing '503': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable @@ -1187,7 +1187,7 @@ paths: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: '#/components/schemas/RequestBodyMissingError' @@ -1199,25 +1199,25 @@ paths: description: Data policy creation failed '409': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/DataPolicyAlreadyPresentError' description: Data policy already present '500': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable '507': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/InsufficientStorageError' description: Insufficient storage @@ -1250,7 +1250,7 @@ paths: description: Success, no response body '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: '#/components/schemas/UrlParameterMissingError' @@ -1259,25 +1259,25 @@ paths: description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/PolicyNotFoundError' description: Data policy not found '412': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/PreconditionFailedError' description: Precondition failed '500': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable @@ -1347,7 +1347,7 @@ paths: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: '#/components/schemas/UrlParameterMissingError' @@ -1356,19 +1356,19 @@ paths: description: Bad request '404': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/PolicyNotFoundError' description: Resource not found '500': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable @@ -1471,7 +1471,7 @@ paths: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: '#/components/schemas/RequestBodyMissingError' @@ -1486,31 +1486,31 @@ paths: description: Data policy creation failed '404': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/DataPolicyNotFoundError' description: Data policy not found '412': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/PreconditionFailedError' description: Precondition failed '500': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable '507': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/InsufficientStorageError' description: Insufficient storage @@ -1598,7 +1598,7 @@ paths: description: Success '500': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/InternalServerError' description: Internal server error @@ -1760,7 +1760,7 @@ paths: description: Success '500': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/InternalServerError' description: Internal server error @@ -1780,7 +1780,7 @@ paths: description: Success '500': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/InternalServerError' description: Internal server error @@ -1919,7 +1919,7 @@ paths: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: '#/components/schemas/InvalidQueryParameterError' @@ -1928,7 +1928,7 @@ paths: description: URL parameter missing '503': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable @@ -1977,7 +1977,7 @@ paths: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: '#/components/schemas/RequestBodyParameterMissingError' @@ -1988,31 +1988,31 @@ paths: description: Schema creation failed '409': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/SchemaAlreadyPresentError' description: Schema is already present '412': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/SchemaEtagMismatchError' description: Schema doesn't match etag '500': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable '507': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/InsufficientStorageError' description: Insufficient storage @@ -2045,7 +2045,7 @@ paths: description: Success, no response body '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: '#/components/schemas/UrlParameterMissingError' @@ -2055,25 +2055,25 @@ paths: description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/SchemaNotFoundError' description: Schema not found '412': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/SchemaEtagMismatchError' description: Schema doesn't match etag '500': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/InternalServerError' description: Internal Server error '503': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable @@ -2121,7 +2121,7 @@ paths: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: '#/components/schemas/UrlParameterMissingError' @@ -2130,19 +2130,19 @@ paths: description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/SchemaNotFoundError' description: Schema not found '500': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable @@ -2268,7 +2268,7 @@ paths: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: '#/components/schemas/InvalidQueryParameterError' @@ -2277,7 +2277,7 @@ paths: description: URL parameter missing '503': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable @@ -2326,7 +2326,7 @@ paths: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: '#/components/schemas/RequestBodyParameterMissingError' @@ -2339,31 +2339,31 @@ paths: description: Script creation failed '409': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/ScriptAlreadyPresentError' description: Script is already present '412': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/ScriptEtagMismatchError' description: Script doesn't match etag '500': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable '507': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/InsufficientStorageError' description: Insufficient storage @@ -2393,7 +2393,7 @@ paths: description: Success, no response body '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: '#/components/schemas/UrlParameterMissingError' @@ -2403,25 +2403,25 @@ paths: description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/ScriptNotFoundError' description: Script not found '412': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/ScriptEtagMismatchError' description: Script doesn't match etag '500': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/InternalServerError' description: Internal Server error '503': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable @@ -2465,7 +2465,7 @@ paths: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: '#/components/schemas/UrlParameterMissingError' @@ -2474,19 +2474,19 @@ paths: description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/ScriptNotFoundError' description: Script not found '500': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/InternalServerError' description: Internal Server error '503': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable @@ -5108,11 +5108,11 @@ components: message: type: string description: The error message. - parameter: + path: type: string - description: The parameter. + description: The json path of the topic filter. required: - - parameter + - path InsufficientStorageError: allOf: - $ref: '#/components/schemas/ApiError' @@ -5198,8 +5198,8 @@ components: https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError: '#/components/schemas/FunctionMustBePairedValidationError' https://hivemq.com/edge/api/model/GeneralPolicyValidationError: '#/components/schemas/GeneralPolicyValidationError' + https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError: '#/components/schemas/IllegalEventTransitionValidationError' https://hivemq.com/edge/api/model/IllegalFunctionValidationError: '#/components/schemas/IllegalFunctionValidationError' - https://hivemq.com/edge/api/model/IllegalTransitionValidationError: '#/components/schemas/IllegalTransitionValidationError' https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError: '#/components/schemas/InvalidFunctionOrderValidationError' @@ -5212,13 +5212,15 @@ components: - $ref: '#/components/schemas/ValidationError' - type: object properties: - fields: + paths: type: array - description: The missing fields. + description: The missing json paths. items: type: string + format: json-path + description: The json path. required: - - fields + - paths AtMostOneFunctionValidationError: allOf: - $ref: '#/components/schemas/ValidationError' @@ -5235,7 +5237,8 @@ components: type: array items: type: string - description: The paths where the function occurs. + format: json-path + description: The json paths where the function occurs. required: - function - occurrences @@ -5245,11 +5248,12 @@ components: - $ref: '#/components/schemas/ValidationError' - type: object properties: - field: + path: type: string + format: json-path description: The missing field. required: - - field + - path FunctionMustBePairedValidationError: allOf: - $ref: '#/components/schemas/ValidationError' @@ -5274,7 +5278,7 @@ components: description: The title. required: - title - IllegalFunctionValidationError: + IllegalEventTransitionValidationError: allOf: - $ref: '#/components/schemas/ValidationError' - type: object @@ -5282,21 +5286,25 @@ components: event: type: string description: The event name. - id: + fromState: type: string - description: The function id. - message: + description: The event from state. + id: type: string - description: The error message. + description: The event id. path: type: string description: The path. + toState: + type: string + description: The event to state. required: - event + - fromState - id - - message - path - IllegalTransitionValidationError: + - toState + IllegalFunctionValidationError: allOf: - $ref: '#/components/schemas/ValidationError' - type: object @@ -5304,24 +5312,21 @@ components: event: type: string description: The event name. - fromState: - type: string - description: The from state. id: type: string - description: The id. - path: + description: The function id. + message: type: string - description: The path. - toState: + description: The error message. + path: type: string - description: The to state. + format: json-path + description: The json path. required: - event - - fromState - id + - message - path - - toState InvalidFieldLengthValidationError: allOf: - $ref: '#/components/schemas/ValidationError' @@ -5339,9 +5344,10 @@ components: type: integer format: int32 description: The maximum length expected for the field value. - field: + path: type: string - description: The invalid field. + format: json-path + description: The invalid json path. value: type: string description: The invalid value. @@ -5349,64 +5355,68 @@ components: - actualLength - expectedMinimumLength - expectedMaximumLength - - field + - path - value InvalidFieldValueValidationError: allOf: - $ref: '#/components/schemas/ValidationError' - type: object properties: - field: + path: type: string - description: The invalid field. + format: json-path + description: The invalid json path. value: type: string description: The invalid value. required: - - field + - path - value InvalidFunctionOrderValidationError: allOf: - $ref: '#/components/schemas/ValidationError' - type: object properties: - field: - type: string - description: The field. function: type: string description: The function. + path: + type: string + format: json-path + description: The json path. previousFunction: type: string description: The previous function. required: - - field - function + - path - previousFunction InvalidIdentifierValidationError: allOf: - $ref: '#/components/schemas/ValidationError' - type: object properties: - field: + path: type: string - description: The invalid identifier field. + format: json-path + description: The invalid identifier path. value: type: string description: The invalid identifier value. required: - - field + - path - value MissingFieldValidationError: allOf: - $ref: '#/components/schemas/ValidationError' - type: object properties: - field: + path: type: string - description: The missing field. + format: json-path + description: The missing path. required: - - field + - path UnknownVariableValidationError: allOf: - $ref: '#/components/schemas/ValidationError' @@ -5434,20 +5444,21 @@ components: expectedValue: type: string description: The expected value. - field: + path: type: string - description: The field. + format: json-path + description: The json path. required: - actualValue - expectedValue - - field + - path BehaviorPolicyValidationError: allOf: - $ref: '#/components/schemas/ValidationError' - oneOf: - $ref: '#/components/schemas/GeneralPolicyValidationError' - $ref: '#/components/schemas/IllegalFunctionValidationError' - - $ref: '#/components/schemas/IllegalTransitionValidationError' + - $ref: '#/components/schemas/IllegalEventTransitionValidationError' - $ref: '#/components/schemas/AtLeastOneFieldMissingValidationError' - $ref: '#/components/schemas/EmptyFieldValidationError' - $ref: '#/components/schemas/InvalidFieldLengthValidationError' @@ -5459,8 +5470,8 @@ components: propertyName: type mapping: https://hivemq.com/edge/api/model/GeneralPolicyValidationError: '#/components/schemas/GeneralPolicyValidationError' + https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError: '#/components/schemas/IllegalEventTransitionValidationError' https://hivemq.com/edge/api/model/IllegalFunctionValidationError: '#/components/schemas/IllegalFunctionValidationError' - https://hivemq.com/edge/api/model/IllegalTransitionValidationError: '#/components/schemas/IllegalTransitionValidationError' https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError: '#/components/schemas/AtLeastOneFieldMissingValidationError' https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' diff --git a/ext/openAPI/components/schemas/errors/datahub/AtMostOneFunctionValidationError.yaml b/ext/openAPI/components/schemas/errors/datahub/AtMostOneFunctionValidationError.yaml index 680f975ccd..4f05fe9d53 100644 --- a/ext/openAPI/components/schemas/errors/datahub/AtMostOneFunctionValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/AtMostOneFunctionValidationError.yaml @@ -13,7 +13,8 @@ allOf: type: array items: type: string - description: The paths where the function occurs. + format: json-path + description: The json paths where the function occurs. required: - function - occurrences diff --git a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyValidationError.yaml b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyValidationError.yaml index d4c46b69f4..a75919ff31 100644 --- a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyValidationError.yaml @@ -3,7 +3,7 @@ allOf: - oneOf: - $ref: "./GeneralPolicyValidationError.yaml" - $ref: "./IllegalFunctionValidationError.yaml" - - $ref: "./IllegalTransitionValidationError.yaml" + - $ref: "./IllegalEventTransitionValidationError.yaml" - $ref: "../validation/AtLeastOneFieldMissingValidationError.yaml" - $ref: "../validation/EmptyFieldValidationError.yaml" - $ref: "../validation/InvalidFieldLengthValidationError.yaml" @@ -15,8 +15,8 @@ discriminator: propertyName: type mapping: https://hivemq.com/edge/api/model/GeneralPolicyValidationError: "./GeneralPolicyValidationError.yaml" + https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError: "./IllegalEventTransitionValidationError.yaml" https://hivemq.com/edge/api/model/IllegalFunctionValidationError: "./IllegalFunctionValidationError.yaml" - https://hivemq.com/edge/api/model/IllegalTransitionValidationError: "./IllegalTransitionValidationError.yaml" https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError: "../validation/AtLeastOneFieldMissingValidationError.yaml" https://hivemq.com/edge/api/model/EmptyFieldValidationError: "../validation/EmptyFieldValidationError.yaml" https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: "../validation/InvalidFieldLengthValidationError.yaml" diff --git a/ext/openAPI/components/schemas/errors/datahub/IllegalTransitionValidationError.yaml b/ext/openAPI/components/schemas/errors/datahub/IllegalEventTransitionValidationError.yaml similarity index 77% rename from ext/openAPI/components/schemas/errors/datahub/IllegalTransitionValidationError.yaml rename to ext/openAPI/components/schemas/errors/datahub/IllegalEventTransitionValidationError.yaml index 9b88732a29..ce0b9bf391 100644 --- a/ext/openAPI/components/schemas/errors/datahub/IllegalTransitionValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/IllegalEventTransitionValidationError.yaml @@ -7,16 +7,16 @@ allOf: description: The event name. fromState: type: string - description: The from state. + description: The event from state. id: type: string - description: The id. + description: The event id. path: type: string description: The path. toState: type: string - description: The to state. + description: The event to state. required: - event - fromState diff --git a/ext/openAPI/components/schemas/errors/datahub/IllegalFunctionValidationError.yaml b/ext/openAPI/components/schemas/errors/datahub/IllegalFunctionValidationError.yaml index 8ba52834c6..16e9993ecb 100644 --- a/ext/openAPI/components/schemas/errors/datahub/IllegalFunctionValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/IllegalFunctionValidationError.yaml @@ -13,7 +13,8 @@ allOf: description: The error message. path: type: string - description: The path. + format: json-path + description: The json path. required: - event - id diff --git a/ext/openAPI/components/schemas/errors/datahub/InvalidFunctionOrderValidationError.yaml b/ext/openAPI/components/schemas/errors/datahub/InvalidFunctionOrderValidationError.yaml index ea5adab888..238c0e537e 100644 --- a/ext/openAPI/components/schemas/errors/datahub/InvalidFunctionOrderValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/InvalidFunctionOrderValidationError.yaml @@ -2,16 +2,17 @@ allOf: - $ref: "../validation/ValidationError.yaml" - type: object properties: - field: - type: string - description: The field. function: type: string description: The function. + path: + type: string + format: json-path + description: The json path. previousFunction: type: string description: The previous function. required: - - field - function + - path - previousFunction diff --git a/ext/openAPI/components/schemas/errors/datahub/TopicFilterMismatchError.yaml b/ext/openAPI/components/schemas/errors/datahub/TopicFilterMismatchError.yaml index 03103cc778..5b8209b20e 100644 --- a/ext/openAPI/components/schemas/errors/datahub/TopicFilterMismatchError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/TopicFilterMismatchError.yaml @@ -5,8 +5,8 @@ allOf: message: type: string description: The error message. - parameter: + path: type: string - description: The parameter. + description: The json path of the topic filter. required: - - parameter + - path diff --git a/ext/openAPI/components/schemas/errors/validation/AtLeastOneFieldMissingValidationError.yaml b/ext/openAPI/components/schemas/errors/validation/AtLeastOneFieldMissingValidationError.yaml index b6b61d395a..2670385dfd 100644 --- a/ext/openAPI/components/schemas/errors/validation/AtLeastOneFieldMissingValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/validation/AtLeastOneFieldMissingValidationError.yaml @@ -2,10 +2,12 @@ allOf: - $ref: "./ValidationError.yaml" - type: object properties: - fields: + paths: type: array - description: The missing fields. + description: The missing json paths. items: type: string + format: json-path + description: The json path. required: - - fields + - paths diff --git a/ext/openAPI/components/schemas/errors/validation/EmptyFieldValidationError.yaml b/ext/openAPI/components/schemas/errors/validation/EmptyFieldValidationError.yaml index d37e184cd3..bf904d5176 100644 --- a/ext/openAPI/components/schemas/errors/validation/EmptyFieldValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/validation/EmptyFieldValidationError.yaml @@ -2,8 +2,9 @@ allOf: - $ref: "./ValidationError.yaml" - type: object properties: - field: + path: type: string + format: json-path description: The missing field. required: - - field + - path diff --git a/ext/openAPI/components/schemas/errors/validation/InvalidFieldLengthValidationError.yaml b/ext/openAPI/components/schemas/errors/validation/InvalidFieldLengthValidationError.yaml index 1ea6096d7e..b819dba342 100644 --- a/ext/openAPI/components/schemas/errors/validation/InvalidFieldLengthValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/validation/InvalidFieldLengthValidationError.yaml @@ -14,9 +14,10 @@ allOf: type: integer format: int32 description: The maximum length expected for the field value. - field: + path: type: string - description: The invalid field. + format: json-path + description: The invalid json path. value: type: string description: The invalid value. @@ -24,5 +25,5 @@ allOf: - actualLength - expectedMinimumLength - expectedMaximumLength - - field + - path - value diff --git a/ext/openAPI/components/schemas/errors/validation/InvalidFieldValueValidationError.yaml b/ext/openAPI/components/schemas/errors/validation/InvalidFieldValueValidationError.yaml index f9dd044216..fb3b1384fa 100644 --- a/ext/openAPI/components/schemas/errors/validation/InvalidFieldValueValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/validation/InvalidFieldValueValidationError.yaml @@ -2,12 +2,13 @@ allOf: - $ref: "./ValidationError.yaml" - type: object properties: - field: + path: type: string - description: The invalid field. + format: json-path + description: The invalid json path. value: type: string description: The invalid value. required: - - field + - path - value diff --git a/ext/openAPI/components/schemas/errors/validation/InvalidIdentifierValidationError.yaml b/ext/openAPI/components/schemas/errors/validation/InvalidIdentifierValidationError.yaml index 621fdbd3eb..792dc493db 100644 --- a/ext/openAPI/components/schemas/errors/validation/InvalidIdentifierValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/validation/InvalidIdentifierValidationError.yaml @@ -2,12 +2,13 @@ allOf: - $ref: "./ValidationError.yaml" - type: object properties: - field: + path: type: string - description: The invalid identifier field. + format: json-path + description: The invalid identifier path. value: type: string description: The invalid identifier value. required: - - field + - path - value diff --git a/ext/openAPI/components/schemas/errors/validation/MissingFieldValidationError.yaml b/ext/openAPI/components/schemas/errors/validation/MissingFieldValidationError.yaml index d37e184cd3..94ddef88c3 100644 --- a/ext/openAPI/components/schemas/errors/validation/MissingFieldValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/validation/MissingFieldValidationError.yaml @@ -2,8 +2,9 @@ allOf: - $ref: "./ValidationError.yaml" - type: object properties: - field: + path: type: string - description: The missing field. + format: json-path + description: The missing path. required: - - field + - path diff --git a/ext/openAPI/components/schemas/errors/validation/UnsupportedFieldValidationError.yaml b/ext/openAPI/components/schemas/errors/validation/UnsupportedFieldValidationError.yaml index 18d411dbd4..3a160152fa 100644 --- a/ext/openAPI/components/schemas/errors/validation/UnsupportedFieldValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/validation/UnsupportedFieldValidationError.yaml @@ -8,10 +8,11 @@ allOf: expectedValue: type: string description: The expected value. - field: + path: type: string - description: The field. + format: json-path + description: The json path. required: - actualValue - expectedValue - - field + - path diff --git a/ext/openAPI/components/schemas/errors/validation/ValidationError.yaml b/ext/openAPI/components/schemas/errors/validation/ValidationError.yaml index 516d9b2c5d..cc608814cf 100644 --- a/ext/openAPI/components/schemas/errors/validation/ValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/validation/ValidationError.yaml @@ -18,8 +18,8 @@ discriminator: https://hivemq.com/edge/api/model/EmptyFieldValidationError: "./EmptyFieldValidationError.yaml" https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError: "../datahub/FunctionMustBePairedValidationError.yaml" https://hivemq.com/edge/api/model/GeneralPolicyValidationError: "../datahub/GeneralPolicyValidationError.yaml" + https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError: "../datahub/IllegalEventTransitionValidationError.yaml" https://hivemq.com/edge/api/model/IllegalFunctionValidationError: "../datahub/IllegalFunctionValidationError.yaml" - https://hivemq.com/edge/api/model/IllegalTransitionValidationError: "../datahub/IllegalTransitionValidationError.yaml" https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: "./InvalidFieldLengthValidationError.yaml" https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: "./InvalidFieldValueValidationError.yaml" https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError: "../datahub/InvalidFunctionOrderValidationError.yaml" diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies.yaml index c3f6386cd4..c3f3d52617 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies.yaml @@ -180,7 +180,7 @@ get: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: "../components/schemas/errors/http/InvalidQueryParameterError.yaml" @@ -189,7 +189,7 @@ get: description: URL parameter missing '503': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable @@ -277,7 +277,7 @@ post: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: "../components/schemas/errors/http/RequestBodyMissingError.yaml" @@ -289,25 +289,25 @@ post: description: Policy creation failed '409': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/datahub/BehaviorPolicyAlreadyPresentError.yaml" description: Behavior policy already present '500': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal server error '503': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable '507': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/InsufficientStorageError.yaml" description: Insufficient storage diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies_{policyId}.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies_{policyId}.yaml index 78d647e7e9..7f22497788 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies_{policyId}.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies_{policyId}.yaml @@ -23,7 +23,7 @@ delete: description: Success, no response body '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: "../components/schemas/errors/http/UrlParameterMissingError.yaml" @@ -32,25 +32,25 @@ delete: description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/datahub/PolicyNotFoundError.yaml" description: Behavior policy not found '412': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/PreconditionFailedError.yaml" description: Precondition failed '500': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal server error '503': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable @@ -124,7 +124,7 @@ get: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: "../components/schemas/errors/http/UrlParameterMissingError.yaml" @@ -133,19 +133,19 @@ get: description: Bad request '404': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/datahub/BehaviorPolicyNotFoundError.yaml" description: Policy not found '500': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal server error '503': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable @@ -251,7 +251,7 @@ put: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: "../components/schemas/errors/http/RequestBodyMissingError.yaml" @@ -263,31 +263,31 @@ put: description: Behavior policy creation failed '404': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/datahub/BehaviorPolicyNotFoundError.yaml" description: Data policy not found '412': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/PreconditionFailedError.yaml" description: Precondition failed '500': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal server error '503': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable '507': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/InsufficientStorageError.yaml" description: Insufficient storage diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_states_{clientId}.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_states_{clientId}.yaml index 9d3a726e75..5fe856e523 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_states_{clientId}.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_states_{clientId}.yaml @@ -38,7 +38,7 @@ get: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: "../components/schemas/errors/http/UrlParameterMissingError.yaml" @@ -47,7 +47,7 @@ get: description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: oneOf: - $ref: "../components/schemas/errors/datahub/ClientDisconnectedError.yaml" @@ -57,7 +57,7 @@ get: description: Client error '500': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal server error diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml index e4c6a0f8f8..e43355a153 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml @@ -285,7 +285,7 @@ get: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: "../components/schemas/errors/http/InvalidQueryParameterError.yaml" @@ -294,7 +294,7 @@ get: description: URL parameter missing '503': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable @@ -388,7 +388,7 @@ post: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: "../components/schemas/errors/http/RequestBodyMissingError.yaml" @@ -400,25 +400,25 @@ post: description: Data policy creation failed '409': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/datahub/DataPolicyAlreadyPresentError.yaml" description: Data policy already present '500': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal server error '503': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable '507': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/InsufficientStorageError.yaml" description: Insufficient storage diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml index 4427b53a05..d0e12fc5d4 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml @@ -23,7 +23,7 @@ delete: description: Success, no response body '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: "../components/schemas/errors/http/UrlParameterMissingError.yaml" @@ -32,25 +32,25 @@ delete: description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/datahub/PolicyNotFoundError.yaml" description: Data policy not found '412': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/PreconditionFailedError.yaml" description: Precondition failed '500': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal server error '503': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable @@ -127,7 +127,7 @@ get: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: "../components/schemas/errors/http/UrlParameterMissingError.yaml" @@ -136,19 +136,19 @@ get: description: Bad request '404': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/datahub/PolicyNotFoundError.yaml" description: Resource not found '500': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal server error '503': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable @@ -261,7 +261,7 @@ put: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: "../components/schemas/errors/http/RequestBodyMissingError.yaml" @@ -276,31 +276,31 @@ put: description: Data policy creation failed '404': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/datahub/DataPolicyNotFoundError.yaml" description: Data policy not found '412': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/PreconditionFailedError.yaml" description: Precondition failed '500': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal server error '503': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable '507': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/InsufficientStorageError.yaml" description: Insufficient storage diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_fsm.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_fsm.yaml index c0a3ae08dd..5f2c3de41d 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_fsm.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_fsm.yaml @@ -90,7 +90,7 @@ get: description: Success '500': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal server error diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_function-specs.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_function-specs.yaml index 0b94ed4ee9..dfefb62682 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_function-specs.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_function-specs.yaml @@ -12,7 +12,7 @@ get: description: Success '500': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal server error diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_functions.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_functions.yaml index 1d2adc52bf..a7037eae9c 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_functions.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_functions.yaml @@ -185,7 +185,7 @@ get: description: Success '500': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal server error diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas.yaml index 4352d66de4..be73badf02 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas.yaml @@ -153,7 +153,7 @@ get: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: "../components/schemas/errors/http/InvalidQueryParameterError.yaml" @@ -162,7 +162,7 @@ get: description: URL parameter missing '503': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable @@ -213,7 +213,7 @@ post: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: "../components/schemas/errors/http/RequestBodyParameterMissingError.yaml" @@ -224,31 +224,31 @@ post: description: Schema creation failed '409': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/datahub/SchemaAlreadyPresentError.yaml" description: Schema is already present '412': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/datahub/SchemaEtagMismatchError.yaml" description: Schema doesn't match etag '500': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal server error '503': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable '507': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/InsufficientStorageError.yaml" description: Insufficient storage diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas_{schemaId}.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas_{schemaId}.yaml index 8ba9ff4c71..9edd5855e4 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas_{schemaId}.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas_{schemaId}.yaml @@ -23,7 +23,7 @@ delete: description: Success, no response body '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: "../components/schemas/errors/http/UrlParameterMissingError.yaml" @@ -33,25 +33,25 @@ delete: description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/datahub/SchemaNotFoundError.yaml" description: Schema not found '412': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/datahub/SchemaEtagMismatchError.yaml" description: Schema doesn't match etag '500': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal Server error '503': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable @@ -102,7 +102,7 @@ get: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: "../components/schemas/errors/http/UrlParameterMissingError.yaml" @@ -111,19 +111,19 @@ get: description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/datahub/SchemaNotFoundError.yaml" description: Schema not found '500': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal server error '503': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts.yaml index a9d905283c..22ec571514 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts.yaml @@ -140,7 +140,7 @@ get: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: "../components/schemas/errors/http/InvalidQueryParameterError.yaml" @@ -149,7 +149,7 @@ get: description: URL parameter missing '503': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable @@ -200,7 +200,7 @@ post: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: "../components/schemas/errors/http/RequestBodyParameterMissingError.yaml" @@ -213,31 +213,31 @@ post: description: Script creation failed '409': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/datahub/ScriptAlreadyPresentError.yaml" description: Script is already present '412': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/datahub/ScriptEtagMismatchError.yaml" description: Script doesn't match etag '500': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal server error '503': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable '507': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/InsufficientStorageError.yaml" description: Insufficient storage diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts_{scriptId}.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts_{scriptId}.yaml index 3a21f0d86d..5a10c3172d 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts_{scriptId}.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts_{scriptId}.yaml @@ -20,7 +20,7 @@ delete: description: Success, no response body '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: "../components/schemas/errors/http/UrlParameterMissingError.yaml" @@ -30,25 +30,25 @@ delete: description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/datahub/ScriptNotFoundError.yaml" description: Script not found '412': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/datahub/ScriptEtagMismatchError.yaml" description: Script doesn't match etag '500': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal Server error '503': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable @@ -95,7 +95,7 @@ get: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: "../components/schemas/errors/http/UrlParameterMissingError.yaml" @@ -104,19 +104,19 @@ get: description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/datahub/ScriptNotFoundError.yaml" description: Script not found '500': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal Server error '503': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/ValidationErrorFactory.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/ValidationErrorFactory.java index dc3da79810..14b6428c2e 100644 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/ValidationErrorFactory.java +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/ValidationErrorFactory.java @@ -30,23 +30,23 @@ private ValidationErrorFactory() { } public static @NotNull EmptyFieldValidationError emptyFieldValidationError( - final @NotNull String field) { - return emptyFieldValidationError("Required field '" + field + "' is empty", field); + final @NotNull String path) { + return emptyFieldValidationError("Required field '" + path + "' is empty", path); } public static @NotNull EmptyFieldValidationError emptyFieldValidationError( final @NotNull String detail, - final @NotNull String field) { + final @NotNull String path) { return EmptyFieldValidationError.builder() .type(type(EmptyFieldValidationError.class)) .detail(detail) - .field(field) + .path(path) .build(); } public static @NotNull InvalidFieldLengthValidationError invalidFieldLengthValidationError( final @NotNull String detail, - final @NotNull String field, + final @NotNull String path, final @NotNull String value, final int actualLength, final int expectedMinimumLength, @@ -54,7 +54,7 @@ private ValidationErrorFactory() { return InvalidFieldLengthValidationError.builder() .type(type(InvalidFieldLengthValidationError.class)) .detail(detail) - .field(field) + .path(path) .value(value) .actualLength(actualLength) .expectedMinimumLength(expectedMinimumLength) @@ -64,89 +64,89 @@ private ValidationErrorFactory() { public static @NotNull InvalidFieldValueValidationError invalidFieldValueValidationError( final @NotNull String detail, - final @NotNull String field, + final @NotNull String path, final @NotNull String value) { return InvalidFieldValueValidationError.builder() .type(type(InvalidFieldValueValidationError.class)) .detail(detail) - .field(field) + .path(path) .value(value) .build(); } public static @NotNull InvalidIdentifierValidationError invalidIdentifierValidationError( - final @NotNull String field, + final @NotNull String path, final @NotNull String value) { return invalidIdentifierValidationError("Identifier " + - field + + path + " must begin with a letter and may only consist of lowercase letters," + - " uppercase letters, numbers, periods, hyphens, and underscores", field, value); + " uppercase letters, numbers, periods, hyphens, and underscores", path, value); } public static @NotNull InvalidIdentifierValidationError invalidIdentifierValidationError( final @NotNull String detail, - final @NotNull String field, + final @NotNull String path, final @NotNull String value) { return InvalidIdentifierValidationError.builder() .type(type(InvalidIdentifierValidationError.class)) .detail(detail) - .field(field) + .path(path) .value(value) .build(); } public static @NotNull MissingFieldValidationError missingFieldValidationError( - final @NotNull String field) { - return missingFieldValidationError("Required field '" + field + "' is missing.", field); + final @NotNull String path) { + return missingFieldValidationError("Required field '" + path + "' is missing.", path); } public static @NotNull MissingFieldValidationError missingFieldValidationError( final @NotNull String detail, - final @NotNull String field) { + final @NotNull String path) { return MissingFieldValidationError.builder() .type(type(MissingFieldValidationError.class)) .detail(detail) - .field(field) + .path(path) .build(); } public static @NotNull UnsupportedFieldValidationError unsupportedFieldValidationError( final @NotNull String detail, - final @NotNull String field, + final @NotNull String path, final @NotNull String actualValue, final @NotNull String expectedValue) { return UnsupportedFieldValidationError.builder() .type(type(UnsupportedFieldValidationError.class)) .detail(detail) - .field(field) + .path(path) .actualValue(actualValue) .expectedValue(expectedValue) .build(); } public static @NotNull UnsupportedFieldValidationError unsupportedFieldValidationErrorByType( - final @NotNull String field, + final @NotNull String path, final @NotNull String actualType, final @NotNull String expectedType) { return unsupportedFieldValidationError("Unsupported type '" + actualType + " for field '" + - field + + path + "'. Expected type is '" + expectedType + - "'.", field, actualType, expectedType); + "'.", path, actualType, expectedType); } public static @NotNull UnsupportedFieldValidationError unsupportedFieldValidationErrorByValue( - final @NotNull String field, + final @NotNull String path, final @NotNull String actualValue, final @NotNull String expectedValue) { return unsupportedFieldValidationError("Unsupported value '" + actualValue + " for field '" + - field + + path + "'. Expected value is '" + expectedValue + - "'.", field, actualValue, expectedValue); + "'.", path, actualValue, expectedValue); } } From 6922326fc79df8bfb8628a8d5e0d0c5b0a37757c Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Fri, 6 Jun 2025 09:59:06 +0200 Subject: [PATCH 045/121] fix: Revert application/problem+json to application/json --- ext/hivemq-edge-openapi-2025.9.yaml | 168 +++++++++--------- ...data-hub_behavior-validation_policies.yaml | 14 +- ...havior-validation_policies_{policyId}.yaml | 30 ++-- ...behavior-validation_states_{clientId}.yaml | 6 +- ..._v1_data-hub_data-validation_policies.yaml | 14 +- ...b_data-validation_policies_{policyId}.yaml | 30 ++-- .../openapi/paths/api_v1_data-hub_fsm.yaml | 2 +- .../paths/api_v1_data-hub_function-specs.yaml | 2 +- .../paths/api_v1_data-hub_functions.yaml | 2 +- .../paths/api_v1_data-hub_schemas.yaml | 16 +- .../api_v1_data-hub_schemas_{schemaId}.yaml | 18 +- .../paths/api_v1_data-hub_scripts.yaml | 16 +- .../api_v1_data-hub_scripts_{scriptId}.yaml | 18 +- 13 files changed, 168 insertions(+), 168 deletions(-) diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index 135e80c95b..1231ac3f3d 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -354,7 +354,7 @@ paths: description: Success '400': content: - application/problem+json: + application/json: schema: oneOf: - $ref: '#/components/schemas/InvalidQueryParameterError' @@ -363,7 +363,7 @@ paths: description: URL parameter missing '503': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable @@ -451,7 +451,7 @@ paths: description: Success '400': content: - application/problem+json: + application/json: schema: oneOf: - $ref: '#/components/schemas/RequestBodyMissingError' @@ -463,25 +463,25 @@ paths: description: Policy creation failed '409': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/BehaviorPolicyAlreadyPresentError' description: Behavior policy already present '500': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable '507': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/InsufficientStorageError' description: Insufficient storage @@ -514,7 +514,7 @@ paths: description: Success, no response body '400': content: - application/problem+json: + application/json: schema: oneOf: - $ref: '#/components/schemas/UrlParameterMissingError' @@ -523,25 +523,25 @@ paths: description: URL parameter missing '404': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/PolicyNotFoundError' description: Behavior policy not found '412': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/PreconditionFailedError' description: Precondition failed '500': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable @@ -612,7 +612,7 @@ paths: description: Success '400': content: - application/problem+json: + application/json: schema: oneOf: - $ref: '#/components/schemas/UrlParameterMissingError' @@ -621,19 +621,19 @@ paths: description: Bad request '404': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/BehaviorPolicyNotFoundError' description: Policy not found '500': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable @@ -737,7 +737,7 @@ paths: description: Success '400': content: - application/problem+json: + application/json: schema: oneOf: - $ref: '#/components/schemas/RequestBodyMissingError' @@ -749,31 +749,31 @@ paths: description: Behavior policy creation failed '404': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/BehaviorPolicyNotFoundError' description: Data policy not found '412': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/PreconditionFailedError' description: Precondition failed '500': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable '507': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/InsufficientStorageError' description: Insufficient storage @@ -821,7 +821,7 @@ paths: description: Success '400': content: - application/problem+json: + application/json: schema: oneOf: - $ref: '#/components/schemas/UrlParameterMissingError' @@ -830,7 +830,7 @@ paths: description: URL parameter missing '404': content: - application/problem+json: + application/json: schema: oneOf: - $ref: '#/components/schemas/ClientDisconnectedError' @@ -840,7 +840,7 @@ paths: description: Client error '500': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/InternalServerError' description: Internal server error @@ -1092,7 +1092,7 @@ paths: description: Success '400': content: - application/problem+json: + application/json: schema: oneOf: - $ref: '#/components/schemas/InvalidQueryParameterError' @@ -1101,7 +1101,7 @@ paths: description: URL parameter missing '503': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable @@ -1187,7 +1187,7 @@ paths: description: Success '400': content: - application/problem+json: + application/json: schema: oneOf: - $ref: '#/components/schemas/RequestBodyMissingError' @@ -1199,25 +1199,25 @@ paths: description: Data policy creation failed '409': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/DataPolicyAlreadyPresentError' description: Data policy already present '500': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable '507': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/InsufficientStorageError' description: Insufficient storage @@ -1250,7 +1250,7 @@ paths: description: Success, no response body '400': content: - application/problem+json: + application/json: schema: oneOf: - $ref: '#/components/schemas/UrlParameterMissingError' @@ -1259,25 +1259,25 @@ paths: description: URL parameter missing '404': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/PolicyNotFoundError' description: Data policy not found '412': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/PreconditionFailedError' description: Precondition failed '500': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable @@ -1347,7 +1347,7 @@ paths: description: Success '400': content: - application/problem+json: + application/json: schema: oneOf: - $ref: '#/components/schemas/UrlParameterMissingError' @@ -1356,19 +1356,19 @@ paths: description: Bad request '404': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/PolicyNotFoundError' description: Resource not found '500': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable @@ -1471,7 +1471,7 @@ paths: description: Success '400': content: - application/problem+json: + application/json: schema: oneOf: - $ref: '#/components/schemas/RequestBodyMissingError' @@ -1486,31 +1486,31 @@ paths: description: Data policy creation failed '404': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/DataPolicyNotFoundError' description: Data policy not found '412': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/PreconditionFailedError' description: Precondition failed '500': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable '507': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/InsufficientStorageError' description: Insufficient storage @@ -1598,7 +1598,7 @@ paths: description: Success '500': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/InternalServerError' description: Internal server error @@ -1760,7 +1760,7 @@ paths: description: Success '500': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/InternalServerError' description: Internal server error @@ -1780,7 +1780,7 @@ paths: description: Success '500': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/InternalServerError' description: Internal server error @@ -1919,7 +1919,7 @@ paths: description: Success '400': content: - application/problem+json: + application/json: schema: oneOf: - $ref: '#/components/schemas/InvalidQueryParameterError' @@ -1928,7 +1928,7 @@ paths: description: URL parameter missing '503': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable @@ -1977,7 +1977,7 @@ paths: description: Success '400': content: - application/problem+json: + application/json: schema: oneOf: - $ref: '#/components/schemas/RequestBodyParameterMissingError' @@ -1988,31 +1988,31 @@ paths: description: Schema creation failed '409': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/SchemaAlreadyPresentError' description: Schema is already present '412': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/SchemaEtagMismatchError' description: Schema doesn't match etag '500': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable '507': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/InsufficientStorageError' description: Insufficient storage @@ -2045,7 +2045,7 @@ paths: description: Success, no response body '400': content: - application/problem+json: + application/json: schema: oneOf: - $ref: '#/components/schemas/UrlParameterMissingError' @@ -2055,25 +2055,25 @@ paths: description: URL parameter missing '404': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/SchemaNotFoundError' description: Schema not found '412': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/SchemaEtagMismatchError' description: Schema doesn't match etag '500': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/InternalServerError' description: Internal Server error '503': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable @@ -2121,7 +2121,7 @@ paths: description: Success '400': content: - application/problem+json: + application/json: schema: oneOf: - $ref: '#/components/schemas/UrlParameterMissingError' @@ -2130,19 +2130,19 @@ paths: description: URL parameter missing '404': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/SchemaNotFoundError' description: Schema not found '500': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable @@ -2268,7 +2268,7 @@ paths: description: Success '400': content: - application/problem+json: + application/json: schema: oneOf: - $ref: '#/components/schemas/InvalidQueryParameterError' @@ -2277,7 +2277,7 @@ paths: description: URL parameter missing '503': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable @@ -2326,7 +2326,7 @@ paths: description: Success '400': content: - application/problem+json: + application/json: schema: oneOf: - $ref: '#/components/schemas/RequestBodyParameterMissingError' @@ -2339,31 +2339,31 @@ paths: description: Script creation failed '409': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/ScriptAlreadyPresentError' description: Script is already present '412': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/ScriptEtagMismatchError' description: Script doesn't match etag '500': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable '507': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/InsufficientStorageError' description: Insufficient storage @@ -2393,7 +2393,7 @@ paths: description: Success, no response body '400': content: - application/problem+json: + application/json: schema: oneOf: - $ref: '#/components/schemas/UrlParameterMissingError' @@ -2403,25 +2403,25 @@ paths: description: URL parameter missing '404': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/ScriptNotFoundError' description: Script not found '412': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/ScriptEtagMismatchError' description: Script doesn't match etag '500': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/InternalServerError' description: Internal Server error '503': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable @@ -2465,7 +2465,7 @@ paths: description: Success '400': content: - application/problem+json: + application/json: schema: oneOf: - $ref: '#/components/schemas/UrlParameterMissingError' @@ -2474,19 +2474,19 @@ paths: description: URL parameter missing '404': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/ScriptNotFoundError' description: Script not found '500': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/InternalServerError' description: Internal Server error '503': content: - application/problem+json: + application/json: schema: $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies.yaml index c3f3d52617..c3f6386cd4 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies.yaml @@ -180,7 +180,7 @@ get: description: Success '400': content: - application/problem+json: + application/json: schema: oneOf: - $ref: "../components/schemas/errors/http/InvalidQueryParameterError.yaml" @@ -189,7 +189,7 @@ get: description: URL parameter missing '503': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable @@ -277,7 +277,7 @@ post: description: Success '400': content: - application/problem+json: + application/json: schema: oneOf: - $ref: "../components/schemas/errors/http/RequestBodyMissingError.yaml" @@ -289,25 +289,25 @@ post: description: Policy creation failed '409': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/datahub/BehaviorPolicyAlreadyPresentError.yaml" description: Behavior policy already present '500': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal server error '503': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable '507': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/http/InsufficientStorageError.yaml" description: Insufficient storage diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies_{policyId}.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies_{policyId}.yaml index 7f22497788..78d647e7e9 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies_{policyId}.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies_{policyId}.yaml @@ -23,7 +23,7 @@ delete: description: Success, no response body '400': content: - application/problem+json: + application/json: schema: oneOf: - $ref: "../components/schemas/errors/http/UrlParameterMissingError.yaml" @@ -32,25 +32,25 @@ delete: description: URL parameter missing '404': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/datahub/PolicyNotFoundError.yaml" description: Behavior policy not found '412': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/http/PreconditionFailedError.yaml" description: Precondition failed '500': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal server error '503': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable @@ -124,7 +124,7 @@ get: description: Success '400': content: - application/problem+json: + application/json: schema: oneOf: - $ref: "../components/schemas/errors/http/UrlParameterMissingError.yaml" @@ -133,19 +133,19 @@ get: description: Bad request '404': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/datahub/BehaviorPolicyNotFoundError.yaml" description: Policy not found '500': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal server error '503': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable @@ -251,7 +251,7 @@ put: description: Success '400': content: - application/problem+json: + application/json: schema: oneOf: - $ref: "../components/schemas/errors/http/RequestBodyMissingError.yaml" @@ -263,31 +263,31 @@ put: description: Behavior policy creation failed '404': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/datahub/BehaviorPolicyNotFoundError.yaml" description: Data policy not found '412': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/http/PreconditionFailedError.yaml" description: Precondition failed '500': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal server error '503': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable '507': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/http/InsufficientStorageError.yaml" description: Insufficient storage diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_states_{clientId}.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_states_{clientId}.yaml index 5fe856e523..9d3a726e75 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_states_{clientId}.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_states_{clientId}.yaml @@ -38,7 +38,7 @@ get: description: Success '400': content: - application/problem+json: + application/json: schema: oneOf: - $ref: "../components/schemas/errors/http/UrlParameterMissingError.yaml" @@ -47,7 +47,7 @@ get: description: URL parameter missing '404': content: - application/problem+json: + application/json: schema: oneOf: - $ref: "../components/schemas/errors/datahub/ClientDisconnectedError.yaml" @@ -57,7 +57,7 @@ get: description: Client error '500': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal server error diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml index e43355a153..e4c6a0f8f8 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml @@ -285,7 +285,7 @@ get: description: Success '400': content: - application/problem+json: + application/json: schema: oneOf: - $ref: "../components/schemas/errors/http/InvalidQueryParameterError.yaml" @@ -294,7 +294,7 @@ get: description: URL parameter missing '503': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable @@ -388,7 +388,7 @@ post: description: Success '400': content: - application/problem+json: + application/json: schema: oneOf: - $ref: "../components/schemas/errors/http/RequestBodyMissingError.yaml" @@ -400,25 +400,25 @@ post: description: Data policy creation failed '409': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/datahub/DataPolicyAlreadyPresentError.yaml" description: Data policy already present '500': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal server error '503': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable '507': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/http/InsufficientStorageError.yaml" description: Insufficient storage diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml index d0e12fc5d4..4427b53a05 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml @@ -23,7 +23,7 @@ delete: description: Success, no response body '400': content: - application/problem+json: + application/json: schema: oneOf: - $ref: "../components/schemas/errors/http/UrlParameterMissingError.yaml" @@ -32,25 +32,25 @@ delete: description: URL parameter missing '404': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/datahub/PolicyNotFoundError.yaml" description: Data policy not found '412': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/http/PreconditionFailedError.yaml" description: Precondition failed '500': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal server error '503': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable @@ -127,7 +127,7 @@ get: description: Success '400': content: - application/problem+json: + application/json: schema: oneOf: - $ref: "../components/schemas/errors/http/UrlParameterMissingError.yaml" @@ -136,19 +136,19 @@ get: description: Bad request '404': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/datahub/PolicyNotFoundError.yaml" description: Resource not found '500': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal server error '503': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable @@ -261,7 +261,7 @@ put: description: Success '400': content: - application/problem+json: + application/json: schema: oneOf: - $ref: "../components/schemas/errors/http/RequestBodyMissingError.yaml" @@ -276,31 +276,31 @@ put: description: Data policy creation failed '404': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/datahub/DataPolicyNotFoundError.yaml" description: Data policy not found '412': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/http/PreconditionFailedError.yaml" description: Precondition failed '500': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal server error '503': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable '507': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/http/InsufficientStorageError.yaml" description: Insufficient storage diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_fsm.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_fsm.yaml index 5f2c3de41d..c0a3ae08dd 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_fsm.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_fsm.yaml @@ -90,7 +90,7 @@ get: description: Success '500': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal server error diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_function-specs.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_function-specs.yaml index dfefb62682..0b94ed4ee9 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_function-specs.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_function-specs.yaml @@ -12,7 +12,7 @@ get: description: Success '500': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal server error diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_functions.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_functions.yaml index a7037eae9c..1d2adc52bf 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_functions.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_functions.yaml @@ -185,7 +185,7 @@ get: description: Success '500': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal server error diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas.yaml index be73badf02..4352d66de4 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas.yaml @@ -153,7 +153,7 @@ get: description: Success '400': content: - application/problem+json: + application/json: schema: oneOf: - $ref: "../components/schemas/errors/http/InvalidQueryParameterError.yaml" @@ -162,7 +162,7 @@ get: description: URL parameter missing '503': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable @@ -213,7 +213,7 @@ post: description: Success '400': content: - application/problem+json: + application/json: schema: oneOf: - $ref: "../components/schemas/errors/http/RequestBodyParameterMissingError.yaml" @@ -224,31 +224,31 @@ post: description: Schema creation failed '409': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/datahub/SchemaAlreadyPresentError.yaml" description: Schema is already present '412': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/datahub/SchemaEtagMismatchError.yaml" description: Schema doesn't match etag '500': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal server error '503': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable '507': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/http/InsufficientStorageError.yaml" description: Insufficient storage diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas_{schemaId}.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas_{schemaId}.yaml index 9edd5855e4..8ba9ff4c71 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas_{schemaId}.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas_{schemaId}.yaml @@ -23,7 +23,7 @@ delete: description: Success, no response body '400': content: - application/problem+json: + application/json: schema: oneOf: - $ref: "../components/schemas/errors/http/UrlParameterMissingError.yaml" @@ -33,25 +33,25 @@ delete: description: URL parameter missing '404': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/datahub/SchemaNotFoundError.yaml" description: Schema not found '412': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/datahub/SchemaEtagMismatchError.yaml" description: Schema doesn't match etag '500': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal Server error '503': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable @@ -102,7 +102,7 @@ get: description: Success '400': content: - application/problem+json: + application/json: schema: oneOf: - $ref: "../components/schemas/errors/http/UrlParameterMissingError.yaml" @@ -111,19 +111,19 @@ get: description: URL parameter missing '404': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/datahub/SchemaNotFoundError.yaml" description: Schema not found '500': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal server error '503': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts.yaml index 22ec571514..a9d905283c 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts.yaml @@ -140,7 +140,7 @@ get: description: Success '400': content: - application/problem+json: + application/json: schema: oneOf: - $ref: "../components/schemas/errors/http/InvalidQueryParameterError.yaml" @@ -149,7 +149,7 @@ get: description: URL parameter missing '503': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable @@ -200,7 +200,7 @@ post: description: Success '400': content: - application/problem+json: + application/json: schema: oneOf: - $ref: "../components/schemas/errors/http/RequestBodyParameterMissingError.yaml" @@ -213,31 +213,31 @@ post: description: Script creation failed '409': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/datahub/ScriptAlreadyPresentError.yaml" description: Script is already present '412': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/datahub/ScriptEtagMismatchError.yaml" description: Script doesn't match etag '500': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal server error '503': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable '507': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/http/InsufficientStorageError.yaml" description: Insufficient storage diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts_{scriptId}.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts_{scriptId}.yaml index 5a10c3172d..3a21f0d86d 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts_{scriptId}.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts_{scriptId}.yaml @@ -20,7 +20,7 @@ delete: description: Success, no response body '400': content: - application/problem+json: + application/json: schema: oneOf: - $ref: "../components/schemas/errors/http/UrlParameterMissingError.yaml" @@ -30,25 +30,25 @@ delete: description: URL parameter missing '404': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/datahub/ScriptNotFoundError.yaml" description: Script not found '412': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/datahub/ScriptEtagMismatchError.yaml" description: Script doesn't match etag '500': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal Server error '503': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable @@ -95,7 +95,7 @@ get: description: Success '400': content: - application/problem+json: + application/json: schema: oneOf: - $ref: "../components/schemas/errors/http/UrlParameterMissingError.yaml" @@ -104,19 +104,19 @@ get: description: URL parameter missing '404': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/datahub/ScriptNotFoundError.yaml" description: Script not found '500': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal Server error '503': content: - application/problem+json: + application/json: schema: $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable From d9159c3a936e1daa8e4ac9fd68d2a49f77797422 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Tue, 10 Jun 2025 10:13:05 +0200 Subject: [PATCH 046/121] feat: Add mapping to datahub API schema responses --- ext/hivemq-edge-openapi-2025.9.yaml | 1032 +++++++++-------- .../components/schemas/errors/ApiError.yaml | 4 + ...data-hub_behavior-validation_policies.yaml | 9 +- ...havior-validation_policies_{policyId}.yaml | 13 + ...behavior-validation_states_{clientId}.yaml | 5 + ..._v1_data-hub_data-validation_policies.yaml | 7 + ...b_data-validation_policies_{policyId}.yaml | 12 + .../paths/api_v1_data-hub_schemas.yaml | 6 + .../api_v1_data-hub_schemas_{schemaId}.yaml | 5 + .../paths/api_v1_data-hub_scripts.yaml | 8 + .../api_v1_data-hub_scripts_{scriptId}.yaml | 5 + 11 files changed, 625 insertions(+), 481 deletions(-) diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index 1231ac3f3d..03331a8703 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -360,6 +360,8 @@ paths: - $ref: '#/components/schemas/InvalidQueryParameterError' discriminator: propertyName: type + mapping: + https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' description: URL parameter missing '503': content: @@ -454,12 +456,17 @@ paths: application/json: schema: oneOf: - - $ref: '#/components/schemas/RequestBodyMissingError' - $ref: '#/components/schemas/BehaviorPolicyCreationFailureError' - $ref: '#/components/schemas/BehaviorPolicyInvalidErrors' - $ref: '#/components/schemas/BehaviorPolicyRejectedError' + - $ref: '#/components/schemas/RequestBodyMissingError' discriminator: propertyName: type + mapping: + https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError: '#/components/schemas/BehaviorPolicyCreationFailureError' + https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors: '#/components/schemas/BehaviorPolicyInvalidErrors' + https://hivemq.com/edge/api/model/BehaviorPolicyRejectedError: '#/components/schemas/BehaviorPolicyRejectedError' + https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' description: Policy creation failed '409': content: @@ -520,6 +527,8 @@ paths: - $ref: '#/components/schemas/UrlParameterMissingError' discriminator: propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' description: URL parameter missing '404': content: @@ -618,6 +627,8 @@ paths: - $ref: '#/components/schemas/UrlParameterMissingError' discriminator: propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' description: Bad request '404': content: @@ -746,6 +757,15 @@ paths: - $ref: '#/components/schemas/BehaviorPolicyInvalidErrors' - $ref: '#/components/schemas/BehaviorPolicyUpdateFailureError' - $ref: '#/components/schemas/PolicyIdMismatchError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError: '#/components/schemas/BehaviorPolicyCreationFailureError' + https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors: '#/components/schemas/BehaviorPolicyInvalidErrors' + https://hivemq.com/edge/api/model/BehaviorPolicyUpdateFailureError: '#/components/schemas/BehaviorPolicyUpdateFailureError' + https://hivemq.com/edge/api/model/PolicyIdMismatchError: '#/components/schemas/PolicyIdMismatchError' description: Behavior policy creation failed '404': content: @@ -827,6 +847,8 @@ paths: - $ref: '#/components/schemas/UrlParameterMissingError' discriminator: propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' description: URL parameter missing '404': content: @@ -837,6 +859,9 @@ paths: - $ref: '#/components/schemas/ClientNotFoundError' discriminator: propertyName: type + mapping: + https://hivemq.com/edge/api/model/ClientDisconnectedError: '#/components/schemas/ClientDisconnectedError' + https://hivemq.com/edge/api/model/ClientNotFoundError: '#/components/schemas/ClientNotFoundError' description: Client error '500': content: @@ -1098,6 +1123,8 @@ paths: - $ref: '#/components/schemas/InvalidQueryParameterError' discriminator: propertyName: type + mapping: + https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' description: URL parameter missing '503': content: @@ -1196,6 +1223,11 @@ paths: - $ref: '#/components/schemas/DataPolicyRejectedError' discriminator: propertyName: type + mapping: + https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' + https://hivemq.com/edge/api/model/DataPolicyCreationFailureError: '#/components/schemas/DataPolicyCreationFailureError' + https://hivemq.com/edge/api/model/DataPolicyInvalidErrors: '#/components/schemas/DataPolicyInvalidErrors' + https://hivemq.com/edge/api/model/DataPolicyRejectedError: '#/components/schemas/DataPolicyRejectedError' description: Data policy creation failed '409': content: @@ -1256,6 +1288,8 @@ paths: - $ref: '#/components/schemas/UrlParameterMissingError' discriminator: propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' description: URL parameter missing '404': content: @@ -1353,6 +1387,8 @@ paths: - $ref: '#/components/schemas/UrlParameterMissingError' discriminator: propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' description: Bad request '404': content: @@ -1483,6 +1519,14 @@ paths: - $ref: '#/components/schemas/TopicFilterMismatchError' discriminator: propertyName: type + mapping: + https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + https://hivemq.com/edge/api/model/DataPolicyCreationFailureError: '#/components/schemas/DataPolicyCreationFailureError' + https://hivemq.com/edge/api/model/DataPolicyInvalidErrors: '#/components/schemas/DataPolicyInvalidErrors' + https://hivemq.com/edge/api/model/DataPolicyUpdateFailureError: '#/components/schemas/DataPolicyUpdateFailureError' + https://hivemq.com/edge/api/model/PolicyIdMismatchError: '#/components/schemas/PolicyIdMismatchError' + https://hivemq.com/edge/api/model/TopicFilterMismatchError: '#/components/schemas/TopicFilterMismatchError' description: Data policy creation failed '404': content: @@ -1925,6 +1969,8 @@ paths: - $ref: '#/components/schemas/InvalidQueryParameterError' discriminator: propertyName: type + mapping: + https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' description: URL parameter missing '503': content: @@ -1985,6 +2031,10 @@ paths: - $ref: '#/components/schemas/SchemaParsingFailureError' discriminator: propertyName: type + mapping: + https://hivemq.com/edge/api/model/RequestBodyParameterMissingError: '#/components/schemas/RequestBodyParameterMissingError' + https://hivemq.com/edge/api/model/SchemaInvalidErrors: '#/components/schemas/SchemaInvalidErrors' + https://hivemq.com/edge/api/model/SchemaParsingFailureError: '#/components/schemas/SchemaParsingFailureError' description: Schema creation failed '409': content: @@ -2052,6 +2102,9 @@ paths: - $ref: '#/components/schemas/SchemaReferencedError' discriminator: propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + https://hivemq.com/edge/api/model/SchemaReferencedError: '#/components/schemas/SchemaReferencedError' description: URL parameter missing '404': content: @@ -2127,6 +2180,8 @@ paths: - $ref: '#/components/schemas/UrlParameterMissingError' discriminator: propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' description: URL parameter missing '404': content: @@ -2274,6 +2329,8 @@ paths: - $ref: '#/components/schemas/InvalidQueryParameterError' discriminator: propertyName: type + mapping: + https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' description: URL parameter missing '503': content: @@ -2336,6 +2393,12 @@ paths: - $ref: '#/components/schemas/ScriptSanitationFailureError' discriminator: propertyName: type + mapping: + https://hivemq.com/edge/api/model/RequestBodyParameterMissingError: '#/components/schemas/RequestBodyParameterMissingError' + https://hivemq.com/edge/api/model/ScriptCreationFailureError: '#/components/schemas/ScriptCreationFailureError' + https://hivemq.com/edge/api/model/ScriptInvalidErrors: '#/components/schemas/ScriptInvalidErrors' + https://hivemq.com/edge/api/model/ScriptParsingFailureError: '#/components/schemas/ScriptParsingFailureError' + https://hivemq.com/edge/api/model/ScriptSanitationFailureError: '#/components/schemas/ScriptSanitationFailureError' description: Script creation failed '409': content: @@ -2400,6 +2463,9 @@ paths: - $ref: '#/components/schemas/ScriptReferencedError' discriminator: propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + https://hivemq.com/edge/api/model/ScriptReferencedError: '#/components/schemas/ScriptReferencedError' description: URL parameter missing '404': content: @@ -2471,6 +2537,8 @@ paths: - $ref: '#/components/schemas/UrlParameterMissingError' discriminator: propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' description: URL parameter missing '404': content: @@ -4777,6 +4845,7 @@ components: mapping: https://hivemq.com/edge/api/model/BehaviorPolicyAlreadyPresentError: '#/components/schemas/BehaviorPolicyAlreadyPresentError' https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError: '#/components/schemas/BehaviorPolicyCreationFailureError' + https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors: '#/components/schemas/BehaviorPolicyInvalidErrors' https://hivemq.com/edge/api/model/BehaviorPolicyNotFoundError: '#/components/schemas/BehaviorPolicyNotFoundError' https://hivemq.com/edge/api/model/BehaviorPolicyRejectedError: '#/components/schemas/BehaviorPolicyRejectedError' https://hivemq.com/edge/api/model/BehaviorPolicyUpdateFailureError: '#/components/schemas/BehaviorPolicyUpdateFailureError' @@ -4784,6 +4853,7 @@ components: https://hivemq.com/edge/api/model/ClientNotFoundError: '#/components/schemas/ClientNotFoundError' https://hivemq.com/edge/api/model/DataPolicyAlreadyPresentError: '#/components/schemas/DataPolicyAlreadyPresentError' https://hivemq.com/edge/api/model/DataPolicyCreationFailureError: '#/components/schemas/DataPolicyCreationFailureError' + https://hivemq.com/edge/api/model/DataPolicyInvalidErrors: '#/components/schemas/DataPolicyInvalidErrors' https://hivemq.com/edge/api/model/DataPolicyNotFoundError: '#/components/schemas/DataPolicyNotFoundError' https://hivemq.com/edge/api/model/DataPolicyRejectedError: '#/components/schemas/DataPolicyRejectedError' https://hivemq.com/edge/api/model/DataPolicyUpdateFailureError: '#/components/schemas/DataPolicyUpdateFailureError' @@ -4791,12 +4861,14 @@ components: https://hivemq.com/edge/api/model/PolicyNotFoundError: '#/components/schemas/PolicyNotFoundError' https://hivemq.com/edge/api/model/SchemaAlreadyPresentError: '#/components/schemas/SchemaAlreadyPresentError' https://hivemq.com/edge/api/model/SchemaEtagMismatchError: '#/components/schemas/SchemaEtagMismatchError' + https://hivemq.com/edge/api/model/SchemaInvalidErrors: '#/components/schemas/SchemaInvalidErrors' https://hivemq.com/edge/api/model/SchemaNotFoundError: '#/components/schemas/SchemaNotFoundError' https://hivemq.com/edge/api/model/SchemaParsingFailureError: '#/components/schemas/SchemaParsingFailureError' https://hivemq.com/edge/api/model/SchemaReferencedError: '#/components/schemas/SchemaReferencedError' https://hivemq.com/edge/api/model/ScriptAlreadyPresentError: '#/components/schemas/ScriptAlreadyPresentError' https://hivemq.com/edge/api/model/ScriptCreationFailureError: '#/components/schemas/ScriptCreationFailureError' https://hivemq.com/edge/api/model/ScriptEtagMismatchError: '#/components/schemas/ScriptEtagMismatchError' + https://hivemq.com/edge/api/model/ScriptInvalidErrors: '#/components/schemas/ScriptInvalidErrors' https://hivemq.com/edge/api/model/ScriptNotFoundError: '#/components/schemas/ScriptNotFoundError' https://hivemq.com/edge/api/model/ScriptParsingFailureError: '#/components/schemas/ScriptParsingFailureError' https://hivemq.com/edge/api/model/ScriptReferencedError: '#/components/schemas/ScriptReferencedError' @@ -4833,241 +4905,383 @@ components: description: The actual reason. required: - reason - BehaviorPolicyNotFoundError: + ValidationError: + type: object + properties: + detail: + type: string + description: Detailed contextual description of the validation error. + type: + type: string + format: uri + description: Type of the validation error. + required: + - detail + - type + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError: '#/components/schemas/AtLeastOneFieldMissingValidationError' + https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError: '#/components/schemas/AtMostOneFunctionValidationError' + https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' + https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError: '#/components/schemas/FunctionMustBePairedValidationError' + https://hivemq.com/edge/api/model/GeneralPolicyValidationError: '#/components/schemas/GeneralPolicyValidationError' + https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError: '#/components/schemas/IllegalEventTransitionValidationError' + https://hivemq.com/edge/api/model/IllegalFunctionValidationError: '#/components/schemas/IllegalFunctionValidationError' + https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' + https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' + https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError: '#/components/schemas/InvalidFunctionOrderValidationError' + https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' + https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' + https://hivemq.com/edge/api/model/UnknownVariableValidationError: '#/components/schemas/UnknownVariableValidationError' + https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' + AtLeastOneFieldMissingValidationError: allOf: - - $ref: '#/components/schemas/ApiError' + - $ref: '#/components/schemas/ValidationError' - type: object properties: - id: - type: string - description: The data policy id. - message: + paths: + type: array + description: The missing json paths. + items: + type: string + format: json-path + description: The json path. + required: + - paths + AtMostOneFunctionValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + function: type: string - description: The error message. + description: The function. + occurrences: + type: integer + format: int32 + description: The occurrences of the function. + paths: + type: array + items: + type: string + format: json-path + description: The json paths where the function occurs. required: - - id - BehaviorPolicyRejectedError: + - function + - occurrences + - paths + EmptyFieldValidationError: allOf: - - $ref: '#/components/schemas/ApiError' - BehaviorPolicyUpdateFailureError: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + path: + type: string + format: json-path + description: The missing field. + required: + - path + FunctionMustBePairedValidationError: allOf: - - $ref: '#/components/schemas/ApiError' + - $ref: '#/components/schemas/ValidationError' - type: object properties: - id: + existingFunction: type: string - description: The ID of the policy that failed to update. - reason: + description: The existing function. + missingFunction: type: string - description: The actual reason. + description: The missing function. required: - - id - ClientDisconnectedError: + - existingFunction + - missingFunction + GeneralPolicyValidationError: allOf: - - $ref: '#/components/schemas/ApiError' + - $ref: '#/components/schemas/ValidationError' - type: object properties: - id: + title: type: string - description: The client id. + description: The title. required: - - id - ClientNotFoundError: + - title + IllegalEventTransitionValidationError: allOf: - - $ref: '#/components/schemas/ApiError' + - $ref: '#/components/schemas/ValidationError' - type: object properties: + event: + type: string + description: The event name. + fromState: + type: string + description: The event from state. id: type: string - description: The client id. + description: The event id. + path: + type: string + description: The path. + toState: + type: string + description: The event to state. required: + - event + - fromState - id - DataPolicyAlreadyPresentError: + - path + - toState + IllegalFunctionValidationError: allOf: - - $ref: '#/components/schemas/ApiError' + - $ref: '#/components/schemas/ValidationError' - type: object properties: + event: + type: string + description: The event name. id: type: string - description: The data policy id. + description: The function id. message: type: string description: The error message. + path: + type: string + format: json-path + description: The json path. required: + - event - id - DataPolicyCreationFailureError: + - message + - path + InvalidFieldLengthValidationError: allOf: - - $ref: '#/components/schemas/ApiError' + - $ref: '#/components/schemas/ValidationError' - type: object properties: - reason: + actualLength: + type: integer + format: int32 + description: The actual length of the field value. + expectedMinimumLength: + type: integer + format: int32 + description: The minimum length expected for the field value. + expectedMaximumLength: + type: integer + format: int32 + description: The maximum length expected for the field value. + path: type: string - description: The actual reason. + format: json-path + description: The invalid json path. + value: + type: string + description: The invalid value. required: - - reason - DataPolicyNotFoundError: + - actualLength + - expectedMinimumLength + - expectedMaximumLength + - path + - value + InvalidFieldValueValidationError: allOf: - - $ref: '#/components/schemas/ApiError' + - $ref: '#/components/schemas/ValidationError' - type: object properties: - id: + path: type: string - description: The data policy id. - message: + format: json-path + description: The invalid json path. + value: type: string - description: The error message. + description: The invalid value. required: - - id - DataPolicyRejectedError: - allOf: - - $ref: '#/components/schemas/ApiError' - DataPolicyUpdateFailureError: + - path + - value + InvalidFunctionOrderValidationError: allOf: - - $ref: '#/components/schemas/ApiError' + - $ref: '#/components/schemas/ValidationError' - type: object properties: - id: + function: type: string - description: The ID of the policy that failed to update. - reason: + description: The function. + path: type: string - description: The actual reason. + format: json-path + description: The json path. + previousFunction: + type: string + description: The previous function. required: - - id - PolicyIdMismatchError: + - function + - path + - previousFunction + InvalidIdentifierValidationError: allOf: - - $ref: '#/components/schemas/ApiError' + - $ref: '#/components/schemas/ValidationError' - type: object properties: - actualId: + path: type: string - description: The actual id. - expectedId: + format: json-path + description: The invalid identifier path. + value: type: string - description: The expected id. + description: The invalid identifier value. required: - - actualId - - expectedId - PolicyNotFoundError: + - path + - value + MissingFieldValidationError: allOf: - - $ref: '#/components/schemas/ApiError' + - $ref: '#/components/schemas/ValidationError' - type: object properties: - id: + path: type: string - description: The policy id. + format: json-path + description: The missing path. required: - - id - SchemaAlreadyPresentError: + - path + UnknownVariableValidationError: allOf: - - $ref: '#/components/schemas/ApiError' + - $ref: '#/components/schemas/ValidationError' - type: object properties: - id: + field: type: string - description: The schema id. - required: - - id - SchemaEtagMismatchError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The schema id. - eTag: - type: string - description: The eTag. + description: The field. + variables: + type: array + items: + type: string + description: The unknown variables. required: - - id - SchemaNotFoundError: + - field + - variables + UnsupportedFieldValidationError: allOf: - - $ref: '#/components/schemas/ApiError' + - $ref: '#/components/schemas/ValidationError' - type: object properties: - id: + actualValue: type: string - description: The schema ID. - message: + description: The actual value. + expectedValue: type: string - description: The error message. + description: The expected value. + path: + type: string + format: json-path + description: The json path. required: - - id - SchemaParsingFailureError: + - actualValue + - expectedValue + - path + BehaviorPolicyValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - oneOf: + - $ref: '#/components/schemas/GeneralPolicyValidationError' + - $ref: '#/components/schemas/IllegalFunctionValidationError' + - $ref: '#/components/schemas/IllegalEventTransitionValidationError' + - $ref: '#/components/schemas/AtLeastOneFieldMissingValidationError' + - $ref: '#/components/schemas/EmptyFieldValidationError' + - $ref: '#/components/schemas/InvalidFieldLengthValidationError' + - $ref: '#/components/schemas/InvalidFieldValueValidationError' + - $ref: '#/components/schemas/InvalidIdentifierValidationError' + - $ref: '#/components/schemas/MissingFieldValidationError' + - $ref: '#/components/schemas/UnsupportedFieldValidationError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/GeneralPolicyValidationError: '#/components/schemas/GeneralPolicyValidationError' + https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError: '#/components/schemas/IllegalEventTransitionValidationError' + https://hivemq.com/edge/api/model/IllegalFunctionValidationError: '#/components/schemas/IllegalFunctionValidationError' + https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError: '#/components/schemas/AtLeastOneFieldMissingValidationError' + https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' + https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' + https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' + https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' + https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' + https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' + BehaviorPolicyInvalidErrors: allOf: - $ref: '#/components/schemas/ApiError' - type: object properties: - alias: - type: string - description: The schema alias. - message: - type: string - description: The error message. + childErrors: + type: array + description: List of child validation errors. + items: + $ref: '#/components/schemas/BehaviorPolicyValidationError' required: - - alias - - message - SchemaReferencedError: + - childErrors + BehaviorPolicyNotFoundError: allOf: - $ref: '#/components/schemas/ApiError' - type: object properties: id: type: string - description: The schema ID. + description: The data policy id. message: type: string description: The error message. required: - id - ScriptAlreadyPresentError: + BehaviorPolicyRejectedError: + allOf: + - $ref: '#/components/schemas/ApiError' + BehaviorPolicyUpdateFailureError: allOf: - $ref: '#/components/schemas/ApiError' - type: object properties: id: type: string - description: The script id. + description: The ID of the policy that failed to update. + reason: + type: string + description: The actual reason. required: - id - ScriptCreationFailureError: + ClientDisconnectedError: allOf: - $ref: '#/components/schemas/ApiError' - type: object properties: - reason: + id: type: string - description: The actual reason. + description: The client id. required: - - reason - ScriptEtagMismatchError: + - id + ClientNotFoundError: allOf: - $ref: '#/components/schemas/ApiError' - type: object properties: id: type: string - description: The script id. - eTag: - type: string - description: The eTag. + description: The client id. required: - id - ScriptNotFoundError: + DataPolicyAlreadyPresentError: allOf: - $ref: '#/components/schemas/ApiError' - type: object properties: id: type: string - description: The script ID. + description: The data policy id. message: type: string description: The error message. required: - id - ScriptParsingFailureError: + DataPolicyCreationFailureError: allOf: - $ref: '#/components/schemas/ApiError' - type: object @@ -5077,420 +5291,377 @@ components: description: The actual reason. required: - reason - ScriptReferencedError: + DataPolicyValidationError: allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The script ID. - message: - type: string - description: The error message. - required: - - id - ScriptSanitationFailureError: + - $ref: '#/components/schemas/ValidationError' + - oneOf: + - $ref: '#/components/schemas/AtMostOneFunctionValidationError' + - $ref: '#/components/schemas/FunctionMustBePairedValidationError' + - $ref: '#/components/schemas/InvalidFunctionOrderValidationError' + - $ref: '#/components/schemas/UnknownVariableValidationError' + - $ref: '#/components/schemas/EmptyFieldValidationError' + - $ref: '#/components/schemas/InvalidFieldLengthValidationError' + - $ref: '#/components/schemas/InvalidFieldValueValidationError' + - $ref: '#/components/schemas/InvalidIdentifierValidationError' + - $ref: '#/components/schemas/MissingFieldValidationError' + - $ref: '#/components/schemas/UnsupportedFieldValidationError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError: '#/components/schemas/AtMostOneFunctionValidationError' + https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError: '#/components/schemas/FunctionMustBePairedValidationError' + https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError: '#/components/schemas/InvalidFunctionOrderValidationError' + https://hivemq.com/edge/api/model/UnknownVariableValidationError: '#/components/schemas/UnknownVariableValidationError' + https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' + https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' + https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' + https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' + https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' + https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' + DataPolicyInvalidErrors: allOf: - $ref: '#/components/schemas/ApiError' - type: object properties: - reason: - type: string - description: The actual reason. + childErrors: + type: array + description: List of child validation errors. + items: + $ref: '#/components/schemas/DataPolicyValidationError' required: - - reason - TopicFilterMismatchError: + - childErrors + DataPolicyNotFoundError: allOf: - $ref: '#/components/schemas/ApiError' - type: object properties: + id: + type: string + description: The data policy id. message: type: string description: The error message. - path: - type: string - description: The json path of the topic filter. required: - - path - InsufficientStorageError: + - id + DataPolicyRejectedError: allOf: - $ref: '#/components/schemas/ApiError' - - type: object - properties: - reason: - type: string - description: The actual reason. - InternalServerError: + DataPolicyUpdateFailureError: allOf: - $ref: '#/components/schemas/ApiError' - type: object properties: + id: + type: string + description: The ID of the policy that failed to update. reason: type: string description: The actual reason. - InvalidQueryParameterError: + required: + - id + PolicyIdMismatchError: allOf: - $ref: '#/components/schemas/ApiError' - type: object properties: - parameter: + actualId: type: string - description: The query parameter. - reason: + description: The actual id. + expectedId: type: string - description: The reason. + description: The expected id. required: - - parameter - - reason - PreconditionFailedError: + - actualId + - expectedId + PolicyNotFoundError: allOf: - $ref: '#/components/schemas/ApiError' - type: object properties: - reason: + id: type: string - description: The actual reason. + description: The policy id. required: - - reason - RequestBodyMissingError: - allOf: - - $ref: '#/components/schemas/ApiError' - RequestBodyParameterMissingError: + - id + SchemaAlreadyPresentError: allOf: - $ref: '#/components/schemas/ApiError' - type: object properties: - parameter: + id: type: string - description: The the missing request body parameter. - TemporaryNotAvailableError: - allOf: - - $ref: '#/components/schemas/ApiError' - UrlParameterMissingError: + description: The schema id. + required: + - id + SchemaEtagMismatchError: allOf: - $ref: '#/components/schemas/ApiError' - type: object properties: - parameter: + id: type: string - description: The name of the missing parameter. + description: The schema id. + eTag: + type: string + description: The eTag. required: - - parameter - ValidationError: - type: object - properties: - detail: - type: string - description: Detailed contextual description of the validation error. - type: - type: string - format: uri - description: Type of the validation error. - required: - - detail - - type + - id + SchemaValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - oneOf: + - $ref: '#/components/schemas/EmptyFieldValidationError' + - $ref: '#/components/schemas/InvalidFieldLengthValidationError' + - $ref: '#/components/schemas/InvalidFieldValueValidationError' + - $ref: '#/components/schemas/InvalidIdentifierValidationError' + - $ref: '#/components/schemas/MissingFieldValidationError' + - $ref: '#/components/schemas/UnsupportedFieldValidationError' discriminator: propertyName: type mapping: - https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError: '#/components/schemas/AtLeastOneFieldMissingValidationError' - https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError: '#/components/schemas/AtMostOneFunctionValidationError' https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' - https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError: '#/components/schemas/FunctionMustBePairedValidationError' - https://hivemq.com/edge/api/model/GeneralPolicyValidationError: '#/components/schemas/GeneralPolicyValidationError' - https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError: '#/components/schemas/IllegalEventTransitionValidationError' - https://hivemq.com/edge/api/model/IllegalFunctionValidationError: '#/components/schemas/IllegalFunctionValidationError' https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' - https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError: '#/components/schemas/InvalidFunctionOrderValidationError' https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' - https://hivemq.com/edge/api/model/UnknownVariableValidationError: '#/components/schemas/UnknownVariableValidationError' https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' - AtLeastOneFieldMissingValidationError: + SchemaInvalidErrors: allOf: - - $ref: '#/components/schemas/ValidationError' + - $ref: '#/components/schemas/ApiError' - type: object properties: - paths: + childErrors: type: array - description: The missing json paths. + description: List of child validation errors. items: - type: string - format: json-path - description: The json path. + $ref: '#/components/schemas/SchemaValidationError' required: - - paths - AtMostOneFunctionValidationError: + - childErrors + SchemaNotFoundError: allOf: - - $ref: '#/components/schemas/ValidationError' + - $ref: '#/components/schemas/ApiError' - type: object properties: - function: + id: type: string - description: The function. - occurrences: - type: integer - format: int32 - description: The occurrences of the function. - paths: - type: array - items: - type: string - format: json-path - description: The json paths where the function occurs. + description: The schema ID. + message: + type: string + description: The error message. required: - - function - - occurrences - - paths - EmptyFieldValidationError: + - id + SchemaParsingFailureError: allOf: - - $ref: '#/components/schemas/ValidationError' + - $ref: '#/components/schemas/ApiError' - type: object properties: - path: + alias: type: string - format: json-path - description: The missing field. + description: The schema alias. + message: + type: string + description: The error message. required: - - path - FunctionMustBePairedValidationError: + - alias + - message + SchemaReferencedError: allOf: - - $ref: '#/components/schemas/ValidationError' + - $ref: '#/components/schemas/ApiError' - type: object properties: - existingFunction: + id: type: string - description: The existing function. - missingFunction: + description: The schema ID. + message: type: string - description: The missing function. + description: The error message. required: - - existingFunction - - missingFunction - GeneralPolicyValidationError: + - id + ScriptAlreadyPresentError: allOf: - - $ref: '#/components/schemas/ValidationError' + - $ref: '#/components/schemas/ApiError' - type: object properties: - title: + id: type: string - description: The title. + description: The script id. required: - - title - IllegalEventTransitionValidationError: + - id + ScriptCreationFailureError: allOf: - - $ref: '#/components/schemas/ValidationError' + - $ref: '#/components/schemas/ApiError' - type: object properties: - event: - type: string - description: The event name. - fromState: + reason: type: string - description: The event from state. + description: The actual reason. + required: + - reason + ScriptEtagMismatchError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: id: type: string - description: The event id. - path: - type: string - description: The path. - toState: + description: The script id. + eTag: type: string - description: The event to state. + description: The eTag. required: - - event - - fromState - id - - path - - toState - IllegalFunctionValidationError: + ScriptValidationError: allOf: - $ref: '#/components/schemas/ValidationError' + - oneOf: + - $ref: '#/components/schemas/InvalidFieldLengthValidationError' + - $ref: '#/components/schemas/InvalidFieldValueValidationError' + - $ref: '#/components/schemas/InvalidIdentifierValidationError' + - $ref: '#/components/schemas/MissingFieldValidationError' + - $ref: '#/components/schemas/UnsupportedFieldValidationError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' + https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' + https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' + https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' + https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' + ScriptInvalidErrors: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + childErrors: + type: array + description: List of child validation errors. + items: + $ref: '#/components/schemas/ScriptValidationError' + required: + - childErrors + ScriptNotFoundError: + allOf: + - $ref: '#/components/schemas/ApiError' - type: object properties: - event: - type: string - description: The event name. id: type: string - description: The function id. + description: The script ID. message: type: string description: The error message. - path: - type: string - format: json-path - description: The json path. required: - - event - id - - message - - path - InvalidFieldLengthValidationError: + ScriptParsingFailureError: allOf: - - $ref: '#/components/schemas/ValidationError' + - $ref: '#/components/schemas/ApiError' - type: object properties: - actualLength: - type: integer - format: int32 - description: The actual length of the field value. - expectedMinimumLength: - type: integer - format: int32 - description: The minimum length expected for the field value. - expectedMaximumLength: - type: integer - format: int32 - description: The maximum length expected for the field value. - path: + reason: type: string - format: json-path - description: The invalid json path. - value: + description: The actual reason. + required: + - reason + ScriptReferencedError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: type: string - description: The invalid value. + description: The script ID. + message: + type: string + description: The error message. required: - - actualLength - - expectedMinimumLength - - expectedMaximumLength - - path - - value - InvalidFieldValueValidationError: + - id + ScriptSanitationFailureError: allOf: - - $ref: '#/components/schemas/ValidationError' + - $ref: '#/components/schemas/ApiError' - type: object properties: - path: - type: string - format: json-path - description: The invalid json path. - value: + reason: type: string - description: The invalid value. + description: The actual reason. required: - - path - - value - InvalidFunctionOrderValidationError: + - reason + TopicFilterMismatchError: allOf: - - $ref: '#/components/schemas/ValidationError' + - $ref: '#/components/schemas/ApiError' - type: object properties: - function: + message: type: string - description: The function. + description: The error message. path: type: string - format: json-path - description: The json path. - previousFunction: - type: string - description: The previous function. + description: The json path of the topic filter. required: - - function - path - - previousFunction - InvalidIdentifierValidationError: + InsufficientStorageError: allOf: - - $ref: '#/components/schemas/ValidationError' + - $ref: '#/components/schemas/ApiError' - type: object properties: - path: + reason: type: string - format: json-path - description: The invalid identifier path. - value: + description: The actual reason. + InternalServerError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + reason: type: string - description: The invalid identifier value. - required: - - path - - value - MissingFieldValidationError: + description: The actual reason. + InvalidQueryParameterError: allOf: - - $ref: '#/components/schemas/ValidationError' + - $ref: '#/components/schemas/ApiError' - type: object properties: - path: + parameter: type: string - format: json-path - description: The missing path. + description: The query parameter. + reason: + type: string + description: The reason. required: - - path - UnknownVariableValidationError: + - parameter + - reason + PreconditionFailedError: allOf: - - $ref: '#/components/schemas/ValidationError' + - $ref: '#/components/schemas/ApiError' - type: object properties: - field: + reason: type: string - description: The field. - variables: - type: array - items: - type: string - description: The unknown variables. + description: The actual reason. required: - - field - - variables - UnsupportedFieldValidationError: + - reason + RequestBodyMissingError: allOf: - - $ref: '#/components/schemas/ValidationError' + - $ref: '#/components/schemas/ApiError' + RequestBodyParameterMissingError: + allOf: + - $ref: '#/components/schemas/ApiError' - type: object properties: - actualValue: - type: string - description: The actual value. - expectedValue: - type: string - description: The expected value. - path: + parameter: type: string - format: json-path - description: The json path. - required: - - actualValue - - expectedValue - - path - BehaviorPolicyValidationError: + description: The the missing request body parameter. + TemporaryNotAvailableError: allOf: - - $ref: '#/components/schemas/ValidationError' - - oneOf: - - $ref: '#/components/schemas/GeneralPolicyValidationError' - - $ref: '#/components/schemas/IllegalFunctionValidationError' - - $ref: '#/components/schemas/IllegalEventTransitionValidationError' - - $ref: '#/components/schemas/AtLeastOneFieldMissingValidationError' - - $ref: '#/components/schemas/EmptyFieldValidationError' - - $ref: '#/components/schemas/InvalidFieldLengthValidationError' - - $ref: '#/components/schemas/InvalidFieldValueValidationError' - - $ref: '#/components/schemas/InvalidIdentifierValidationError' - - $ref: '#/components/schemas/MissingFieldValidationError' - - $ref: '#/components/schemas/UnsupportedFieldValidationError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/GeneralPolicyValidationError: '#/components/schemas/GeneralPolicyValidationError' - https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError: '#/components/schemas/IllegalEventTransitionValidationError' - https://hivemq.com/edge/api/model/IllegalFunctionValidationError: '#/components/schemas/IllegalFunctionValidationError' - https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError: '#/components/schemas/AtLeastOneFieldMissingValidationError' - https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' - https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' - https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' - https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' - https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' - https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' - BehaviorPolicyInvalidErrors: + - $ref: '#/components/schemas/ApiError' + UrlParameterMissingError: allOf: - $ref: '#/components/schemas/ApiError' - type: object properties: - childErrors: - type: array - description: List of child validation errors. - items: - $ref: '#/components/schemas/BehaviorPolicyValidationError' + parameter: + type: string + description: The name of the missing parameter. required: - - childErrors + - parameter JsonNode: type: object description: The arguments of the fsm derived from the behavior policy. @@ -5612,45 +5783,6 @@ components: description: List of result items that are returned by this endpoint items: $ref: '#/components/schemas/DataPolicy' - DataPolicyValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - oneOf: - - $ref: '#/components/schemas/AtMostOneFunctionValidationError' - - $ref: '#/components/schemas/FunctionMustBePairedValidationError' - - $ref: '#/components/schemas/InvalidFunctionOrderValidationError' - - $ref: '#/components/schemas/UnknownVariableValidationError' - - $ref: '#/components/schemas/EmptyFieldValidationError' - - $ref: '#/components/schemas/InvalidFieldLengthValidationError' - - $ref: '#/components/schemas/InvalidFieldValueValidationError' - - $ref: '#/components/schemas/InvalidIdentifierValidationError' - - $ref: '#/components/schemas/MissingFieldValidationError' - - $ref: '#/components/schemas/UnsupportedFieldValidationError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError: '#/components/schemas/AtMostOneFunctionValidationError' - https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError: '#/components/schemas/FunctionMustBePairedValidationError' - https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError: '#/components/schemas/InvalidFunctionOrderValidationError' - https://hivemq.com/edge/api/model/UnknownVariableValidationError: '#/components/schemas/UnknownVariableValidationError' - https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' - https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' - https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' - https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' - https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' - https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' - DataPolicyInvalidErrors: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - childErrors: - type: array - description: List of child validation errors. - items: - $ref: '#/components/schemas/DataPolicyValidationError' - required: - - childErrors BehaviorPolicyTransitionEvent: type: string description: Accepted event in transition @@ -5754,37 +5886,6 @@ components: description: List of result items that are returned by this endpoint items: $ref: '#/components/schemas/PolicySchema' - SchemaValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - oneOf: - - $ref: '#/components/schemas/EmptyFieldValidationError' - - $ref: '#/components/schemas/InvalidFieldLengthValidationError' - - $ref: '#/components/schemas/InvalidFieldValueValidationError' - - $ref: '#/components/schemas/InvalidIdentifierValidationError' - - $ref: '#/components/schemas/MissingFieldValidationError' - - $ref: '#/components/schemas/UnsupportedFieldValidationError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' - https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' - https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' - https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' - https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' - https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' - SchemaInvalidErrors: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - childErrors: - type: array - description: List of child validation errors. - items: - $ref: '#/components/schemas/SchemaValidationError' - required: - - childErrors Script: type: object properties: @@ -5826,35 +5927,6 @@ components: description: List of result items that are returned by this endpoint items: $ref: '#/components/schemas/Script' - ScriptValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - oneOf: - - $ref: '#/components/schemas/InvalidFieldLengthValidationError' - - $ref: '#/components/schemas/InvalidFieldValueValidationError' - - $ref: '#/components/schemas/InvalidIdentifierValidationError' - - $ref: '#/components/schemas/MissingFieldValidationError' - - $ref: '#/components/schemas/UnsupportedFieldValidationError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' - https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' - https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' - https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' - https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' - ScriptInvalidErrors: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - childErrors: - type: array - description: List of child validation errors. - items: - $ref: '#/components/schemas/ScriptValidationError' - required: - - childErrors Capability: type: object description: List of result items that are returned by this endpoint diff --git a/ext/openAPI/components/schemas/errors/ApiError.yaml b/ext/openAPI/components/schemas/errors/ApiError.yaml index 43e01fbbf0..bee828310d 100644 --- a/ext/openAPI/components/schemas/errors/ApiError.yaml +++ b/ext/openAPI/components/schemas/errors/ApiError.yaml @@ -6,6 +6,7 @@ discriminator: # DataHub https://hivemq.com/edge/api/model/BehaviorPolicyAlreadyPresentError: "./datahub/BehaviorPolicyAlreadyPresentError.yaml" https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError: "./datahub/BehaviorPolicyCreationFailureError.yaml" + https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors: "./datahub/BehaviorPolicyInvalidErrors.yaml" https://hivemq.com/edge/api/model/BehaviorPolicyNotFoundError: "./datahub/BehaviorPolicyNotFoundError.yaml" https://hivemq.com/edge/api/model/BehaviorPolicyRejectedError: "./datahub/BehaviorPolicyRejectedError.yaml" https://hivemq.com/edge/api/model/BehaviorPolicyUpdateFailureError: "./datahub/BehaviorPolicyUpdateFailureError.yaml" @@ -13,6 +14,7 @@ discriminator: https://hivemq.com/edge/api/model/ClientNotFoundError: "./datahub/ClientNotFoundError.yaml" https://hivemq.com/edge/api/model/DataPolicyAlreadyPresentError: "./datahub/DataPolicyAlreadyPresentError.yaml" https://hivemq.com/edge/api/model/DataPolicyCreationFailureError: "./datahub/DataPolicyCreationFailureError.yaml" + https://hivemq.com/edge/api/model/DataPolicyInvalidErrors: "./datahub/DataPolicyInvalidErrors.yaml" https://hivemq.com/edge/api/model/DataPolicyNotFoundError: "./datahub/DataPolicyNotFoundError.yaml" https://hivemq.com/edge/api/model/DataPolicyRejectedError: "./datahub/DataPolicyRejectedError.yaml" https://hivemq.com/edge/api/model/DataPolicyUpdateFailureError: "./datahub/DataPolicyUpdateFailureError.yaml" @@ -20,12 +22,14 @@ discriminator: https://hivemq.com/edge/api/model/PolicyNotFoundError: "./datahub/PolicyNotFoundError.yaml" https://hivemq.com/edge/api/model/SchemaAlreadyPresentError: "./datahub/SchemaAlreadyPresentError.yaml" https://hivemq.com/edge/api/model/SchemaEtagMismatchError: "./datahub/SchemaEtagMismatchError.yaml" + https://hivemq.com/edge/api/model/SchemaInvalidErrors: "./datahub/SchemaInvalidErrors.yaml" https://hivemq.com/edge/api/model/SchemaNotFoundError: "./datahub/SchemaNotFoundError.yaml" https://hivemq.com/edge/api/model/SchemaParsingFailureError: "./datahub/SchemaParsingFailureError.yaml" https://hivemq.com/edge/api/model/SchemaReferencedError: "./datahub/SchemaReferencedError.yaml" https://hivemq.com/edge/api/model/ScriptAlreadyPresentError: "./datahub/ScriptAlreadyPresentError.yaml" https://hivemq.com/edge/api/model/ScriptCreationFailureError: "./datahub/ScriptCreationFailureError.yaml" https://hivemq.com/edge/api/model/ScriptEtagMismatchError: "./datahub/ScriptEtagMismatchError.yaml" + https://hivemq.com/edge/api/model/ScriptInvalidErrors: "./datahub/ScriptInvalidErrors.yaml" https://hivemq.com/edge/api/model/ScriptNotFoundError: "./datahub/ScriptNotFoundError.yaml" https://hivemq.com/edge/api/model/ScriptParsingFailureError: "./datahub/ScriptParsingFailureError.yaml" https://hivemq.com/edge/api/model/ScriptReferencedError: "./datahub/ScriptReferencedError.yaml" diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies.yaml index c3f6386cd4..36c7dad855 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies.yaml @@ -186,6 +186,8 @@ get: - $ref: "../components/schemas/errors/http/InvalidQueryParameterError.yaml" discriminator: propertyName: type + mapping: + https://hivemq.com/edge/api/model/InvalidQueryParameterError: "../components/schemas/errors/http/InvalidQueryParameterError.yaml" description: URL parameter missing '503': content: @@ -280,12 +282,17 @@ post: application/json: schema: oneOf: - - $ref: "../components/schemas/errors/http/RequestBodyMissingError.yaml" - $ref: "../components/schemas/errors/datahub/BehaviorPolicyCreationFailureError.yaml" - $ref: "../components/schemas/errors/datahub/BehaviorPolicyInvalidErrors.yaml" - $ref: "../components/schemas/errors/datahub/BehaviorPolicyRejectedError.yaml" + - $ref: "../components/schemas/errors/http/RequestBodyMissingError.yaml" discriminator: propertyName: type + mapping: + https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError: "../components/schemas/errors/datahub/BehaviorPolicyCreationFailureError.yaml" + https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors: "../components/schemas/errors/datahub/BehaviorPolicyInvalidErrors.yaml" + https://hivemq.com/edge/api/model/BehaviorPolicyRejectedError: "../components/schemas/errors/datahub/BehaviorPolicyRejectedError.yaml" + https://hivemq.com/edge/api/model/RequestBodyMissingError: "../components/schemas/errors/http/RequestBodyMissingError.yaml" description: Policy creation failed '409': content: diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies_{policyId}.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies_{policyId}.yaml index 78d647e7e9..ed9606d887 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies_{policyId}.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies_{policyId}.yaml @@ -29,6 +29,8 @@ delete: - $ref: "../components/schemas/errors/http/UrlParameterMissingError.yaml" discriminator: propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: "../components/schemas/errors/http/UrlParameterMissingError.yaml" description: URL parameter missing '404': content: @@ -130,6 +132,8 @@ get: - $ref: "../components/schemas/errors/http/UrlParameterMissingError.yaml" discriminator: propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: "../components/schemas/errors/http/UrlParameterMissingError.yaml" description: Bad request '404': content: @@ -260,6 +264,15 @@ put: - $ref: "../components/schemas/errors/datahub/BehaviorPolicyInvalidErrors.yaml" - $ref: "../components/schemas/errors/datahub/BehaviorPolicyUpdateFailureError.yaml" - $ref: "../components/schemas/errors/datahub/PolicyIdMismatchError.yaml" + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/RequestBodyMissingError: "../components/schemas/errors/http/RequestBodyMissingError.yaml" + https://hivemq.com/edge/api/model/UrlParameterMissingError: "../components/schemas/errors/http/UrlParameterMissingError.yaml" + https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError: "../components/schemas/errors/datahub/BehaviorPolicyCreationFailureError.yaml" + https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors: "../components/schemas/errors/datahub/BehaviorPolicyInvalidErrors.yaml" + https://hivemq.com/edge/api/model/BehaviorPolicyUpdateFailureError: "../components/schemas/errors/datahub/BehaviorPolicyUpdateFailureError.yaml" + https://hivemq.com/edge/api/model/PolicyIdMismatchError: "../components/schemas/errors/datahub/PolicyIdMismatchError.yaml" description: Behavior policy creation failed '404': content: diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_states_{clientId}.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_states_{clientId}.yaml index 9d3a726e75..0f7691d711 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_states_{clientId}.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_states_{clientId}.yaml @@ -44,6 +44,8 @@ get: - $ref: "../components/schemas/errors/http/UrlParameterMissingError.yaml" discriminator: propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: "../components/schemas/errors/http/UrlParameterMissingError.yaml" description: URL parameter missing '404': content: @@ -54,6 +56,9 @@ get: - $ref: "../components/schemas/errors/datahub/ClientNotFoundError.yaml" discriminator: propertyName: type + mapping: + https://hivemq.com/edge/api/model/ClientDisconnectedError: "../components/schemas/errors/datahub/ClientDisconnectedError.yaml" + https://hivemq.com/edge/api/model/ClientNotFoundError: "../components/schemas/errors/datahub/ClientNotFoundError.yaml" description: Client error '500': content: diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml index e4c6a0f8f8..c3757147fe 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml @@ -291,6 +291,8 @@ get: - $ref: "../components/schemas/errors/http/InvalidQueryParameterError.yaml" discriminator: propertyName: type + mapping: + https://hivemq.com/edge/api/model/InvalidQueryParameterError: "../components/schemas/errors/http/InvalidQueryParameterError.yaml" description: URL parameter missing '503': content: @@ -397,6 +399,11 @@ post: - $ref: "../components/schemas/errors/datahub/DataPolicyRejectedError.yaml" discriminator: propertyName: type + mapping: + https://hivemq.com/edge/api/model/RequestBodyMissingError: "../components/schemas/errors/http/RequestBodyMissingError.yaml" + https://hivemq.com/edge/api/model/DataPolicyCreationFailureError: "../components/schemas/errors/datahub/DataPolicyCreationFailureError.yaml" + https://hivemq.com/edge/api/model/DataPolicyInvalidErrors: "../components/schemas/errors/datahub/DataPolicyInvalidErrors.yaml" + https://hivemq.com/edge/api/model/DataPolicyRejectedError: "../components/schemas/errors/datahub/DataPolicyRejectedError.yaml" description: Data policy creation failed '409': content: diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml index 4427b53a05..bc5062edec 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml @@ -29,6 +29,8 @@ delete: - $ref: "../components/schemas/errors/http/UrlParameterMissingError.yaml" discriminator: propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: "../components/schemas/errors/http/UrlParameterMissingError.yaml" description: URL parameter missing '404': content: @@ -133,6 +135,8 @@ get: - $ref: "../components/schemas/errors/http/UrlParameterMissingError.yaml" discriminator: propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: "../components/schemas/errors/http/UrlParameterMissingError.yaml" description: Bad request '404': content: @@ -273,6 +277,14 @@ put: - $ref: "../components/schemas/errors/datahub/TopicFilterMismatchError.yaml" discriminator: propertyName: type + mapping: + https://hivemq.com/edge/api/model/RequestBodyMissingError: "../components/schemas/errors/http/RequestBodyMissingError.yaml" + https://hivemq.com/edge/api/model/UrlParameterMissingError: "../components/schemas/errors/http/UrlParameterMissingError.yaml" + https://hivemq.com/edge/api/model/DataPolicyCreationFailureError: "../components/schemas/errors/datahub/DataPolicyCreationFailureError.yaml" + https://hivemq.com/edge/api/model/DataPolicyInvalidErrors: "../components/schemas/errors/datahub/DataPolicyInvalidErrors.yaml" + https://hivemq.com/edge/api/model/DataPolicyUpdateFailureError: "../components/schemas/errors/datahub/DataPolicyUpdateFailureError.yaml" + https://hivemq.com/edge/api/model/PolicyIdMismatchError: "../components/schemas/errors/datahub/PolicyIdMismatchError.yaml" + https://hivemq.com/edge/api/model/TopicFilterMismatchError: "../components/schemas/errors/datahub/TopicFilterMismatchError.yaml" description: Data policy creation failed '404': content: diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas.yaml index 4352d66de4..1146c6a048 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas.yaml @@ -159,6 +159,8 @@ get: - $ref: "../components/schemas/errors/http/InvalidQueryParameterError.yaml" discriminator: propertyName: type + mapping: + https://hivemq.com/edge/api/model/InvalidQueryParameterError: "../components/schemas/errors/http/InvalidQueryParameterError.yaml" description: URL parameter missing '503': content: @@ -221,6 +223,10 @@ post: - $ref: "../components/schemas/errors/datahub/SchemaParsingFailureError.yaml" discriminator: propertyName: type + mapping: + https://hivemq.com/edge/api/model/RequestBodyParameterMissingError: "../components/schemas/errors/http/RequestBodyParameterMissingError.yaml" + https://hivemq.com/edge/api/model/SchemaInvalidErrors: "../components/schemas/errors/datahub/SchemaInvalidErrors.yaml" + https://hivemq.com/edge/api/model/SchemaParsingFailureError: "../components/schemas/errors/datahub/SchemaParsingFailureError.yaml" description: Schema creation failed '409': content: diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas_{schemaId}.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas_{schemaId}.yaml index 8ba9ff4c71..a4eed7cff2 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas_{schemaId}.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas_{schemaId}.yaml @@ -30,6 +30,9 @@ delete: - $ref: "../components/schemas/errors/datahub/SchemaReferencedError.yaml" discriminator: propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: "../components/schemas/errors/http/UrlParameterMissingError.yaml" + https://hivemq.com/edge/api/model/SchemaReferencedError: "../components/schemas/errors/datahub/SchemaReferencedError.yaml" description: URL parameter missing '404': content: @@ -108,6 +111,8 @@ get: - $ref: "../components/schemas/errors/http/UrlParameterMissingError.yaml" discriminator: propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: "../components/schemas/errors/http/UrlParameterMissingError.yaml" description: URL parameter missing '404': content: diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts.yaml index a9d905283c..0eeae95da9 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts.yaml @@ -146,6 +146,8 @@ get: - $ref: "../components/schemas/errors/http/InvalidQueryParameterError.yaml" discriminator: propertyName: type + mapping: + https://hivemq.com/edge/api/model/InvalidQueryParameterError: "../components/schemas/errors/http/InvalidQueryParameterError.yaml" description: URL parameter missing '503': content: @@ -210,6 +212,12 @@ post: - $ref: "../components/schemas/errors/datahub/ScriptSanitationFailureError.yaml" discriminator: propertyName: type + mapping: + https://hivemq.com/edge/api/model/RequestBodyParameterMissingError: "../components/schemas/errors/http/RequestBodyParameterMissingError.yaml" + https://hivemq.com/edge/api/model/ScriptCreationFailureError: "../components/schemas/errors/datahub/ScriptCreationFailureError.yaml" + https://hivemq.com/edge/api/model/ScriptInvalidErrors: "../components/schemas/errors/datahub/ScriptInvalidErrors.yaml" + https://hivemq.com/edge/api/model/ScriptParsingFailureError: "../components/schemas/errors/datahub/ScriptParsingFailureError.yaml" + https://hivemq.com/edge/api/model/ScriptSanitationFailureError: "../components/schemas/errors/datahub/ScriptSanitationFailureError.yaml" description: Script creation failed '409': content: diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts_{scriptId}.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts_{scriptId}.yaml index 3a21f0d86d..003980e1f2 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts_{scriptId}.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts_{scriptId}.yaml @@ -27,6 +27,9 @@ delete: - $ref: "../components/schemas/errors/datahub/ScriptReferencedError.yaml" discriminator: propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: "../components/schemas/errors/http/UrlParameterMissingError.yaml" + https://hivemq.com/edge/api/model/ScriptReferencedError: "../components/schemas/errors/datahub/ScriptReferencedError.yaml" description: URL parameter missing '404': content: @@ -101,6 +104,8 @@ get: - $ref: "../components/schemas/errors/http/UrlParameterMissingError.yaml" discriminator: propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: "../components/schemas/errors/http/UrlParameterMissingError.yaml" description: URL parameter missing '404': content: From 8db9eb215c49cf6dfedea8a3ed02dab0f81d124a Mon Sep 17 00:00:00 2001 From: Nicolas Van Labeke Date: Wed, 4 Jun 2025 21:05:35 +0100 Subject: [PATCH 047/121] Merge pull request #999 * fix(24801): fix warnings with unsupported formats from AJV * fix(24801): fix warnings with unsupported formats from AJV * fix(24801): redesign the schema for the maxPublish option * fix(24801): refactor the min and max publishes * fix(24801): add types for the Publish Quota model * fix(24801): add custom validation for publish arguments * test(24801): add tests * test(24801): fix tests * fix(24801): fix translations * fix(24801): fix constant --- .../datahub/designer/operation/OperationPanel.spec.cy.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hivemq-edge-frontend/src/extensions/datahub/designer/operation/OperationPanel.spec.cy.tsx b/hivemq-edge-frontend/src/extensions/datahub/designer/operation/OperationPanel.spec.cy.tsx index 02dac3b008..c606d08f3e 100644 --- a/hivemq-edge-frontend/src/extensions/datahub/designer/operation/OperationPanel.spec.cy.tsx +++ b/hivemq-edge-frontend/src/extensions/datahub/designer/operation/OperationPanel.spec.cy.tsx @@ -194,7 +194,7 @@ describe('OperationPanel', () => { }, } - it.only('should render the form', () => { + it('should render the form', () => { cy.mountWithProviders(, { wrapper: getWrapperWith([node]), }) From fc7960a555b33b24ab5931cac879885615c81ee1 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Tue, 10 Jun 2025 13:32:11 +0200 Subject: [PATCH 048/121] refactor: Remove title from GeneralPolicyValidationError --- ext/hivemq-edge-openapi-2025.9.yaml | 7 ------- .../errors/datahub/GeneralPolicyValidationError.yaml | 7 ------- 2 files changed, 14 deletions(-) diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index 03331a8703..3e724590d3 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -4999,13 +4999,6 @@ components: GeneralPolicyValidationError: allOf: - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - title: - type: string - description: The title. - required: - - title IllegalEventTransitionValidationError: allOf: - $ref: '#/components/schemas/ValidationError' diff --git a/ext/openAPI/components/schemas/errors/datahub/GeneralPolicyValidationError.yaml b/ext/openAPI/components/schemas/errors/datahub/GeneralPolicyValidationError.yaml index 45e26077dc..ae23ca8091 100644 --- a/ext/openAPI/components/schemas/errors/datahub/GeneralPolicyValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/GeneralPolicyValidationError.yaml @@ -1,9 +1,2 @@ allOf: - $ref: "../validation/ValidationError.yaml" - - type: object - properties: - title: - type: string - description: The title. - required: - - title From 3d52680f48ebdf1ef9fe5a18f38a05be6e633f6d Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Wed, 11 Jun 2025 09:21:15 +0200 Subject: [PATCH 049/121] refactor: Add example to InsufficientStorageError --- ext/hivemq-edge-openapi-2025.9.yaml | 12 +++++++----- .../errors/http/InsufficientStorageError.yaml | 12 +++++++----- .../java/com/hivemq/api/errors/HttpErrorFactory.java | 1 - 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index 3e724590d3..da5644ad01 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -5594,11 +5594,13 @@ components: InsufficientStorageError: allOf: - $ref: '#/components/schemas/ApiError' - - type: object - properties: - reason: - type: string - description: The actual reason. + example: + general: + code: 507 + detail: Insufficient Storage. + policy: + code: 507 + detail: 'Insufficient Storage: The policy with id ''123'' could not be added because of insufficient server storage.' InternalServerError: allOf: - $ref: '#/components/schemas/ApiError' diff --git a/ext/openAPI/components/schemas/errors/http/InsufficientStorageError.yaml b/ext/openAPI/components/schemas/errors/http/InsufficientStorageError.yaml index 10ec6cc097..3ae5af84ac 100644 --- a/ext/openAPI/components/schemas/errors/http/InsufficientStorageError.yaml +++ b/ext/openAPI/components/schemas/errors/http/InsufficientStorageError.yaml @@ -1,7 +1,9 @@ allOf: - $ref: "../ApiError.yaml" - - type: object - properties: - reason: - type: string - description: The actual reason. +example: + general: + code: 507 + detail: Insufficient Storage. + policy: + code: 507 + detail: "Insufficient Storage: The policy with id '123' could not be added because of insufficient server storage." diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java index 018de1510a..1f9ce22016 100644 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java @@ -42,7 +42,6 @@ private HttpErrorFactory() { .type(type(InsufficientStorageError.class)) .title("Insufficient Storage") .detail(reason == null ? "Insufficient Storage." : "Insufficient Storage: " + reason) - .reason(reason) .status(HttpStatus.INSUFFICIENT_STORAGE_507) .build(); } From 773b1c15260005b416f3de858a1b25a76600af77 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Wed, 11 Jun 2025 09:31:50 +0200 Subject: [PATCH 050/121] refactor: Add example to InternalServerError --- ext/hivemq-edge-openapi-2025.9.yaml | 24 +++++++++++++------ .../errors/http/InsufficientStorageError.yaml | 10 +++++--- .../errors/http/InternalServerError.yaml | 16 +++++++++---- .../hivemq/api/errors/HttpErrorFactory.java | 11 ++++++--- 4 files changed, 43 insertions(+), 18 deletions(-) diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index da5644ad01..c1872a7464 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -5596,19 +5596,29 @@ components: - $ref: '#/components/schemas/ApiError' example: general: - code: 507 + status: 507 + title: Insufficient Storage detail: Insufficient Storage. + type: https://hivemq.com/edge/api/model/InsufficientStorageError policy: - code: 507 + status: 507 + title: Insufficient Storage detail: 'Insufficient Storage: The policy with id ''123'' could not be added because of insufficient server storage.' + type: https://hivemq.com/edge/api/model/InsufficientStorageError InternalServerError: allOf: - $ref: '#/components/schemas/ApiError' - - type: object - properties: - reason: - type: string - description: The actual reason. + example: + general: + status: 500 + title: Internal Server Error + detail: An unexpected error occurred, check the logs. + type: https://hivemq.com/edge/api/model/InternalServerError + creation: + status: 500 + title: Internal Server Error + detail: 'An unexpected error occurred: Exception during creation of the Json Schema for functions.' + type: https://hivemq.com/edge/api/model/InternalServerError InvalidQueryParameterError: allOf: - $ref: '#/components/schemas/ApiError' diff --git a/ext/openAPI/components/schemas/errors/http/InsufficientStorageError.yaml b/ext/openAPI/components/schemas/errors/http/InsufficientStorageError.yaml index 3ae5af84ac..eaa4e2b510 100644 --- a/ext/openAPI/components/schemas/errors/http/InsufficientStorageError.yaml +++ b/ext/openAPI/components/schemas/errors/http/InsufficientStorageError.yaml @@ -2,8 +2,12 @@ allOf: - $ref: "../ApiError.yaml" example: general: - code: 507 - detail: Insufficient Storage. + status: 507 + title: "Insufficient Storage" + detail: "Insufficient Storage." + type: "https://hivemq.com/edge/api/model/InsufficientStorageError" policy: - code: 507 + status: 507 + title: "Insufficient Storage" detail: "Insufficient Storage: The policy with id '123' could not be added because of insufficient server storage." + type: "https://hivemq.com/edge/api/model/InsufficientStorageError" diff --git a/ext/openAPI/components/schemas/errors/http/InternalServerError.yaml b/ext/openAPI/components/schemas/errors/http/InternalServerError.yaml index 10ec6cc097..b59bc70d4c 100644 --- a/ext/openAPI/components/schemas/errors/http/InternalServerError.yaml +++ b/ext/openAPI/components/schemas/errors/http/InternalServerError.yaml @@ -1,7 +1,13 @@ allOf: - $ref: "../ApiError.yaml" - - type: object - properties: - reason: - type: string - description: The actual reason. +example: + general: + status: 500 + title: "Internal Server Error" + detail: "An unexpected error occurred, check the logs." + type: "https://hivemq.com/edge/api/model/InternalServerError" + creation: + status: 500 + title: "Internal Server Error" + detail: "An unexpected error occurred: Exception during creation of the Json Schema for functions." + type: "https://hivemq.com/edge/api/model/InternalServerError" diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java index 1f9ce22016..53ca2e26b0 100644 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java @@ -46,12 +46,17 @@ private HttpErrorFactory() { .build(); } + public static @NotNull InternalServerError internalServerError() { + return internalServerError(null); + } + public static @NotNull InternalServerError internalServerError(final @Nullable String reason) { return InternalServerError.builder() .type(type(InternalServerError.class)) - .title("Internal Error") - .detail(reason == null ? "An unexpected error occurred, check the logs." : reason) - .reason(reason) + .title("Internal Server Error") + .detail(reason == null ? + "An unexpected error occurred, check the logs." : + "An unexpected error occurred: " + reason) .status(HttpStatus.INTERNAL_SERVER_ERROR_500) .build(); } From 2ca3785efaddd7aa3d16c59f9df7f5781d7374cd Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Wed, 11 Jun 2025 09:40:24 +0200 Subject: [PATCH 051/121] refactor: Add example to InvalidQueryParameterError --- ext/hivemq-edge-openapi-2025.9.yaml | 10 ++++++---- .../errors/http/InvalidQueryParameterError.yaml | 10 ++++++---- .../java/com/hivemq/api/errors/HttpErrorFactory.java | 3 +-- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index c1872a7464..88d5728c9b 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -5627,12 +5627,14 @@ components: parameter: type: string description: The query parameter. - reason: - type: string - description: The reason. required: - parameter - - reason + example: + general: + status: 400 + title: Query Parameter is Invalid + detail: 'Query parameter ''a'' is invalid: ''a'' could not be parsed.' + type: https://hivemq.com/edge/api/model/InvalidQueryParameterError PreconditionFailedError: allOf: - $ref: '#/components/schemas/ApiError' diff --git a/ext/openAPI/components/schemas/errors/http/InvalidQueryParameterError.yaml b/ext/openAPI/components/schemas/errors/http/InvalidQueryParameterError.yaml index 8a5bc13b0a..9719190970 100644 --- a/ext/openAPI/components/schemas/errors/http/InvalidQueryParameterError.yaml +++ b/ext/openAPI/components/schemas/errors/http/InvalidQueryParameterError.yaml @@ -5,9 +5,11 @@ allOf: parameter: type: string description: The query parameter. - reason: - type: string - description: The reason. required: - parameter - - reason +example: + general: + status: 400 + title: "Query Parameter is Invalid" + detail: "Query parameter 'a' is invalid: 'a' could not be parsed." + type: "https://hivemq.com/edge/api/model/InvalidQueryParameterError" diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java index 53ca2e26b0..3d5db2a831 100644 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java @@ -66,10 +66,9 @@ private HttpErrorFactory() { final @NotNull String reason) { return InvalidQueryParameterError.builder() .type(type(InvalidQueryParameterError.class)) - .title("Query parameter is invalid") + .title("Query Parameter is Invalid") .detail("Query parameter '" + parameter + "' is invalid: " + reason) .parameter(parameter) - .reason(reason) .status(HttpStatus.BAD_REQUEST_400) .build(); } From 2115a44c9c7b2a5e6a22760fbf4832ed74d2ba2a Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Wed, 11 Jun 2025 09:45:00 +0200 Subject: [PATCH 052/121] refactor: Add example to PreconditionFailedError --- ext/hivemq-edge-openapi-2025.9.yaml | 13 ++++++------- .../errors/http/PreconditionFailedError.yaml | 13 ++++++------- .../com/hivemq/api/errors/HttpErrorFactory.java | 1 - 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index 88d5728c9b..75f3753403 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -5638,13 +5638,12 @@ components: PreconditionFailedError: allOf: - $ref: '#/components/schemas/ApiError' - - type: object - properties: - reason: - type: string - description: The actual reason. - required: - - reason + example: + general: + status: 412 + title: Precondition Failed + detail: 'A precondition required for fulfilling the request was not fulfilled: Policy does not match the given etag ''abc''.' + type: https://hivemq.com/edge/api/model/PreconditionFailedError RequestBodyMissingError: allOf: - $ref: '#/components/schemas/ApiError' diff --git a/ext/openAPI/components/schemas/errors/http/PreconditionFailedError.yaml b/ext/openAPI/components/schemas/errors/http/PreconditionFailedError.yaml index ea854eb9cc..26ee530325 100644 --- a/ext/openAPI/components/schemas/errors/http/PreconditionFailedError.yaml +++ b/ext/openAPI/components/schemas/errors/http/PreconditionFailedError.yaml @@ -1,9 +1,8 @@ allOf: - $ref: "../ApiError.yaml" - - type: object - properties: - reason: - type: string - description: The actual reason. - required: - - reason +example: + general: + status: 412 + title: "Precondition Failed" + detail: "A precondition required for fulfilling the request was not fulfilled: Policy does not match the given etag 'abc'." + type: "https://hivemq.com/edge/api/model/PreconditionFailedError" diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java index 3d5db2a831..cf0acbd4e7 100644 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java @@ -79,7 +79,6 @@ private HttpErrorFactory() { .type(type(PreconditionFailedError.class)) .title("Precondition Failed") .detail("A precondition required for fulfilling the request was not fulfilled: " + reason) - .reason(reason) .status(HttpStatus.PRECONDITION_FAILED_412) .build(); } From 5101ea70b4713872bf294b78bc0fd5e368c8e200 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Wed, 11 Jun 2025 09:54:00 +0200 Subject: [PATCH 053/121] refactor: Add example to RequestBodyMissingError --- ext/hivemq-edge-openapi-2025.9.yaml | 6 ++++++ .../schemas/errors/http/RequestBodyMissingError.yaml | 6 ++++++ .../main/java/com/hivemq/api/errors/HttpErrorFactory.java | 4 ++-- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index 75f3753403..8cfb770fc5 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -5647,6 +5647,12 @@ components: RequestBodyMissingError: allOf: - $ref: '#/components/schemas/ApiError' + example: + general: + status: 400 + title: Required Request Body Missing + detail: Required request body is missing. + type: https://hivemq.com/edge/api/model/RequestBodyMissingError RequestBodyParameterMissingError: allOf: - $ref: '#/components/schemas/ApiError' diff --git a/ext/openAPI/components/schemas/errors/http/RequestBodyMissingError.yaml b/ext/openAPI/components/schemas/errors/http/RequestBodyMissingError.yaml index 1e5857dabc..94a583e0aa 100644 --- a/ext/openAPI/components/schemas/errors/http/RequestBodyMissingError.yaml +++ b/ext/openAPI/components/schemas/errors/http/RequestBodyMissingError.yaml @@ -1,2 +1,8 @@ allOf: - $ref: "../ApiError.yaml" +example: + general: + status: 400 + title: "Required Request Body Missing" + detail: "Required request body is missing." + type: "https://hivemq.com/edge/api/model/RequestBodyMissingError" diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java index cf0acbd4e7..653ccc7d66 100644 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java @@ -86,8 +86,8 @@ private HttpErrorFactory() { public static @NotNull RequestBodyMissingError requestBodyMissingError() { return RequestBodyMissingError.builder() .type(type(RequestBodyMissingError.class)) - .title("Required request body missing") - .detail("Required request body missing.") + .title("Required Request Body Missing") + .detail("Required request body is missing.") .status(HttpStatus.BAD_REQUEST_400) .build(); } From c7af13b4f064d30338ac5b736226fa8f576677e6 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Wed, 11 Jun 2025 09:58:03 +0200 Subject: [PATCH 054/121] refactor: Add example to RequestBodyParameterMissingError --- ext/hivemq-edge-openapi-2025.9.yaml | 10 ++++++++++ .../errors/http/InvalidQueryParameterError.yaml | 1 + .../errors/http/RequestBodyParameterMissingError.yaml | 9 +++++++++ .../java/com/hivemq/api/errors/HttpErrorFactory.java | 4 ++-- 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index 8cfb770fc5..2ec30796dc 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -5634,6 +5634,7 @@ components: status: 400 title: Query Parameter is Invalid detail: 'Query parameter ''a'' is invalid: ''a'' could not be parsed.' + parameter: a type: https://hivemq.com/edge/api/model/InvalidQueryParameterError PreconditionFailedError: allOf: @@ -5661,6 +5662,15 @@ components: parameter: type: string description: The the missing request body parameter. + required: + - parameter + example: + general: + status: 400 + title: Required Request Body Parameter Missing + detail: Required request body parameter 'a' is missing. + parameter: a + type: https://hivemq.com/edge/api/model/RequestBodyParameterMissingError TemporaryNotAvailableError: allOf: - $ref: '#/components/schemas/ApiError' diff --git a/ext/openAPI/components/schemas/errors/http/InvalidQueryParameterError.yaml b/ext/openAPI/components/schemas/errors/http/InvalidQueryParameterError.yaml index 9719190970..61ec1ef357 100644 --- a/ext/openAPI/components/schemas/errors/http/InvalidQueryParameterError.yaml +++ b/ext/openAPI/components/schemas/errors/http/InvalidQueryParameterError.yaml @@ -12,4 +12,5 @@ example: status: 400 title: "Query Parameter is Invalid" detail: "Query parameter 'a' is invalid: 'a' could not be parsed." + parameter: "a" type: "https://hivemq.com/edge/api/model/InvalidQueryParameterError" diff --git a/ext/openAPI/components/schemas/errors/http/RequestBodyParameterMissingError.yaml b/ext/openAPI/components/schemas/errors/http/RequestBodyParameterMissingError.yaml index 65aa761137..e3e39383e0 100644 --- a/ext/openAPI/components/schemas/errors/http/RequestBodyParameterMissingError.yaml +++ b/ext/openAPI/components/schemas/errors/http/RequestBodyParameterMissingError.yaml @@ -5,3 +5,12 @@ allOf: parameter: type: string description: The the missing request body parameter. + required: + - parameter +example: + general: + status: 400 + title: "Required Request Body Parameter Missing" + detail: "Required request body parameter 'a' is missing." + parameter: "a" + type: "https://hivemq.com/edge/api/model/RequestBodyParameterMissingError" diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java index 653ccc7d66..0a9ceac9dc 100644 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java @@ -95,8 +95,8 @@ private HttpErrorFactory() { public static @NotNull RequestBodyParameterMissingError requestBodyParameterMissingError(final @NotNull String parameter) { return RequestBodyParameterMissingError.builder() .type(type(RequestBodyParameterMissingError.class)) - .title("Required request body parameter missing") - .detail("Required request body parameter '" + parameter + "' missing.") + .title("Required Request Body Parameter Missing") + .detail("Required request body parameter '" + parameter + "' is missing.") .parameter(parameter) .status(HttpStatus.BAD_REQUEST_400) .build(); From 5e16cb395dd0a1a6ca363a943f6d615e23ff7b09 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Wed, 11 Jun 2025 10:04:21 +0200 Subject: [PATCH 055/121] refactor: Add example to TemporaryNotAvailableError --- ext/hivemq-edge-openapi-2025.9.yaml | 6 ++++++ .../schemas/errors/http/TemporaryNotAvailableError.yaml | 6 ++++++ .../main/java/com/hivemq/api/errors/HttpErrorFactory.java | 4 ++-- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index 2ec30796dc..a7adc4440e 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -5674,6 +5674,12 @@ components: TemporaryNotAvailableError: allOf: - $ref: '#/components/schemas/ApiError' + example: + general: + status: 503 + title: Endpoint Temporarily not Available + detail: The endpoint is temporarily not available, please try again later. + type: https://hivemq.com/edge/api/model/TemporaryNotAvailableError UrlParameterMissingError: allOf: - $ref: '#/components/schemas/ApiError' diff --git a/ext/openAPI/components/schemas/errors/http/TemporaryNotAvailableError.yaml b/ext/openAPI/components/schemas/errors/http/TemporaryNotAvailableError.yaml index 1e5857dabc..7b9010e157 100644 --- a/ext/openAPI/components/schemas/errors/http/TemporaryNotAvailableError.yaml +++ b/ext/openAPI/components/schemas/errors/http/TemporaryNotAvailableError.yaml @@ -1,2 +1,8 @@ allOf: - $ref: "../ApiError.yaml" +example: + general: + status: 503 + title: "Endpoint Temporarily not Available" + detail: "The endpoint is temporarily not available, please try again later." + type: "https://hivemq.com/edge/api/model/TemporaryNotAvailableError" diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java index 0a9ceac9dc..03f98ef7b3 100644 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java @@ -105,8 +105,8 @@ private HttpErrorFactory() { public static @NotNull TemporaryNotAvailableError temporaryNotAvailableError() { return TemporaryNotAvailableError.builder() .type(type(TemporaryNotAvailableError.class)) - .title("The endpoint is temporarily not available") - .detail("The endpoint is temporarily not available, please try again later") + .title("Endpoint Temporarily not Available") + .detail("The endpoint is temporarily not available, please try again later.") .status(HttpStatus.SERVICE_UNAVAILABLE_503) .build(); } From 6d255e0ea90b9694571950896b31c30c5c155aad Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Wed, 11 Jun 2025 10:08:43 +0200 Subject: [PATCH 056/121] refactor: Add example to UrlParameterMissingError --- ext/hivemq-edge-openapi-2025.9.yaml | 7 +++++++ .../schemas/errors/http/UrlParameterMissingError.yaml | 7 +++++++ .../main/java/com/hivemq/api/errors/HttpErrorFactory.java | 4 ++-- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index a7adc4440e..f4e36a70e1 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -5690,6 +5690,13 @@ components: description: The name of the missing parameter. required: - parameter + example: + general: + status: 400 + title: Required URL Parameter Missing + detail: Required URL parameter 'a' is missing. + parameter: a + type: https://hivemq.com/edge/api/model/UrlParameterMissingError JsonNode: type: object description: The arguments of the fsm derived from the behavior policy. diff --git a/ext/openAPI/components/schemas/errors/http/UrlParameterMissingError.yaml b/ext/openAPI/components/schemas/errors/http/UrlParameterMissingError.yaml index 7a9c0e2836..e3a14e67df 100644 --- a/ext/openAPI/components/schemas/errors/http/UrlParameterMissingError.yaml +++ b/ext/openAPI/components/schemas/errors/http/UrlParameterMissingError.yaml @@ -7,3 +7,10 @@ allOf: description: The name of the missing parameter. required: - parameter +example: + general: + status: 400 + title: "Required URL Parameter Missing" + detail: "Required URL parameter 'a' is missing." + parameter: "a" + type: "https://hivemq.com/edge/api/model/UrlParameterMissingError" diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java index 03f98ef7b3..07749091ef 100644 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java @@ -114,8 +114,8 @@ private HttpErrorFactory() { public static @NotNull UrlParameterMissingError urlParameterMissingError(final @NotNull String parameter) { return UrlParameterMissingError.builder() .type(type(UrlParameterMissingError.class)) - .title("Required url parameter missing") - .detail("Required url parameter '" + parameter + "' missing") + .title("Required URL Parameter Missing") + .detail("Required URL parameter '" + parameter + "' is missing.") .parameter(parameter) .status(HttpStatus.BAD_REQUEST_400) .build(); From a2188a5ee6c2c5508cb3078f8cc3f101badcd5b1 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Wed, 11 Jun 2025 10:24:12 +0200 Subject: [PATCH 057/121] refactor: Add example to AtLeastOneFieldMissingValidationError --- ext/hivemq-edge-openapi-2025.9.yaml | 10 ++++++++++ .../AtLeastOneFieldMissingValidationError.yaml | 10 ++++++++++ .../hivemq/api/errors/ValidationErrorFactory.java | 15 +++++++++++++++ 3 files changed, 35 insertions(+) diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index f4e36a70e1..0f72dd91ed 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -4947,8 +4947,18 @@ components: type: string format: json-path description: The json path. + example: + - $.field1 + - $.field2 required: - paths + example: + general: + detail: 'At least one of the fields must be present: ''$.field1'', ''$.field2''.' + paths: + - $.field1 + - $.field2 + type: https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError AtMostOneFunctionValidationError: allOf: - $ref: '#/components/schemas/ValidationError' diff --git a/ext/openAPI/components/schemas/errors/validation/AtLeastOneFieldMissingValidationError.yaml b/ext/openAPI/components/schemas/errors/validation/AtLeastOneFieldMissingValidationError.yaml index 2670385dfd..ff2f77a449 100644 --- a/ext/openAPI/components/schemas/errors/validation/AtLeastOneFieldMissingValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/validation/AtLeastOneFieldMissingValidationError.yaml @@ -9,5 +9,15 @@ allOf: type: string format: json-path description: The json path. + example: + - "$.field1" + - "$.field2" required: - paths +example: + general: + detail: "At least one of the fields must be present: '$.field1', '$.field2'." + paths: + - "$.field1" + - "$.field2" + type: "https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError" diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/ValidationErrorFactory.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/ValidationErrorFactory.java index 14b6428c2e..642ebe3058 100644 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/ValidationErrorFactory.java +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/ValidationErrorFactory.java @@ -16,6 +16,7 @@ package com.hivemq.api.errors; +import com.hivemq.edge.api.model.AtLeastOneFieldMissingValidationError; import com.hivemq.edge.api.model.EmptyFieldValidationError; import com.hivemq.edge.api.model.InvalidFieldLengthValidationError; import com.hivemq.edge.api.model.InvalidFieldValueValidationError; @@ -24,11 +25,25 @@ import com.hivemq.edge.api.model.UnsupportedFieldValidationError; import org.jetbrains.annotations.NotNull; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; + public final class ValidationErrorFactory extends ErrorFactory { private ValidationErrorFactory() { super(); } + public static @NotNull AtLeastOneFieldMissingValidationError atLeastOneFieldMissingValidationError(final @NotNull String... paths) { + return AtLeastOneFieldMissingValidationError.builder() + .type(type(AtLeastOneFieldMissingValidationError.class)) + .detail("At least one of the fields must be present: " + + Stream.of(paths).map(path -> "'" + path + "'").collect(Collectors.joining(", ")) + + ".") + .paths(List.of(paths)) + .build(); + } + public static @NotNull EmptyFieldValidationError emptyFieldValidationError( final @NotNull String path) { return emptyFieldValidationError("Required field '" + path + "' is empty", path); From ebee6658b294217853e369fc5de0d8f792565afe Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Wed, 11 Jun 2025 10:30:33 +0200 Subject: [PATCH 058/121] refactor: Add example to EmptyFieldValidationError --- ext/hivemq-edge-openapi-2025.9.yaml | 6 ++++++ .../errors/validation/EmptyFieldValidationError.yaml | 6 ++++++ .../java/com/hivemq/api/errors/ValidationErrorFactory.java | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index 0f72dd91ed..eb1c2b34e8 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -4990,8 +4990,14 @@ components: type: string format: json-path description: The missing field. + example: $.field required: - path + example: + general: + detail: Required field '$.field' is empty. + path: $.field + type: https://hivemq.com/edge/api/model/EmptyFieldValidationError FunctionMustBePairedValidationError: allOf: - $ref: '#/components/schemas/ValidationError' diff --git a/ext/openAPI/components/schemas/errors/validation/EmptyFieldValidationError.yaml b/ext/openAPI/components/schemas/errors/validation/EmptyFieldValidationError.yaml index bf904d5176..021b4f1a64 100644 --- a/ext/openAPI/components/schemas/errors/validation/EmptyFieldValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/validation/EmptyFieldValidationError.yaml @@ -6,5 +6,11 @@ allOf: type: string format: json-path description: The missing field. + example: "$.field" required: - path +example: + general: + detail: "Required field '$.field' is empty." + path: "$.field" + type: "https://hivemq.com/edge/api/model/EmptyFieldValidationError" diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/ValidationErrorFactory.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/ValidationErrorFactory.java index 642ebe3058..bb17804b0a 100644 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/ValidationErrorFactory.java +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/ValidationErrorFactory.java @@ -46,7 +46,7 @@ private ValidationErrorFactory() { public static @NotNull EmptyFieldValidationError emptyFieldValidationError( final @NotNull String path) { - return emptyFieldValidationError("Required field '" + path + "' is empty", path); + return emptyFieldValidationError("Required field '" + path + "' is empty.", path); } public static @NotNull EmptyFieldValidationError emptyFieldValidationError( From 05a8e2c1b17a4bc75b00a8b5589ebd634c639a3d Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Wed, 11 Jun 2025 12:51:10 +0200 Subject: [PATCH 059/121] refactor: Add example to InvalidFieldLengthValidationError --- ext/hivemq-edge-openapi-2025.9.yaml | 16 ++++++++++++++++ .../InvalidFieldLengthValidationError.yaml | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index eb1c2b34e8..6a2f5aff76 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -5073,27 +5073,43 @@ components: type: integer format: int32 description: The actual length of the field value. + example: 10 expectedMinimumLength: type: integer format: int32 description: The minimum length expected for the field value. + minimum: 0 + example: 5 expectedMaximumLength: type: integer format: int32 description: The maximum length expected for the field value. + minimum: 0 + example: 20 path: type: string format: json-path description: The invalid json path. + example: $.field value: type: string description: The invalid value. + example: value required: - actualLength - expectedMinimumLength - expectedMaximumLength - path - value + example: + general: + detail: The length of script field '$.id' 32 must be between 0 and 20. + actualLength: 32 + minimumLength: 0 + maximumLength: 20 + path: $.field + value: The early bird catches the worm. + type: https://hivemq.com/edge/api/model/EmptyFieldValidationError InvalidFieldValueValidationError: allOf: - $ref: '#/components/schemas/ValidationError' diff --git a/ext/openAPI/components/schemas/errors/validation/InvalidFieldLengthValidationError.yaml b/ext/openAPI/components/schemas/errors/validation/InvalidFieldLengthValidationError.yaml index b819dba342..2925ace6fe 100644 --- a/ext/openAPI/components/schemas/errors/validation/InvalidFieldLengthValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/validation/InvalidFieldLengthValidationError.yaml @@ -6,24 +6,40 @@ allOf: type: integer format: int32 description: The actual length of the field value. + example: 10 expectedMinimumLength: type: integer format: int32 description: The minimum length expected for the field value. + minimum: 0 + example: 5 expectedMaximumLength: type: integer format: int32 description: The maximum length expected for the field value. + minimum: 0 + example: 20 path: type: string format: json-path description: The invalid json path. + example: "$.field" value: type: string description: The invalid value. + example: "value" required: - actualLength - expectedMinimumLength - expectedMaximumLength - path - value +example: + general: + detail: "The length of script field '$.id' 32 must be between 0 and 20." + actualLength: 32 + minimumLength: 0 + maximumLength: 20 + path: "$.field" + value: "The early bird catches the worm." + type: "https://hivemq.com/edge/api/model/EmptyFieldValidationError" From ae5e5a471ad13537d76a5deb10ddbd5c17dff082 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Wed, 11 Jun 2025 13:02:28 +0200 Subject: [PATCH 060/121] refactor: Add example to InvalidFieldValueValidationError --- ext/hivemq-edge-openapi-2025.9.yaml | 12 ++++++++++-- .../InvalidFieldLengthValidationError.yaml | 4 ++-- .../validation/InvalidFieldValueValidationError.yaml | 8 ++++++++ 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index 6a2f5aff76..83b08ac76b 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -5094,7 +5094,7 @@ components: value: type: string description: The invalid value. - example: value + example: The early bird catches the worm. required: - actualLength - expectedMinimumLength @@ -5109,7 +5109,7 @@ components: maximumLength: 20 path: $.field value: The early bird catches the worm. - type: https://hivemq.com/edge/api/model/EmptyFieldValidationError + type: https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError InvalidFieldValueValidationError: allOf: - $ref: '#/components/schemas/ValidationError' @@ -5119,12 +5119,20 @@ components: type: string format: json-path description: The invalid json path. + example: $.action.pipeline[1].field value: type: string description: The invalid value. + example: Practice makes perfect. required: - path - value + example: + general: + detail: Referenced function does not exist. + path: $.action.pipeline[1].field + value: Practice makes perfect. + type: https://hivemq.com/edge/api/model/InvalidFieldValueValidationError InvalidFunctionOrderValidationError: allOf: - $ref: '#/components/schemas/ValidationError' diff --git a/ext/openAPI/components/schemas/errors/validation/InvalidFieldLengthValidationError.yaml b/ext/openAPI/components/schemas/errors/validation/InvalidFieldLengthValidationError.yaml index 2925ace6fe..dca643cef8 100644 --- a/ext/openAPI/components/schemas/errors/validation/InvalidFieldLengthValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/validation/InvalidFieldLengthValidationError.yaml @@ -27,7 +27,7 @@ allOf: value: type: string description: The invalid value. - example: "value" + example: "The early bird catches the worm." required: - actualLength - expectedMinimumLength @@ -42,4 +42,4 @@ example: maximumLength: 20 path: "$.field" value: "The early bird catches the worm." - type: "https://hivemq.com/edge/api/model/EmptyFieldValidationError" + type: "https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError" diff --git a/ext/openAPI/components/schemas/errors/validation/InvalidFieldValueValidationError.yaml b/ext/openAPI/components/schemas/errors/validation/InvalidFieldValueValidationError.yaml index fb3b1384fa..818123823e 100644 --- a/ext/openAPI/components/schemas/errors/validation/InvalidFieldValueValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/validation/InvalidFieldValueValidationError.yaml @@ -6,9 +6,17 @@ allOf: type: string format: json-path description: The invalid json path. + example: "$.action.pipeline[1].field" value: type: string description: The invalid value. + example: "Practice makes perfect." required: - path - value +example: + general: + detail: "Referenced function does not exist." + path: "$.action.pipeline[1].field" + value: "Practice makes perfect." + type: "https://hivemq.com/edge/api/model/InvalidFieldValueValidationError" From 47d6be0f4c8133ff851caa882208d3e9eaee202b Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Wed, 11 Jun 2025 13:43:57 +0200 Subject: [PATCH 061/121] refactor: Add example to InvalidIdentifierValidationError --- ext/hivemq-edge-openapi-2025.9.yaml | 22 +++++++++++++------ .../InvalidFieldLengthValidationError.yaml | 10 ++++----- .../InvalidFieldValueValidationError.yaml | 4 ++-- .../InvalidIdentifierValidationError.yaml | 8 +++++++ 4 files changed, 30 insertions(+), 14 deletions(-) diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index 83b08ac76b..7757363e78 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -5094,7 +5094,7 @@ components: value: type: string description: The invalid value. - example: The early bird catches the worm. + example: function transform() { return 'Hello, World!'; } required: - actualLength - expectedMinimumLength @@ -5103,12 +5103,12 @@ components: - value example: general: - detail: The length of script field '$.id' 32 must be between 0 and 20. - actualLength: 32 + detail: The length of script field '$.transform' 48 must be between 0 and 20. + actualLength: 48 minimumLength: 0 maximumLength: 20 - path: $.field - value: The early bird catches the worm. + path: $.transform + value: function transform() { return 'Hello, World!'; } type: https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError InvalidFieldValueValidationError: allOf: @@ -5123,7 +5123,7 @@ components: value: type: string description: The invalid value. - example: Practice makes perfect. + example: functionDoesNotExist required: - path - value @@ -5131,7 +5131,7 @@ components: general: detail: Referenced function does not exist. path: $.action.pipeline[1].field - value: Practice makes perfect. + value: functionDoesNotExist type: https://hivemq.com/edge/api/model/InvalidFieldValueValidationError InvalidFunctionOrderValidationError: allOf: @@ -5161,12 +5161,20 @@ components: type: string format: json-path description: The invalid identifier path. + example: $.id value: type: string description: The invalid identifier value. + example: invalidId required: - path - value + example: + general: + detail: Identifier script 'id' must begin with a letter and may only consist of lowercase letters, uppercase letters, numbers, periods, hyphens, and underscores. + path: $.id + value: invalidId + type: https://hivemq.com/edge/api/model/InvalidIdentifierValidationError MissingFieldValidationError: allOf: - $ref: '#/components/schemas/ValidationError' diff --git a/ext/openAPI/components/schemas/errors/validation/InvalidFieldLengthValidationError.yaml b/ext/openAPI/components/schemas/errors/validation/InvalidFieldLengthValidationError.yaml index dca643cef8..4d7ac61029 100644 --- a/ext/openAPI/components/schemas/errors/validation/InvalidFieldLengthValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/validation/InvalidFieldLengthValidationError.yaml @@ -27,7 +27,7 @@ allOf: value: type: string description: The invalid value. - example: "The early bird catches the worm." + example: "function transform() { return 'Hello, World!'; }" required: - actualLength - expectedMinimumLength @@ -36,10 +36,10 @@ allOf: - value example: general: - detail: "The length of script field '$.id' 32 must be between 0 and 20." - actualLength: 32 + detail: "The length of script field '$.transform' 48 must be between 0 and 20." + actualLength: 48 minimumLength: 0 maximumLength: 20 - path: "$.field" - value: "The early bird catches the worm." + path: "$.transform" + value: "function transform() { return 'Hello, World!'; }" type: "https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError" diff --git a/ext/openAPI/components/schemas/errors/validation/InvalidFieldValueValidationError.yaml b/ext/openAPI/components/schemas/errors/validation/InvalidFieldValueValidationError.yaml index 818123823e..acaa8a7017 100644 --- a/ext/openAPI/components/schemas/errors/validation/InvalidFieldValueValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/validation/InvalidFieldValueValidationError.yaml @@ -10,7 +10,7 @@ allOf: value: type: string description: The invalid value. - example: "Practice makes perfect." + example: "functionDoesNotExist" required: - path - value @@ -18,5 +18,5 @@ example: general: detail: "Referenced function does not exist." path: "$.action.pipeline[1].field" - value: "Practice makes perfect." + value: "functionDoesNotExist" type: "https://hivemq.com/edge/api/model/InvalidFieldValueValidationError" diff --git a/ext/openAPI/components/schemas/errors/validation/InvalidIdentifierValidationError.yaml b/ext/openAPI/components/schemas/errors/validation/InvalidIdentifierValidationError.yaml index 792dc493db..d9338bb200 100644 --- a/ext/openAPI/components/schemas/errors/validation/InvalidIdentifierValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/validation/InvalidIdentifierValidationError.yaml @@ -6,9 +6,17 @@ allOf: type: string format: json-path description: The invalid identifier path. + example: "$.id" value: type: string description: The invalid identifier value. + example: "invalidId" required: - path - value +example: + general: + detail: "Identifier script 'id' must begin with a letter and may only consist of lowercase letters, uppercase letters, numbers, periods, hyphens, and underscores." + path: "$.id" + value: "invalidId" + type: "https://hivemq.com/edge/api/model/InvalidIdentifierValidationError" From d3ce138b0e621314bdabdf046b034b1e3a957e86 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Wed, 11 Jun 2025 13:53:13 +0200 Subject: [PATCH 062/121] refactor: Add example to MissingFieldValidationError, UnsupportedFieldValidationError --- ext/hivemq-edge-openapi-2025.9.yaml | 14 ++++++++++++++ .../validation/MissingFieldValidationError.yaml | 6 ++++++ .../UnsupportedFieldValidationError.yaml | 8 ++++++++ 3 files changed, 28 insertions(+) diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index 7757363e78..941b2c59b1 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -5184,8 +5184,14 @@ components: type: string format: json-path description: The missing path. + example: $.id required: - path + example: + general: + detail: Required field '$.id' is missing. + path: $.id + type: https://hivemq.com/edge/api/model/MissingFieldValidationError UnknownVariableValidationError: allOf: - $ref: '#/components/schemas/ValidationError' @@ -5217,10 +5223,18 @@ components: type: string format: json-path description: The json path. + example: $.id required: - actualValue - expectedValue - path + example: + general: + detail: Unsupported type 'String' for field '$.id'. Expected type is 'Object'. + actualValue: String + expectedValue: Object + path: $.id + type: https://hivemq.com/edge/api/model/UnsupportedFieldValidationError BehaviorPolicyValidationError: allOf: - $ref: '#/components/schemas/ValidationError' diff --git a/ext/openAPI/components/schemas/errors/validation/MissingFieldValidationError.yaml b/ext/openAPI/components/schemas/errors/validation/MissingFieldValidationError.yaml index 94ddef88c3..9c929ecb7f 100644 --- a/ext/openAPI/components/schemas/errors/validation/MissingFieldValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/validation/MissingFieldValidationError.yaml @@ -6,5 +6,11 @@ allOf: type: string format: json-path description: The missing path. + example: "$.id" required: - path +example: + general: + detail: "Required field '$.id' is missing." + path: "$.id" + type: "https://hivemq.com/edge/api/model/MissingFieldValidationError" diff --git a/ext/openAPI/components/schemas/errors/validation/UnsupportedFieldValidationError.yaml b/ext/openAPI/components/schemas/errors/validation/UnsupportedFieldValidationError.yaml index 3a160152fa..32276a7885 100644 --- a/ext/openAPI/components/schemas/errors/validation/UnsupportedFieldValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/validation/UnsupportedFieldValidationError.yaml @@ -12,7 +12,15 @@ allOf: type: string format: json-path description: The json path. + example: "$.id" required: - actualValue - expectedValue - path +example: + general: + detail: "Unsupported type 'String' for field '$.id'. Expected type is 'Object'." + actualValue: "String" + expectedValue: "Object" + path: "$.id" + type: "https://hivemq.com/edge/api/model/UnsupportedFieldValidationError" From 19c91210c63b17f6379b5d097253693c9885543a Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Wed, 11 Jun 2025 13:59:07 +0200 Subject: [PATCH 063/121] refactor: Add example to BehaviorPolicyAlreadyPresentError --- ext/hivemq-edge-openapi-2025.9.yaml | 10 +++++++--- .../datahub/BehaviorPolicyAlreadyPresentError.yaml | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index 941b2c59b1..ae8baee876 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -4890,11 +4890,15 @@ components: id: type: string description: The behavior policy id. - message: - type: string - description: The error message. + example: abc required: - id + example: + general: + title: Behavior Policy Already Present + detail: The given behavior policy 'abc' is already present. + id: abc + type: https://hivemq.com/edge/api/model/BehaviorPolicyAlreadyPresentError BehaviorPolicyCreationFailureError: allOf: - $ref: '#/components/schemas/ApiError' diff --git a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyAlreadyPresentError.yaml b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyAlreadyPresentError.yaml index c7c394b81a..101345371d 100644 --- a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyAlreadyPresentError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyAlreadyPresentError.yaml @@ -5,8 +5,12 @@ allOf: id: type: string description: The behavior policy id. - message: - type: string - description: The error message. + example: "abc" required: - id +example: + general: + title: "Behavior Policy Already Present" + detail: "The given behavior policy 'abc' is already present." + id: "abc" + type: "https://hivemq.com/edge/api/model/BehaviorPolicyAlreadyPresentError" From 6abf37d2e9ccc77661cb29cc2fe58b9873c09931 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Wed, 11 Jun 2025 14:04:43 +0200 Subject: [PATCH 064/121] refactor: Add example to BehaviorPolicyCreationFailureError --- ext/hivemq-edge-openapi-2025.9.yaml | 14 +++++++------- .../datahub/BehaviorPolicyAlreadyPresentError.yaml | 1 + .../BehaviorPolicyCreationFailureError.yaml | 13 ++++++------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index ae8baee876..b649ffc084 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -4895,6 +4895,7 @@ components: - id example: general: + status: 409 title: Behavior Policy Already Present detail: The given behavior policy 'abc' is already present. id: abc @@ -4902,13 +4903,12 @@ components: BehaviorPolicyCreationFailureError: allOf: - $ref: '#/components/schemas/ApiError' - - type: object - properties: - reason: - type: string - description: The actual reason. - required: - - reason + example: + general: + status: 400 + title: Behavior Policy Creation Failed + detail: 'Behavior policy creation failed: The policy was rejected.' + type: https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError ValidationError: type: object properties: diff --git a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyAlreadyPresentError.yaml b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyAlreadyPresentError.yaml index 101345371d..0b1225c9bf 100644 --- a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyAlreadyPresentError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyAlreadyPresentError.yaml @@ -10,6 +10,7 @@ allOf: - id example: general: + status: 409 title: "Behavior Policy Already Present" detail: "The given behavior policy 'abc' is already present." id: "abc" diff --git a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyCreationFailureError.yaml b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyCreationFailureError.yaml index ea854eb9cc..6414c485e6 100644 --- a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyCreationFailureError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyCreationFailureError.yaml @@ -1,9 +1,8 @@ allOf: - $ref: "../ApiError.yaml" - - type: object - properties: - reason: - type: string - description: The actual reason. - required: - - reason +example: + general: + status: 400 + title: "Behavior Policy Creation Failed" + detail: "Behavior policy creation failed: The policy was rejected." + type: "https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError" From 1820eee355df912b57cd2fc6e0ebd6ce0b0662f4 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Wed, 11 Jun 2025 14:25:13 +0200 Subject: [PATCH 065/121] refactor: Add example to BehaviorPolicyInvalidErrors --- ext/hivemq-edge-openapi-2025.9.yaml | 13 +++++++++++++ .../errors/datahub/BehaviorPolicyInvalidErrors.yaml | 13 +++++++++++++ 2 files changed, 26 insertions(+) diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index b649ffc084..f66a301553 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -5278,6 +5278,19 @@ components: $ref: '#/components/schemas/BehaviorPolicyValidationError' required: - childErrors + example: + general: + status: 400 + title: Behavior Policy Invalid + detail: Behavior policy is invalid due to validation errors. + type: https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors + childErrors: + - detail: The transition from state 'state1' to state 'state2' on event 'event1' in '$.path' is not defined for behavior 'id1'. + fromState: state1 + toState: state2 + path: $.path + id: id1 + type: https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError BehaviorPolicyNotFoundError: allOf: - $ref: '#/components/schemas/ApiError' diff --git a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyInvalidErrors.yaml b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyInvalidErrors.yaml index fe57f77b68..4b385f874a 100644 --- a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyInvalidErrors.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyInvalidErrors.yaml @@ -9,3 +9,16 @@ allOf: $ref: "./BehaviorPolicyValidationError.yaml" required: - childErrors +example: + general: + status: 400 + title: "Behavior Policy Invalid" + detail: "Behavior policy is invalid due to validation errors." + type: "https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors" + childErrors: + - detail: "The transition from state 'state1' to state 'state2' on event 'event1' in '$.path' is not defined for behavior 'id1'." + fromState: "state1" + toState: "state2" + path: "$.path" + id: "id1" + type: "https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError" From 93f39110ce57699636d9b85c316d41e96dcc40d9 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Wed, 11 Jun 2025 14:28:35 +0200 Subject: [PATCH 066/121] refactor: Add example to BehaviorPolicyNotFoundError --- ext/hivemq-edge-openapi-2025.9.yaml | 10 +++++++--- .../errors/datahub/BehaviorPolicyNotFoundError.yaml | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index f66a301553..17cb5a032a 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -5299,11 +5299,15 @@ components: id: type: string description: The data policy id. - message: - type: string - description: The error message. required: - id + example: + general: + status: 404 + title: Behavior Policy Not Found + detail: Behavior policy with ID 'abc' not found. + id: abc + type: https://hivemq.com/edge/api/model/BehaviorPolicyNotFoundError BehaviorPolicyRejectedError: allOf: - $ref: '#/components/schemas/ApiError' diff --git a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyNotFoundError.yaml b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyNotFoundError.yaml index 725d9fbdb6..29a1b01ea9 100644 --- a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyNotFoundError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyNotFoundError.yaml @@ -5,8 +5,12 @@ allOf: id: type: string description: The data policy id. - message: - type: string - description: The error message. required: - id +example: + general: + status: 404 + title: "Behavior Policy Not Found" + detail: "Behavior policy with ID 'abc' not found." + id: "abc" + type: "https://hivemq.com/edge/api/model/BehaviorPolicyNotFoundError" From 1d5bea18cf7945ce2b77acc602db4d2b6fe28919 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Wed, 11 Jun 2025 14:38:30 +0200 Subject: [PATCH 067/121] refactor: Add example to BehaviorPolicyRejectedError, BehaviorPolicyUpdateFailureError --- ext/hivemq-edge-openapi-2025.9.yaml | 17 ++++++++++++++--- .../datahub/BehaviorPolicyRejectedError.yaml | 7 +++++++ .../BehaviorPolicyUpdateFailureError.yaml | 10 +++++++--- 3 files changed, 28 insertions(+), 6 deletions(-) diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index 17cb5a032a..567c672153 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -5311,6 +5311,13 @@ components: BehaviorPolicyRejectedError: allOf: - $ref: '#/components/schemas/ApiError' + example: + general: + status: 400 + title: Behavior Policy Rejected + detail: Behavior policy is rejected. + id: abc + type: https://hivemq.com/edge/api/model/BehaviorPolicyRejectedError BehaviorPolicyUpdateFailureError: allOf: - $ref: '#/components/schemas/ApiError' @@ -5319,11 +5326,15 @@ components: id: type: string description: The ID of the policy that failed to update. - reason: - type: string - description: The actual reason. required: - id + example: + general: + status: 400 + title: Behavior Policy Update Failed + detail: Behavior policy with ID 'abc' update failed. + id: abc + type: https://hivemq.com/edge/api/model/BehaviorPolicyUpdateFailureError ClientDisconnectedError: allOf: - $ref: '#/components/schemas/ApiError' diff --git a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyRejectedError.yaml b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyRejectedError.yaml index 1e5857dabc..2e15ee3bc1 100644 --- a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyRejectedError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyRejectedError.yaml @@ -1,2 +1,9 @@ allOf: - $ref: "../ApiError.yaml" +example: + general: + status: 400 + title: "Behavior Policy Rejected" + detail: "Behavior policy is rejected." + id: "abc" + type: "https://hivemq.com/edge/api/model/BehaviorPolicyRejectedError" diff --git a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyUpdateFailureError.yaml b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyUpdateFailureError.yaml index 023c38904f..cf8dd224b4 100644 --- a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyUpdateFailureError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyUpdateFailureError.yaml @@ -5,8 +5,12 @@ allOf: id: type: string description: The ID of the policy that failed to update. - reason: - type: string - description: The actual reason. required: - id +example: + general: + status: 400 + title: "Behavior Policy Update Failed" + detail: "Behavior policy with ID 'abc' update failed." + id: "abc" + type: "https://hivemq.com/edge/api/model/BehaviorPolicyUpdateFailureError" From 523a8b3fe18bc0fa837ae1f2b825a28419f45ca3 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Wed, 11 Jun 2025 15:09:11 +0200 Subject: [PATCH 068/121] refactor: Add example to ClientDisconnectedError, ClientNotFoundError --- ext/hivemq-edge-openapi-2025.9.yaml | 19 ++++++++++++++++++- .../datahub/BehaviorPolicyNotFoundError.yaml | 1 + .../datahub/BehaviorPolicyRejectedError.yaml | 1 - .../BehaviorPolicyUpdateFailureError.yaml | 1 + .../datahub/ClientDisconnectedError.yaml | 8 ++++++++ .../errors/datahub/ClientNotFoundError.yaml | 8 ++++++++ 6 files changed, 36 insertions(+), 2 deletions(-) diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index 567c672153..710029aeac 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -5299,6 +5299,7 @@ components: id: type: string description: The data policy id. + example: abc required: - id example: @@ -5316,7 +5317,6 @@ components: status: 400 title: Behavior Policy Rejected detail: Behavior policy is rejected. - id: abc type: https://hivemq.com/edge/api/model/BehaviorPolicyRejectedError BehaviorPolicyUpdateFailureError: allOf: @@ -5326,6 +5326,7 @@ components: id: type: string description: The ID of the policy that failed to update. + example: abc required: - id example: @@ -5343,8 +5344,16 @@ components: id: type: string description: The client id. + example: abc required: - id + example: + general: + status: 404 + title: Client Disconnected + detail: Client with ID 'abc' is disconnected. + id: abc + type: https://hivemq.com/edge/api/model/ClientDisconnectedError ClientNotFoundError: allOf: - $ref: '#/components/schemas/ApiError' @@ -5353,8 +5362,16 @@ components: id: type: string description: The client id. + example: abc required: - id + example: + general: + status: 404 + title: Client Not Found + detail: Client with ID 'abc' is not found. + id: abc + type: https://hivemq.com/edge/api/model/ClientNotFoundError DataPolicyAlreadyPresentError: allOf: - $ref: '#/components/schemas/ApiError' diff --git a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyNotFoundError.yaml b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyNotFoundError.yaml index 29a1b01ea9..7f8a9a29bc 100644 --- a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyNotFoundError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyNotFoundError.yaml @@ -5,6 +5,7 @@ allOf: id: type: string description: The data policy id. + example: "abc" required: - id example: diff --git a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyRejectedError.yaml b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyRejectedError.yaml index 2e15ee3bc1..ae7987bb8a 100644 --- a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyRejectedError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyRejectedError.yaml @@ -5,5 +5,4 @@ example: status: 400 title: "Behavior Policy Rejected" detail: "Behavior policy is rejected." - id: "abc" type: "https://hivemq.com/edge/api/model/BehaviorPolicyRejectedError" diff --git a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyUpdateFailureError.yaml b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyUpdateFailureError.yaml index cf8dd224b4..d9d95bd99f 100644 --- a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyUpdateFailureError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyUpdateFailureError.yaml @@ -5,6 +5,7 @@ allOf: id: type: string description: The ID of the policy that failed to update. + example: "abc" required: - id example: diff --git a/ext/openAPI/components/schemas/errors/datahub/ClientDisconnectedError.yaml b/ext/openAPI/components/schemas/errors/datahub/ClientDisconnectedError.yaml index c0478f4549..07ef630c53 100644 --- a/ext/openAPI/components/schemas/errors/datahub/ClientDisconnectedError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/ClientDisconnectedError.yaml @@ -5,5 +5,13 @@ allOf: id: type: string description: The client id. + example: "abc" required: - id +example: + general: + status: 404 + title: "Client Disconnected" + detail: "Client with ID 'abc' is disconnected." + id: "abc" + type: "https://hivemq.com/edge/api/model/ClientDisconnectedError" diff --git a/ext/openAPI/components/schemas/errors/datahub/ClientNotFoundError.yaml b/ext/openAPI/components/schemas/errors/datahub/ClientNotFoundError.yaml index c0478f4549..11a84180cc 100644 --- a/ext/openAPI/components/schemas/errors/datahub/ClientNotFoundError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/ClientNotFoundError.yaml @@ -5,5 +5,13 @@ allOf: id: type: string description: The client id. + example: "abc" required: - id +example: + general: + status: 404 + title: "Client Not Found" + detail: "Client with ID 'abc' is not found." + id: "abc" + type: "https://hivemq.com/edge/api/model/ClientNotFoundError" From fc4715ecc300296f4a307896ff7c39190482281e Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Wed, 11 Jun 2025 15:19:11 +0200 Subject: [PATCH 069/121] refactor: Add example to DataPolicyAlreadyPresentError --- ext/hivemq-edge-openapi-2025.9.yaml | 11 ++++++++--- .../errors/datahub/DataPolicyAlreadyPresentError.yaml | 11 ++++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index 710029aeac..0e7435c4fd 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -5380,11 +5380,16 @@ components: id: type: string description: The data policy id. - message: - type: string - description: The error message. + example: abc required: - id + example: + general: + status: 409 + title: Data Policy Already Present + detail: The given data policy 'abc' is already present. + id: abc + type: https://hivemq.com/edge/api/model/DataPolicyAlreadyPresentError DataPolicyCreationFailureError: allOf: - $ref: '#/components/schemas/ApiError' diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyAlreadyPresentError.yaml b/ext/openAPI/components/schemas/errors/datahub/DataPolicyAlreadyPresentError.yaml index 725d9fbdb6..0dc5bb19ea 100644 --- a/ext/openAPI/components/schemas/errors/datahub/DataPolicyAlreadyPresentError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/DataPolicyAlreadyPresentError.yaml @@ -5,8 +5,13 @@ allOf: id: type: string description: The data policy id. - message: - type: string - description: The error message. + example: "abc" required: - id +example: + general: + status: 409 + title: "Data Policy Already Present" + detail: "The given data policy 'abc' is already present." + id: "abc" + type: "https://hivemq.com/edge/api/model/DataPolicyAlreadyPresentError" From e345d363aee286f9c971cbd6bf118b3290595059 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Wed, 11 Jun 2025 15:22:32 +0200 Subject: [PATCH 070/121] refactor: Add example to DataPolicyCreationFailureError --- ext/hivemq-edge-openapi-2025.9.yaml | 13 ++++++------- .../datahub/DataPolicyCreationFailureError.yaml | 13 ++++++------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index 0e7435c4fd..e8b675b29e 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -5393,13 +5393,12 @@ components: DataPolicyCreationFailureError: allOf: - $ref: '#/components/schemas/ApiError' - - type: object - properties: - reason: - type: string - description: The actual reason. - required: - - reason + example: + general: + status: 400 + title: Data Policy Creation Failed + detail: 'Data policy creation failed: The policy was rejected.' + type: https://hivemq.com/edge/api/model/DataPolicyCreationFailureError DataPolicyValidationError: allOf: - $ref: '#/components/schemas/ValidationError' diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyCreationFailureError.yaml b/ext/openAPI/components/schemas/errors/datahub/DataPolicyCreationFailureError.yaml index ea854eb9cc..a1af32fd93 100644 --- a/ext/openAPI/components/schemas/errors/datahub/DataPolicyCreationFailureError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/DataPolicyCreationFailureError.yaml @@ -1,9 +1,8 @@ allOf: - $ref: "../ApiError.yaml" - - type: object - properties: - reason: - type: string - description: The actual reason. - required: - - reason +example: + general: + status: 400 + title: "Data Policy Creation Failed" + detail: "Data policy creation failed: The policy was rejected." + type: "https://hivemq.com/edge/api/model/DataPolicyCreationFailureError" From 7c8e80e7810d6e0333a74dd96d1dc3dd94387c28 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Wed, 11 Jun 2025 15:37:34 +0200 Subject: [PATCH 071/121] refactor: Add example to DataPolicyInvalidErrors --- ext/hivemq-edge-openapi-2025.9.yaml | 15 +++++++++++++++ .../errors/datahub/DataPolicyInvalidErrors.yaml | 15 +++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index e8b675b29e..7e9c223ceb 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -5438,6 +5438,21 @@ components: $ref: '#/components/schemas/DataPolicyValidationError' required: - childErrors + example: + general: + status: 400 + title: Data Policy Invalid + detail: Data policy is invalid due to validation errors. + type: https://hivemq.com/edge/api/model/DataPolicyInvalidErrors + childErrors: + - detail: The pipeline must contain at most one 'function1' function, but 3 were found at ['$.path1', '$.path2', '$.path3']. + function: function1 + occurrences: 3 + paths: + - $.path1 + - $.path2 + - $.path3 + type: https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError DataPolicyNotFoundError: allOf: - $ref: '#/components/schemas/ApiError' diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyInvalidErrors.yaml b/ext/openAPI/components/schemas/errors/datahub/DataPolicyInvalidErrors.yaml index eb1641b65d..fc199bd7da 100644 --- a/ext/openAPI/components/schemas/errors/datahub/DataPolicyInvalidErrors.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/DataPolicyInvalidErrors.yaml @@ -9,3 +9,18 @@ allOf: $ref: "./DataPolicyValidationError.yaml" required: - childErrors +example: + general: + status: 400 + title: "Data Policy Invalid" + detail: "Data policy is invalid due to validation errors." + type: "https://hivemq.com/edge/api/model/DataPolicyInvalidErrors" + childErrors: + - detail: "The pipeline must contain at most one 'function1' function, but 3 were found at ['$.path1', '$.path2', '$.path3']." + function: "function1" + occurrences: 3 + paths: + - "$.path1" + - "$.path2" + - "$.path3" + type: "https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError" From 99592bf21dc003d3a99eb703a439d571196ae1f4 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Wed, 11 Jun 2025 15:51:30 +0200 Subject: [PATCH 072/121] refactor: Add example to DataPolicyNotFoundError, DataPolicyRejectedError, DataPolicyUpdateFailureError --- ext/hivemq-edge-openapi-2025.9.yaml | 30 ++++++++++++++----- .../datahub/BehaviorPolicyNotFoundError.yaml | 2 +- .../datahub/DataPolicyNotFoundError.yaml | 11 +++++-- .../datahub/DataPolicyRejectedError.yaml | 6 ++++ .../datahub/DataPolicyUpdateFailureError.yaml | 11 +++++-- 5 files changed, 46 insertions(+), 14 deletions(-) diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index 7e9c223ceb..611b3d6f49 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -5306,7 +5306,7 @@ components: general: status: 404 title: Behavior Policy Not Found - detail: Behavior policy with ID 'abc' not found. + detail: Behavior policy with ID 'abc' is not found. id: abc type: https://hivemq.com/edge/api/model/BehaviorPolicyNotFoundError BehaviorPolicyRejectedError: @@ -5461,14 +5461,25 @@ components: id: type: string description: The data policy id. - message: - type: string - description: The error message. + example: abc required: - id + example: + general: + status: 404 + title: Data Policy Not Found + detail: Data policy with ID 'abc' is not found. + id: abc + type: https://hivemq.com/edge/api/model/DataPolicyNotFoundError DataPolicyRejectedError: allOf: - $ref: '#/components/schemas/ApiError' + example: + general: + status: 400 + title: Data Policy Rejected + detail: Data policy is rejected. + type: https://hivemq.com/edge/api/model/DataPolicyRejectedError DataPolicyUpdateFailureError: allOf: - $ref: '#/components/schemas/ApiError' @@ -5477,11 +5488,16 @@ components: id: type: string description: The ID of the policy that failed to update. - reason: - type: string - description: The actual reason. + example: abc required: - id + example: + general: + status: 400 + title: Data Policy Update Failed + detail: Data policy with ID 'abc' update failed. + id: abc + type: https://hivemq.com/edge/api/model/DataPolicyUpdateFailureError PolicyIdMismatchError: allOf: - $ref: '#/components/schemas/ApiError' diff --git a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyNotFoundError.yaml b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyNotFoundError.yaml index 7f8a9a29bc..3351493f1a 100644 --- a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyNotFoundError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyNotFoundError.yaml @@ -12,6 +12,6 @@ example: general: status: 404 title: "Behavior Policy Not Found" - detail: "Behavior policy with ID 'abc' not found." + detail: "Behavior policy with ID 'abc' is not found." id: "abc" type: "https://hivemq.com/edge/api/model/BehaviorPolicyNotFoundError" diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyNotFoundError.yaml b/ext/openAPI/components/schemas/errors/datahub/DataPolicyNotFoundError.yaml index 725d9fbdb6..e5c58c44c5 100644 --- a/ext/openAPI/components/schemas/errors/datahub/DataPolicyNotFoundError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/DataPolicyNotFoundError.yaml @@ -5,8 +5,13 @@ allOf: id: type: string description: The data policy id. - message: - type: string - description: The error message. + example: "abc" required: - id +example: + general: + status: 404 + title: "Data Policy Not Found" + detail: "Data policy with ID 'abc' is not found." + id: "abc" + type: "https://hivemq.com/edge/api/model/DataPolicyNotFoundError" diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyRejectedError.yaml b/ext/openAPI/components/schemas/errors/datahub/DataPolicyRejectedError.yaml index 1e5857dabc..b49c566fc8 100644 --- a/ext/openAPI/components/schemas/errors/datahub/DataPolicyRejectedError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/DataPolicyRejectedError.yaml @@ -1,2 +1,8 @@ allOf: - $ref: "../ApiError.yaml" +example: + general: + status: 400 + title: "Data Policy Rejected" + detail: "Data policy is rejected." + type: "https://hivemq.com/edge/api/model/DataPolicyRejectedError" diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyUpdateFailureError.yaml b/ext/openAPI/components/schemas/errors/datahub/DataPolicyUpdateFailureError.yaml index 023c38904f..26784ea62f 100644 --- a/ext/openAPI/components/schemas/errors/datahub/DataPolicyUpdateFailureError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/DataPolicyUpdateFailureError.yaml @@ -5,8 +5,13 @@ allOf: id: type: string description: The ID of the policy that failed to update. - reason: - type: string - description: The actual reason. + example: "abc" required: - id +example: + general: + status: 400 + title: "Data Policy Update Failed" + detail: "Data policy with ID 'abc' update failed." + id: "abc" + type: "https://hivemq.com/edge/api/model/DataPolicyUpdateFailureError" From bbe0e372dec0847e9dee7c09049d8bde2bd785a3 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Wed, 11 Jun 2025 15:59:52 +0200 Subject: [PATCH 073/121] refactor: Add example to PolicyIdMismatchError, PolicyNotFoundError --- ext/hivemq-edge-openapi-2025.9.yaml | 17 +++++++++++++++++ .../errors/datahub/PolicyIdMismatchError.yaml | 9 +++++++++ .../errors/datahub/PolicyNotFoundError.yaml | 8 ++++++++ 3 files changed, 34 insertions(+) diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index 611b3d6f49..e9e30385a4 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -5506,12 +5506,21 @@ components: actualId: type: string description: The actual id. + example: id1 expectedId: type: string description: The expected id. + example: id2 required: - actualId - expectedId + example: + general: + status: 400 + title: Policy ID Mismatch + detail: The policy ID 'id1' in the request parameter does not match the policy ID 'id2' in the policy request body. + id: abc + type: https://hivemq.com/edge/api/model/PolicyIdMismatchError PolicyNotFoundError: allOf: - $ref: '#/components/schemas/ApiError' @@ -5520,8 +5529,16 @@ components: id: type: string description: The policy id. + example: abc required: - id + example: + general: + status: 404 + title: Policy Not Found + detail: Policy with ID 'abc' is not found. + id: abc + type: https://hivemq.com/edge/api/model/PolicyNotFoundError SchemaAlreadyPresentError: allOf: - $ref: '#/components/schemas/ApiError' diff --git a/ext/openAPI/components/schemas/errors/datahub/PolicyIdMismatchError.yaml b/ext/openAPI/components/schemas/errors/datahub/PolicyIdMismatchError.yaml index bddc51a565..ed7d44096b 100644 --- a/ext/openAPI/components/schemas/errors/datahub/PolicyIdMismatchError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/PolicyIdMismatchError.yaml @@ -5,9 +5,18 @@ allOf: actualId: type: string description: The actual id. + example: "id1" expectedId: type: string description: The expected id. + example: "id2" required: - actualId - expectedId +example: + general: + status: 400 + title: "Policy ID Mismatch" + detail: "The policy ID 'id1' in the request parameter does not match the policy ID 'id2' in the policy request body." + id: "abc" + type: "https://hivemq.com/edge/api/model/PolicyIdMismatchError" diff --git a/ext/openAPI/components/schemas/errors/datahub/PolicyNotFoundError.yaml b/ext/openAPI/components/schemas/errors/datahub/PolicyNotFoundError.yaml index 229810520b..d152dcacd5 100644 --- a/ext/openAPI/components/schemas/errors/datahub/PolicyNotFoundError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/PolicyNotFoundError.yaml @@ -5,5 +5,13 @@ allOf: id: type: string description: The policy id. + example: "abc" required: - id +example: + general: + status: 404 + title: "Policy Not Found" + detail: "Policy with ID 'abc' is not found." + id: "abc" + type: "https://hivemq.com/edge/api/model/PolicyNotFoundError" From 841cd9778a2e0ab878568a0177b008494c39d9dc Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Wed, 11 Jun 2025 17:02:33 +0200 Subject: [PATCH 074/121] refactor: Add example to SchemaAlreadyPresentError, SchemaEtagMismatchError --- ext/hivemq-edge-openapi-2025.9.yaml | 18 ++++++++++++++++++ .../datahub/SchemaAlreadyPresentError.yaml | 8 ++++++++ .../datahub/SchemaEtagMismatchError.yaml | 10 ++++++++++ 3 files changed, 36 insertions(+) diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index e9e30385a4..a58f835454 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -5547,8 +5547,16 @@ components: id: type: string description: The schema id. + example: abc required: - id + example: + general: + status: 409 + title: Schema Already Present + detail: The given schema is already present as the latest version for the schema id 'abc'. + id: abc + type: https://hivemq.com/edge/api/model/SchemaAlreadyPresentError SchemaEtagMismatchError: allOf: - $ref: '#/components/schemas/ApiError' @@ -5557,11 +5565,21 @@ components: id: type: string description: The schema id. + example: abc eTag: type: string description: The eTag. + example: 33a64df551425fcc55e4d42a148795d9f25f89d4 required: - id + example: + general: + status: 412 + title: Schema eTag Mismatch + detail: Schema with id 'abc' does not match the given etag '33a64df551425fcc55e4d42a148795d9f25f89d4'. + id: abc + eTag: 33a64df551425fcc55e4d42a148795d9f25f89d4 + type: https://hivemq.com/edge/api/model/SchemaEtagMismatchError SchemaValidationError: allOf: - $ref: '#/components/schemas/ValidationError' diff --git a/ext/openAPI/components/schemas/errors/datahub/SchemaAlreadyPresentError.yaml b/ext/openAPI/components/schemas/errors/datahub/SchemaAlreadyPresentError.yaml index 5a0d18a8d0..48432a577b 100644 --- a/ext/openAPI/components/schemas/errors/datahub/SchemaAlreadyPresentError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/SchemaAlreadyPresentError.yaml @@ -5,5 +5,13 @@ allOf: id: type: string description: The schema id. + example: "abc" required: - id +example: + general: + status: 409 + title: "Schema Already Present" + detail: "The given schema is already present as the latest version for the schema id 'abc'." + id: "abc" + type: "https://hivemq.com/edge/api/model/SchemaAlreadyPresentError" diff --git a/ext/openAPI/components/schemas/errors/datahub/SchemaEtagMismatchError.yaml b/ext/openAPI/components/schemas/errors/datahub/SchemaEtagMismatchError.yaml index 2fd9e5c8fe..58138271d9 100644 --- a/ext/openAPI/components/schemas/errors/datahub/SchemaEtagMismatchError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/SchemaEtagMismatchError.yaml @@ -5,8 +5,18 @@ allOf: id: type: string description: The schema id. + example: "abc" eTag: type: string description: The eTag. + example: "33a64df551425fcc55e4d42a148795d9f25f89d4" required: - id +example: + general: + status: 412 + title: "Schema eTag Mismatch" + detail: "Schema with id 'abc' does not match the given etag '33a64df551425fcc55e4d42a148795d9f25f89d4'." + id: "abc" + eTag: "33a64df551425fcc55e4d42a148795d9f25f89d4" + type: "https://hivemq.com/edge/api/model/SchemaEtagMismatchError" From 4de37ef085a655d6b381eabf9e9018110f887a19 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Wed, 11 Jun 2025 17:22:06 +0200 Subject: [PATCH 075/121] refactor: Add example to SchemaInvalidErrors --- ext/hivemq-edge-openapi-2025.9.yaml | 14 ++++++++++++++ .../errors/datahub/SchemaInvalidErrors.yaml | 14 ++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index a58f835454..1a756779b2 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -5611,6 +5611,20 @@ components: $ref: '#/components/schemas/SchemaValidationError' required: - childErrors + example: + general: + status: 400 + title: Schema Invalid + detail: Schema is invalid due to validation errors. + type: https://hivemq.com/edge/api/model/SchemaInvalidErrors + childErrors: + - detail: The length of script field '$.id' 1025 must be between 0 and 1024. + paths: $.id + value: aaa...aaa + actualLength: 1025 + expectedMinimumLength: 0 + expectedMaximumLength: 1024 + type: https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError SchemaNotFoundError: allOf: - $ref: '#/components/schemas/ApiError' diff --git a/ext/openAPI/components/schemas/errors/datahub/SchemaInvalidErrors.yaml b/ext/openAPI/components/schemas/errors/datahub/SchemaInvalidErrors.yaml index 4f05627d43..07b9039f7a 100644 --- a/ext/openAPI/components/schemas/errors/datahub/SchemaInvalidErrors.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/SchemaInvalidErrors.yaml @@ -9,3 +9,17 @@ allOf: $ref: "./SchemaValidationError.yaml" required: - childErrors +example: + general: + status: 400 + title: "Schema Invalid" + detail: "Schema is invalid due to validation errors." + type: "https://hivemq.com/edge/api/model/SchemaInvalidErrors" + childErrors: + - detail: "The length of script field '$.id' 1025 must be between 0 and 1024." + paths: "$.id" + value: "aaa...aaa" + actualLength: 1025 + expectedMinimumLength: 0 + expectedMaximumLength: 1024 + type: "https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError" From 97c0c9b15f4e234257b10f675b85b0ac7add6c92 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Thu, 12 Jun 2025 08:59:01 +0200 Subject: [PATCH 076/121] refactor: Add example to SchemaNotFoundError --- ext/hivemq-edge-openapi-2025.9.yaml | 11 ++++++++--- .../schemas/errors/datahub/SchemaNotFoundError.yaml | 11 ++++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index 1a756779b2..7488814776 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -5633,11 +5633,16 @@ components: id: type: string description: The schema ID. - message: - type: string - description: The error message. + example: abc required: - id + example: + general: + status: 404 + title: Schema Not Found + detail: Schema with ID 'abc' is not found. + id: abc + type: https://hivemq.com/edge/api/model/SchemaNotFoundError SchemaParsingFailureError: allOf: - $ref: '#/components/schemas/ApiError' diff --git a/ext/openAPI/components/schemas/errors/datahub/SchemaNotFoundError.yaml b/ext/openAPI/components/schemas/errors/datahub/SchemaNotFoundError.yaml index afd6212933..87c3f5d2b4 100644 --- a/ext/openAPI/components/schemas/errors/datahub/SchemaNotFoundError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/SchemaNotFoundError.yaml @@ -5,8 +5,13 @@ allOf: id: type: string description: The schema ID. - message: - type: string - description: The error message. + example: "abc" required: - id +example: + general: + status: 404 + title: "Schema Not Found" + detail: "Schema with ID 'abc' is not found." + id: "abc" + type: "https://hivemq.com/edge/api/model/SchemaNotFoundError" From e5554813b548a29b4d3e14d588d8d5e3611cc068 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Thu, 12 Jun 2025 09:09:05 +0200 Subject: [PATCH 077/121] refactor: Add example to SchemaParsingFailureError, SchemaReferencedError --- ext/hivemq-edge-openapi-2025.9.yaml | 23 +++++++++++++------ .../datahub/SchemaParsingFailureError.yaml | 12 ++++++---- .../errors/datahub/SchemaReferencedError.yaml | 11 ++++++--- 3 files changed, 32 insertions(+), 14 deletions(-) diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index 7488814776..74480d31d4 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -5651,12 +5651,16 @@ components: alias: type: string description: The schema alias. - message: - type: string - description: The error message. + example: abc required: - alias - - message + example: + general: + status: 400 + title: Schema Parsing Failure + detail: The given schema 'abc' could not be parsed. + alias: abc + type: https://hivemq.com/edge/api/model/SchemaParsingFailureError SchemaReferencedError: allOf: - $ref: '#/components/schemas/ApiError' @@ -5665,11 +5669,16 @@ components: id: type: string description: The schema ID. - message: - type: string - description: The error message. + example: abc required: - id + example: + general: + status: 400 + title: Schema Referenced + detail: Schema with ID 'abc' is referenced. + id: abc + type: https://hivemq.com/edge/api/model/SchemaReferencedError ScriptAlreadyPresentError: allOf: - $ref: '#/components/schemas/ApiError' diff --git a/ext/openAPI/components/schemas/errors/datahub/SchemaParsingFailureError.yaml b/ext/openAPI/components/schemas/errors/datahub/SchemaParsingFailureError.yaml index 4328751489..0e17b9033a 100644 --- a/ext/openAPI/components/schemas/errors/datahub/SchemaParsingFailureError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/SchemaParsingFailureError.yaml @@ -5,9 +5,13 @@ allOf: alias: type: string description: The schema alias. - message: - type: string - description: The error message. + example: "abc" required: - alias - - message +example: + general: + status: 400 + title: "Schema Parsing Failure" + detail: "The given schema 'abc' could not be parsed." + alias: "abc" + type: "https://hivemq.com/edge/api/model/SchemaParsingFailureError" diff --git a/ext/openAPI/components/schemas/errors/datahub/SchemaReferencedError.yaml b/ext/openAPI/components/schemas/errors/datahub/SchemaReferencedError.yaml index afd6212933..6fc5d6d8df 100644 --- a/ext/openAPI/components/schemas/errors/datahub/SchemaReferencedError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/SchemaReferencedError.yaml @@ -5,8 +5,13 @@ allOf: id: type: string description: The schema ID. - message: - type: string - description: The error message. + example: "abc" required: - id +example: + general: + status: 400 + title: "Schema Referenced" + detail: "Schema with ID 'abc' is referenced." + id: "abc" + type: "https://hivemq.com/edge/api/model/SchemaReferencedError" From 2c2d71de68dd128715ec7f15b98b4fcf194c0329 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Thu, 12 Jun 2025 09:27:59 +0200 Subject: [PATCH 078/121] refactor: Add example to ScriptAlreadyPresentError, ScriptCreationFailureError --- ext/hivemq-edge-openapi-2025.9.yaml | 21 ++++++++++++------- .../datahub/ScriptAlreadyPresentError.yaml | 8 +++++++ .../datahub/ScriptCreationFailureError.yaml | 13 ++++++------ 3 files changed, 28 insertions(+), 14 deletions(-) diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index 74480d31d4..63f03c4121 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -5687,18 +5687,25 @@ components: id: type: string description: The script id. + example: abc required: - id + example: + general: + status: 409 + title: Script Already Present + detail: The given script 'abc' is already present. + id: abc + type: https://hivemq.com/edge/api/model/ScriptAlreadyPresentError ScriptCreationFailureError: allOf: - $ref: '#/components/schemas/ApiError' - - type: object - properties: - reason: - type: string - description: The actual reason. - required: - - reason + example: + general: + status: 400 + title: Script Creation Failure + detail: The given script could not be created. + type: https://hivemq.com/edge/api/model/ScriptCreationFailureError ScriptEtagMismatchError: allOf: - $ref: '#/components/schemas/ApiError' diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptAlreadyPresentError.yaml b/ext/openAPI/components/schemas/errors/datahub/ScriptAlreadyPresentError.yaml index b1c14b6930..51d31e76c7 100644 --- a/ext/openAPI/components/schemas/errors/datahub/ScriptAlreadyPresentError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/ScriptAlreadyPresentError.yaml @@ -5,5 +5,13 @@ allOf: id: type: string description: The script id. + example: "abc" required: - id +example: + general: + status: 409 + title: "Script Already Present" + detail: "The given script 'abc' is already present." + id: "abc" + type: "https://hivemq.com/edge/api/model/ScriptAlreadyPresentError" diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptCreationFailureError.yaml b/ext/openAPI/components/schemas/errors/datahub/ScriptCreationFailureError.yaml index ea854eb9cc..8e117e0c08 100644 --- a/ext/openAPI/components/schemas/errors/datahub/ScriptCreationFailureError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/ScriptCreationFailureError.yaml @@ -1,9 +1,8 @@ allOf: - $ref: "../ApiError.yaml" - - type: object - properties: - reason: - type: string - description: The actual reason. - required: - - reason +example: + general: + status: 400 + title: "Script Creation Failure" + detail: "The given script could not be created." + type: "https://hivemq.com/edge/api/model/ScriptCreationFailureError" From 6ea09befa46ad3a9ebd75cecd93fb9a9ba0f29ca Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Thu, 12 Jun 2025 09:34:28 +0200 Subject: [PATCH 079/121] refactor: Add example to ScriptEtagMismatchError --- ext/hivemq-edge-openapi-2025.9.yaml | 10 ++++++++++ .../errors/datahub/ScriptEtagMismatchError.yaml | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index 63f03c4121..f0bf98917b 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -5714,11 +5714,21 @@ components: id: type: string description: The script id. + example: abc eTag: type: string description: The eTag. + example: 33a64df551425fcc55e4d42a148795d9f25f89d4 required: - id + example: + general: + status: 412 + title: Script eTag Mismatch + detail: Script with id 'abc' does not match the given etag '33a64df551425fcc55e4d42a148795d9f25f89d4'. + id: abc + eTag: 33a64df551425fcc55e4d42a148795d9f25f89d4 + type: https://hivemq.com/edge/api/model/ScriptEtagMismatchError ScriptValidationError: allOf: - $ref: '#/components/schemas/ValidationError' diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptEtagMismatchError.yaml b/ext/openAPI/components/schemas/errors/datahub/ScriptEtagMismatchError.yaml index 8431554b06..64a39d4f04 100644 --- a/ext/openAPI/components/schemas/errors/datahub/ScriptEtagMismatchError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/ScriptEtagMismatchError.yaml @@ -5,8 +5,18 @@ allOf: id: type: string description: The script id. + example: "abc" eTag: type: string description: The eTag. + example: "33a64df551425fcc55e4d42a148795d9f25f89d4" required: - id +example: + general: + status: 412 + title: "Script eTag Mismatch" + detail: "Script with id 'abc' does not match the given etag '33a64df551425fcc55e4d42a148795d9f25f89d4'." + id: "abc" + eTag: "33a64df551425fcc55e4d42a148795d9f25f89d4" + type: "https://hivemq.com/edge/api/model/ScriptEtagMismatchError" From 3db33692071811942e9492ea0513acd35ccfc3bc Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Thu, 12 Jun 2025 09:37:37 +0200 Subject: [PATCH 080/121] refactor: Add example to ScriptInvalidErrors --- ext/hivemq-edge-openapi-2025.9.yaml | 14 ++++++++++++++ .../errors/datahub/ScriptInvalidErrors.yaml | 14 ++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index f0bf98917b..1e8e6eb72a 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -5758,6 +5758,20 @@ components: $ref: '#/components/schemas/ScriptValidationError' required: - childErrors + example: + general: + status: 400 + title: Script Invalid + detail: Script is invalid due to validation errors. + type: https://hivemq.com/edge/api/model/ScriptInvalidErrors + childErrors: + - detail: The length of script field '$.id' 1025 must be between 0 and 1024. + paths: $.id + value: aaa...aaa + actualLength: 1025 + expectedMinimumLength: 0 + expectedMaximumLength: 1024 + type: https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError ScriptNotFoundError: allOf: - $ref: '#/components/schemas/ApiError' diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptInvalidErrors.yaml b/ext/openAPI/components/schemas/errors/datahub/ScriptInvalidErrors.yaml index 31be71e682..388efa097f 100644 --- a/ext/openAPI/components/schemas/errors/datahub/ScriptInvalidErrors.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/ScriptInvalidErrors.yaml @@ -9,3 +9,17 @@ allOf: $ref: "./ScriptValidationError.yaml" required: - childErrors +example: + general: + status: 400 + title: "Script Invalid" + detail: "Script is invalid due to validation errors." + type: "https://hivemq.com/edge/api/model/ScriptInvalidErrors" + childErrors: + - detail: "The length of script field '$.id' 1025 must be between 0 and 1024." + paths: "$.id" + value: "aaa...aaa" + actualLength: 1025 + expectedMinimumLength: 0 + expectedMaximumLength: 1024 + type: "https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError" From 68a04cd7f7e19d04191e62c164a41c3bf4b687c5 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Thu, 12 Jun 2025 09:45:37 +0200 Subject: [PATCH 081/121] refactor: Add example to ScriptNotFoundError, ScriptParsingFailureError --- ext/hivemq-edge-openapi-2025.9.yaml | 24 +++++++++++-------- .../errors/datahub/ScriptNotFoundError.yaml | 11 ++++++--- .../datahub/ScriptParsingFailureError.yaml | 13 +++++----- 3 files changed, 28 insertions(+), 20 deletions(-) diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index 1e8e6eb72a..a1b95d3d48 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -5780,21 +5780,25 @@ components: id: type: string description: The script ID. - message: - type: string - description: The error message. + example: abc required: - id + example: + general: + status: 404 + title: Script Not Found + detail: Script with ID 'abc' is not found. + id: abc + type: https://hivemq.com/edge/api/model/ScriptNotFoundError ScriptParsingFailureError: allOf: - $ref: '#/components/schemas/ApiError' - - type: object - properties: - reason: - type: string - description: The actual reason. - required: - - reason + example: + general: + status: 400 + title: Script Parsing Failure + detail: The given script 'abc' could not be parsed. + type: https://hivemq.com/edge/api/model/ScriptParsingFailureError ScriptReferencedError: allOf: - $ref: '#/components/schemas/ApiError' diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptNotFoundError.yaml b/ext/openAPI/components/schemas/errors/datahub/ScriptNotFoundError.yaml index 80ef98c1ab..00b71ccde5 100644 --- a/ext/openAPI/components/schemas/errors/datahub/ScriptNotFoundError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/ScriptNotFoundError.yaml @@ -5,8 +5,13 @@ allOf: id: type: string description: The script ID. - message: - type: string - description: The error message. + example: "abc" required: - id +example: + general: + status: 404 + title: "Script Not Found" + detail: "Script with ID 'abc' is not found." + id: "abc" + type: "https://hivemq.com/edge/api/model/ScriptNotFoundError" diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptParsingFailureError.yaml b/ext/openAPI/components/schemas/errors/datahub/ScriptParsingFailureError.yaml index ea854eb9cc..af9f6a4cc8 100644 --- a/ext/openAPI/components/schemas/errors/datahub/ScriptParsingFailureError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/ScriptParsingFailureError.yaml @@ -1,9 +1,8 @@ allOf: - $ref: "../ApiError.yaml" - - type: object - properties: - reason: - type: string - description: The actual reason. - required: - - reason +example: + general: + status: 400 + title: "Script Parsing Failure" + detail: "The given script 'abc' could not be parsed." + type: "https://hivemq.com/edge/api/model/ScriptParsingFailureError" From d3cee8403f0583b94459996f1abe5003be9afff7 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Thu, 12 Jun 2025 11:24:34 +0200 Subject: [PATCH 082/121] refactor: Add example to ScriptReferencedError, ScriptSanitationFailureError --- ext/hivemq-edge-openapi-2025.9.yaml | 24 +++++++++++-------- .../errors/datahub/ScriptReferencedError.yaml | 11 ++++++--- .../datahub/ScriptSanitationFailureError.yaml | 13 +++++----- 3 files changed, 28 insertions(+), 20 deletions(-) diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index a1b95d3d48..df918818c5 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -5807,21 +5807,25 @@ components: id: type: string description: The script ID. - message: - type: string - description: The error message. + example: abc required: - id + example: + general: + status: 400 + title: Script Referenced + detail: Script with ID 'abc' is referenced. + id: abc + type: https://hivemq.com/edge/api/model/ScriptReferencedError ScriptSanitationFailureError: allOf: - $ref: '#/components/schemas/ApiError' - - type: object - properties: - reason: - type: string - description: The actual reason. - required: - - reason + example: + general: + status: 400 + title: Script Sanitation Failure + detail: The given script could not be sanitized. + type: https://hivemq.com/edge/api/model/ScriptSanitationFailureError TopicFilterMismatchError: allOf: - $ref: '#/components/schemas/ApiError' diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptReferencedError.yaml b/ext/openAPI/components/schemas/errors/datahub/ScriptReferencedError.yaml index 80ef98c1ab..6ae4c4b99f 100644 --- a/ext/openAPI/components/schemas/errors/datahub/ScriptReferencedError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/ScriptReferencedError.yaml @@ -5,8 +5,13 @@ allOf: id: type: string description: The script ID. - message: - type: string - description: The error message. + example: "abc" required: - id +example: + general: + status: 400 + title: "Script Referenced" + detail: "Script with ID 'abc' is referenced." + id: "abc" + type: "https://hivemq.com/edge/api/model/ScriptReferencedError" diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptSanitationFailureError.yaml b/ext/openAPI/components/schemas/errors/datahub/ScriptSanitationFailureError.yaml index ea854eb9cc..993184d87c 100644 --- a/ext/openAPI/components/schemas/errors/datahub/ScriptSanitationFailureError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/ScriptSanitationFailureError.yaml @@ -1,9 +1,8 @@ allOf: - $ref: "../ApiError.yaml" - - type: object - properties: - reason: - type: string - description: The actual reason. - required: - - reason +example: + general: + status: 400 + title: "Script Sanitation Failure" + detail: "The given script could not be sanitized." + type: "https://hivemq.com/edge/api/model/ScriptSanitationFailureError" From 7c397f9ee7549f99a2b19436b76649ad58e44340 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Thu, 12 Jun 2025 11:46:48 +0200 Subject: [PATCH 083/121] refactor: Add example to TopicFilterMismatchError --- ext/hivemq-edge-openapi-2025.9.yaml | 10 +++++++--- .../errors/datahub/TopicFilterMismatchError.yaml | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index df918818c5..4c1e0257e2 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -5831,14 +5831,18 @@ components: - $ref: '#/components/schemas/ApiError' - type: object properties: - message: - type: string - description: The error message. path: type: string description: The json path of the topic filter. + example: $.filter required: - path + example: + general: + status: 400 + title: Topic Filter Mismatch + detail: The topic filter '$.filter' mismatches. + type: https://hivemq.com/edge/api/model/TopicFilterMismatchError InsufficientStorageError: allOf: - $ref: '#/components/schemas/ApiError' diff --git a/ext/openAPI/components/schemas/errors/datahub/TopicFilterMismatchError.yaml b/ext/openAPI/components/schemas/errors/datahub/TopicFilterMismatchError.yaml index 5b8209b20e..8c7d64fbf7 100644 --- a/ext/openAPI/components/schemas/errors/datahub/TopicFilterMismatchError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/TopicFilterMismatchError.yaml @@ -2,11 +2,15 @@ allOf: - $ref: "../ApiError.yaml" - type: object properties: - message: - type: string - description: The error message. path: type: string description: The json path of the topic filter. + example: "$.filter" required: - path +example: + general: + status: 400 + title: "Topic Filter Mismatch" + detail: "The topic filter '$.filter' mismatches." + type: "https://hivemq.com/edge/api/model/TopicFilterMismatchError" From 18665ab076faf07335064f8f0770756ad1c0f7ac Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Thu, 12 Jun 2025 14:01:40 +0200 Subject: [PATCH 084/121] refactor: Add example to DataHub validation errors 1 --- ext/hivemq-edge-openapi-2025.9.yaml | 53 +++++++++++++++++-- .../AtMostOneFunctionValidationError.yaml | 17 ++++++ .../FunctionMustBePairedValidationError.yaml | 8 +++ ...IllegalEventTransitionValidationError.yaml | 14 +++++ .../IllegalFunctionValidationError.yaml | 14 +++-- 5 files changed, 98 insertions(+), 8 deletions(-) diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index 4c1e0257e2..1368ff4594 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -4971,20 +4971,37 @@ components: function: type: string description: The function. + example: function1 occurrences: type: integer format: int32 description: The occurrences of the function. + minimum: 0 + example: 3 paths: type: array items: type: string format: json-path description: The json paths where the function occurs. + example: + - $.path1 + - $.path2 + - $.path3 required: - function - occurrences - paths + example: + general: + detail: The pipeline must contain at most one 'function1' function, but 3 were found at ['$.path1', '$.path2', '$.path3']. + function: function1 + occurrences: 3 + paths: + - $.path1 + - $.path2 + - $.path3 + type: https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError EmptyFieldValidationError: allOf: - $ref: '#/components/schemas/ValidationError' @@ -5010,12 +5027,20 @@ components: existingFunction: type: string description: The existing function. + example: function1 missingFunction: type: string description: The missing function. + example: function2 required: - existingFunction - missingFunction + example: + general: + detail: If 'function1' function is present in the pipeline, 'function2' function must be present as well. + existingFunction: function1 + missingFunction: function2 + type: https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError GeneralPolicyValidationError: allOf: - $ref: '#/components/schemas/ValidationError' @@ -5027,24 +5052,38 @@ components: event: type: string description: The event name. + example: event1 fromState: type: string description: The event from state. + example: state1 id: type: string description: The event id. + example: abc path: type: string description: The path. + example: $.event toState: type: string description: The event to state. + example: state2 required: - event - fromState - id - path - toState + example: + general: + detail: The transition from state 'state1' to state 'state2' on event 'event1' in '$.event' is not defined for behavior 'abc'. + event: event1 + fromState: state1 + toState: state2 + id: abc + path: $.event + type: https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError IllegalFunctionValidationError: allOf: - $ref: '#/components/schemas/ValidationError' @@ -5053,21 +5092,27 @@ components: event: type: string description: The event name. + example: event1 id: type: string description: The function id. - message: - type: string - description: The error message. + example: abc path: type: string format: json-path description: The json path. + example: $.event required: - event - id - - message - path + example: + general: + detail: The function 'abc' is not allowed for event 'event1' in '$.event'. + event: event1 + id: abc + path: $.event + type: https://hivemq.com/edge/api/model/IllegalFunctionValidationError InvalidFieldLengthValidationError: allOf: - $ref: '#/components/schemas/ValidationError' diff --git a/ext/openAPI/components/schemas/errors/datahub/AtMostOneFunctionValidationError.yaml b/ext/openAPI/components/schemas/errors/datahub/AtMostOneFunctionValidationError.yaml index 4f05fe9d53..7f2c5f6443 100644 --- a/ext/openAPI/components/schemas/errors/datahub/AtMostOneFunctionValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/AtMostOneFunctionValidationError.yaml @@ -5,17 +5,34 @@ allOf: function: type: string description: The function. + example: "function1" occurrences: type: integer format: int32 description: The occurrences of the function. + minimum: 0 + example: 3 paths: type: array items: type: string format: json-path description: The json paths where the function occurs. + example: + - "$.path1" + - "$.path2" + - "$.path3" required: - function - occurrences - paths +example: + general: + detail: "The pipeline must contain at most one 'function1' function, but 3 were found at ['$.path1', '$.path2', '$.path3']." + function: "function1" + occurrences: 3 + paths: + - "$.path1" + - "$.path2" + - "$.path3" + type: "https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError" diff --git a/ext/openAPI/components/schemas/errors/datahub/FunctionMustBePairedValidationError.yaml b/ext/openAPI/components/schemas/errors/datahub/FunctionMustBePairedValidationError.yaml index 07ff484703..6c1df9934e 100644 --- a/ext/openAPI/components/schemas/errors/datahub/FunctionMustBePairedValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/FunctionMustBePairedValidationError.yaml @@ -5,9 +5,17 @@ allOf: existingFunction: type: string description: The existing function. + example: "function1" missingFunction: type: string description: The missing function. + example: "function2" required: - existingFunction - missingFunction +example: + general: + detail: "If 'function1' function is present in the pipeline, 'function2' function must be present as well." + existingFunction: "function1" + missingFunction: "function2" + type: "https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError" diff --git a/ext/openAPI/components/schemas/errors/datahub/IllegalEventTransitionValidationError.yaml b/ext/openAPI/components/schemas/errors/datahub/IllegalEventTransitionValidationError.yaml index ce0b9bf391..93aef476cf 100644 --- a/ext/openAPI/components/schemas/errors/datahub/IllegalEventTransitionValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/IllegalEventTransitionValidationError.yaml @@ -5,21 +5,35 @@ allOf: event: type: string description: The event name. + example: "event1" fromState: type: string description: The event from state. + example: "state1" id: type: string description: The event id. + example: "abc" path: type: string description: The path. + example: "$.event" toState: type: string description: The event to state. + example: "state2" required: - event - fromState - id - path - toState +example: + general: + detail: "The transition from state 'state1' to state 'state2' on event 'event1' in '$.event' is not defined for behavior 'abc'." + event: "event1" + fromState: "state1" + toState: "state2" + id: "abc" + path: "$.event" + type: "https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError" diff --git a/ext/openAPI/components/schemas/errors/datahub/IllegalFunctionValidationError.yaml b/ext/openAPI/components/schemas/errors/datahub/IllegalFunctionValidationError.yaml index 16e9993ecb..d5ed1baee5 100644 --- a/ext/openAPI/components/schemas/errors/datahub/IllegalFunctionValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/IllegalFunctionValidationError.yaml @@ -5,18 +5,24 @@ allOf: event: type: string description: The event name. + example: "event1" id: type: string description: The function id. - message: - type: string - description: The error message. + example: "abc" path: type: string format: json-path description: The json path. + example: "$.event" required: - event - id - - message - path +example: + general: + detail: "The function 'abc' is not allowed for event 'event1' in '$.event'." + event: "event1" + id: "abc" + path: "$.event" + type: "https://hivemq.com/edge/api/model/IllegalFunctionValidationError" From 4d5f4c68b41b246c6619a6f52d05e0d6254ed785 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Thu, 12 Jun 2025 14:23:39 +0200 Subject: [PATCH 085/121] refactor: Add example to DataHub validation errors 2 --- ext/hivemq-edge-openapi-2025.9.yaml | 30 +++++++++++++++++-- .../InvalidFunctionOrderValidationError.yaml | 10 +++++++ .../UnknownVariableValidationError.yaml | 20 +++++++++++-- 3 files changed, 54 insertions(+), 6 deletions(-) diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index 1368ff4594..b519f245d5 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -5190,17 +5190,27 @@ components: function: type: string description: The function. + example: transform path: type: string format: json-path description: The json path. + example: $.path previousFunction: type: string description: The previous function. + example: init required: - function - path - previousFunction + example: + general: + detail: The operation at '$.path' with the functionId 'transform' must be after a 'init' operation. + function: transform + path: $.path + previousFunction: init + type: https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError InvalidIdentifierValidationError: allOf: - $ref: '#/components/schemas/ValidationError' @@ -5246,17 +5256,31 @@ components: - $ref: '#/components/schemas/ValidationError' - type: object properties: - field: + path: type: string - description: The field. + description: The json path of the field. + example: $.path variables: type: array items: type: string description: The unknown variables. + example: + - a + - b + - c required: - - field + - path - variables + example: + general: + detail: 'Field ''$.path'' contains unknown variables: [a, b, c].' + path: $.path + variables: + - a + - b + - c + type: https://hivemq.com/edge/api/model/UnknownVariableValidationError UnsupportedFieldValidationError: allOf: - $ref: '#/components/schemas/ValidationError' diff --git a/ext/openAPI/components/schemas/errors/datahub/InvalidFunctionOrderValidationError.yaml b/ext/openAPI/components/schemas/errors/datahub/InvalidFunctionOrderValidationError.yaml index 238c0e537e..48f359a2d6 100644 --- a/ext/openAPI/components/schemas/errors/datahub/InvalidFunctionOrderValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/InvalidFunctionOrderValidationError.yaml @@ -5,14 +5,24 @@ allOf: function: type: string description: The function. + example: "transform" path: type: string format: json-path description: The json path. + example: "$.path" previousFunction: type: string description: The previous function. + example: "init" required: - function - path - previousFunction +example: + general: + detail: "The operation at '$.path' with the functionId 'transform' must be after a 'init' operation." + function: "transform" + path: "$.path" + previousFunction: "init" + type: "https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError" diff --git a/ext/openAPI/components/schemas/errors/datahub/UnknownVariableValidationError.yaml b/ext/openAPI/components/schemas/errors/datahub/UnknownVariableValidationError.yaml index 2718f109be..fa6550e592 100644 --- a/ext/openAPI/components/schemas/errors/datahub/UnknownVariableValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/UnknownVariableValidationError.yaml @@ -2,14 +2,28 @@ allOf: - $ref: "../validation/ValidationError.yaml" - type: object properties: - field: + path: type: string - description: The field. + description: The json path of the field. + example: "$.path" variables: type: array items: type: string description: The unknown variables. + example: + - "a" + - "b" + - "c" required: - - field + - path - variables +example: + general: + detail: "Field '$.path' contains unknown variables: [a, b, c]." + path: "$.path" + variables: + - "a" + - "b" + - "c" + type: "https://hivemq.com/edge/api/model/UnknownVariableValidationError" From 863e8b1e30a6cd63cfaa149a62f45593adbd9edf Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Thu, 12 Jun 2025 16:08:57 +0200 Subject: [PATCH 086/121] refactor: Remove GeneralPolicyValidationError --- ext/hivemq-edge-openapi-2025.9.yaml | 94 +++++++++++-------- .../BehaviorPolicyValidationError.yaml | 10 +- .../datahub/DataPolicyValidationError.yaml | 8 +- .../datahub/GeneralPolicyValidationError.yaml | 2 - .../InvalidSchemaVersionValidationError.yaml | 21 +++++ .../InvalidFieldValueValidationError.yaml | 1 - .../errors/validation/ValidationError.yaml | 2 +- .../api/errors/ValidationErrorFactory.java | 3 +- 8 files changed, 91 insertions(+), 50 deletions(-) delete mode 100644 ext/openAPI/components/schemas/errors/datahub/GeneralPolicyValidationError.yaml create mode 100644 ext/openAPI/components/schemas/errors/datahub/InvalidSchemaVersionValidationError.yaml diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index b519f245d5..916d6600b2 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -4909,6 +4909,30 @@ components: title: Behavior Policy Creation Failed detail: 'Behavior policy creation failed: The policy was rejected.' type: https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError + AtLeastOneFieldMissingValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + paths: + type: array + description: The missing json paths. + items: + type: string + format: json-path + description: The json path. + example: + - $.field1 + - $.field2 + required: + - paths + example: + general: + detail: 'At least one of the fields must be present: ''$.field1'', ''$.field2''.' + paths: + - $.field1 + - $.field2 + type: https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError ValidationError: type: object properties: @@ -4929,40 +4953,16 @@ components: https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError: '#/components/schemas/AtMostOneFunctionValidationError' https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError: '#/components/schemas/FunctionMustBePairedValidationError' - https://hivemq.com/edge/api/model/GeneralPolicyValidationError: '#/components/schemas/GeneralPolicyValidationError' https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError: '#/components/schemas/IllegalEventTransitionValidationError' https://hivemq.com/edge/api/model/IllegalFunctionValidationError: '#/components/schemas/IllegalFunctionValidationError' https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError: '#/components/schemas/InvalidFunctionOrderValidationError' https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' + https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError: '#/components/schemas/InvalidSchemaVersionValidationError' https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' https://hivemq.com/edge/api/model/UnknownVariableValidationError: '#/components/schemas/UnknownVariableValidationError' https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' - AtLeastOneFieldMissingValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - paths: - type: array - description: The missing json paths. - items: - type: string - format: json-path - description: The json path. - example: - - $.field1 - - $.field2 - required: - - paths - example: - general: - detail: 'At least one of the fields must be present: ''$.field1'', ''$.field2''.' - paths: - - $.field1 - - $.field2 - type: https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError AtMostOneFunctionValidationError: allOf: - $ref: '#/components/schemas/ValidationError' @@ -5041,9 +5041,6 @@ components: existingFunction: function1 missingFunction: function2 type: https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError - GeneralPolicyValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' IllegalEventTransitionValidationError: allOf: - $ref: '#/components/schemas/ValidationError' @@ -5175,7 +5172,6 @@ components: example: functionDoesNotExist required: - path - - value example: general: detail: Referenced function does not exist. @@ -5234,6 +5230,28 @@ components: path: $.id value: invalidId type: https://hivemq.com/edge/api/model/InvalidIdentifierValidationError + InvalidSchemaVersionValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + id: + type: string + description: The schema id. + example: abc + version: + type: string + description: The schema version. + example: '2' + required: + - id + - version + example: + general: + detail: The referenced schema with id 'abc' and version '2' was not found. + id: abc + version: '2' + type: https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError MissingFieldValidationError: allOf: - $ref: '#/components/schemas/ValidationError' @@ -5312,9 +5330,9 @@ components: allOf: - $ref: '#/components/schemas/ValidationError' - oneOf: - - $ref: '#/components/schemas/GeneralPolicyValidationError' - - $ref: '#/components/schemas/IllegalFunctionValidationError' - $ref: '#/components/schemas/IllegalEventTransitionValidationError' + - $ref: '#/components/schemas/IllegalFunctionValidationError' + - $ref: '#/components/schemas/InvalidSchemaVersionValidationError' - $ref: '#/components/schemas/AtLeastOneFieldMissingValidationError' - $ref: '#/components/schemas/EmptyFieldValidationError' - $ref: '#/components/schemas/InvalidFieldLengthValidationError' @@ -5325,14 +5343,14 @@ components: discriminator: propertyName: type mapping: - https://hivemq.com/edge/api/model/GeneralPolicyValidationError: '#/components/schemas/GeneralPolicyValidationError' - https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError: '#/components/schemas/IllegalEventTransitionValidationError' - https://hivemq.com/edge/api/model/IllegalFunctionValidationError: '#/components/schemas/IllegalFunctionValidationError' https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError: '#/components/schemas/AtLeastOneFieldMissingValidationError' https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' + https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError: '#/components/schemas/IllegalEventTransitionValidationError' + https://hivemq.com/edge/api/model/IllegalFunctionValidationError: '#/components/schemas/IllegalFunctionValidationError' https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' + https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError: '#/components/schemas/InvalidSchemaVersionValidationError' https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' BehaviorPolicyInvalidErrors: @@ -5475,6 +5493,7 @@ components: - $ref: '#/components/schemas/AtMostOneFunctionValidationError' - $ref: '#/components/schemas/FunctionMustBePairedValidationError' - $ref: '#/components/schemas/InvalidFunctionOrderValidationError' + - $ref: '#/components/schemas/InvalidSchemaVersionValidationError' - $ref: '#/components/schemas/UnknownVariableValidationError' - $ref: '#/components/schemas/EmptyFieldValidationError' - $ref: '#/components/schemas/InvalidFieldLengthValidationError' @@ -5486,14 +5505,15 @@ components: propertyName: type mapping: https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError: '#/components/schemas/AtMostOneFunctionValidationError' - https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError: '#/components/schemas/FunctionMustBePairedValidationError' - https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError: '#/components/schemas/InvalidFunctionOrderValidationError' - https://hivemq.com/edge/api/model/UnknownVariableValidationError: '#/components/schemas/UnknownVariableValidationError' https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' + https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError: '#/components/schemas/FunctionMustBePairedValidationError' https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' + https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError: '#/components/schemas/InvalidFunctionOrderValidationError' https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' + https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError: '#/components/schemas/InvalidSchemaVersionValidationError' https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' + https://hivemq.com/edge/api/model/UnknownVariableValidationError: '#/components/schemas/UnknownVariableValidationError' https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' DataPolicyInvalidErrors: allOf: diff --git a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyValidationError.yaml b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyValidationError.yaml index a75919ff31..87fb6ae826 100644 --- a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyValidationError.yaml @@ -1,9 +1,9 @@ allOf: - $ref: "../validation/ValidationError.yaml" - oneOf: - - $ref: "./GeneralPolicyValidationError.yaml" - - $ref: "./IllegalFunctionValidationError.yaml" - $ref: "./IllegalEventTransitionValidationError.yaml" + - $ref: "./IllegalFunctionValidationError.yaml" + - $ref: "./InvalidSchemaVersionValidationError.yaml" - $ref: "../validation/AtLeastOneFieldMissingValidationError.yaml" - $ref: "../validation/EmptyFieldValidationError.yaml" - $ref: "../validation/InvalidFieldLengthValidationError.yaml" @@ -14,13 +14,13 @@ allOf: discriminator: propertyName: type mapping: - https://hivemq.com/edge/api/model/GeneralPolicyValidationError: "./GeneralPolicyValidationError.yaml" - https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError: "./IllegalEventTransitionValidationError.yaml" - https://hivemq.com/edge/api/model/IllegalFunctionValidationError: "./IllegalFunctionValidationError.yaml" https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError: "../validation/AtLeastOneFieldMissingValidationError.yaml" https://hivemq.com/edge/api/model/EmptyFieldValidationError: "../validation/EmptyFieldValidationError.yaml" + https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError: "./IllegalEventTransitionValidationError.yaml" + https://hivemq.com/edge/api/model/IllegalFunctionValidationError: "./IllegalFunctionValidationError.yaml" https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: "../validation/InvalidFieldLengthValidationError.yaml" https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: "../validation/InvalidFieldValueValidationError.yaml" https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: "../validation/InvalidIdentifierValidationError.yaml" + https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError: "./InvalidSchemaVersionValidationError.yaml" https://hivemq.com/edge/api/model/MissingFieldValidationError: "../validation/MissingFieldValidationError.yaml" https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: "../validation/UnsupportedFieldValidationError.yaml" diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyValidationError.yaml b/ext/openAPI/components/schemas/errors/datahub/DataPolicyValidationError.yaml index d3db30772b..70cd1d0d8e 100644 --- a/ext/openAPI/components/schemas/errors/datahub/DataPolicyValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/DataPolicyValidationError.yaml @@ -4,6 +4,7 @@ allOf: - $ref: "./AtMostOneFunctionValidationError.yaml" - $ref: "./FunctionMustBePairedValidationError.yaml" - $ref: "./InvalidFunctionOrderValidationError.yaml" + - $ref: "./InvalidSchemaVersionValidationError.yaml" - $ref: "./UnknownVariableValidationError.yaml" - $ref: "../validation/EmptyFieldValidationError.yaml" - $ref: "../validation/InvalidFieldLengthValidationError.yaml" @@ -15,12 +16,13 @@ discriminator: propertyName: type mapping: https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError: "./AtMostOneFunctionValidationError.yaml" - https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError: "./FunctionMustBePairedValidationError.yaml" - https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError: "./InvalidFunctionOrderValidationError.yaml" - https://hivemq.com/edge/api/model/UnknownVariableValidationError: "./UnknownVariableValidationError.yaml" https://hivemq.com/edge/api/model/EmptyFieldValidationError: "../validation/EmptyFieldValidationError.yaml" + https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError: "./FunctionMustBePairedValidationError.yaml" https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: "../validation/InvalidFieldLengthValidationError.yaml" https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: "../validation/InvalidFieldValueValidationError.yaml" + https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError: "./InvalidFunctionOrderValidationError.yaml" https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: "../validation/InvalidIdentifierValidationError.yaml" + https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError: "./InvalidSchemaVersionValidationError.yaml" https://hivemq.com/edge/api/model/MissingFieldValidationError: "../validation/MissingFieldValidationError.yaml" + https://hivemq.com/edge/api/model/UnknownVariableValidationError: "./UnknownVariableValidationError.yaml" https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: "../validation/UnsupportedFieldValidationError.yaml" diff --git a/ext/openAPI/components/schemas/errors/datahub/GeneralPolicyValidationError.yaml b/ext/openAPI/components/schemas/errors/datahub/GeneralPolicyValidationError.yaml deleted file mode 100644 index ae23ca8091..0000000000 --- a/ext/openAPI/components/schemas/errors/datahub/GeneralPolicyValidationError.yaml +++ /dev/null @@ -1,2 +0,0 @@ -allOf: - - $ref: "../validation/ValidationError.yaml" diff --git a/ext/openAPI/components/schemas/errors/datahub/InvalidSchemaVersionValidationError.yaml b/ext/openAPI/components/schemas/errors/datahub/InvalidSchemaVersionValidationError.yaml new file mode 100644 index 0000000000..e1c8c2221b --- /dev/null +++ b/ext/openAPI/components/schemas/errors/datahub/InvalidSchemaVersionValidationError.yaml @@ -0,0 +1,21 @@ +allOf: + - $ref: "../validation/ValidationError.yaml" + - type: object + properties: + id: + type: string + description: The schema id. + example: "abc" + version: + type: string + description: The schema version. + example: "2" + required: + - id + - version +example: + general: + detail: "The referenced schema with id 'abc' and version '2' was not found." + id: "abc" + version: "2" + type: "https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError" diff --git a/ext/openAPI/components/schemas/errors/validation/InvalidFieldValueValidationError.yaml b/ext/openAPI/components/schemas/errors/validation/InvalidFieldValueValidationError.yaml index acaa8a7017..6de8d87fb7 100644 --- a/ext/openAPI/components/schemas/errors/validation/InvalidFieldValueValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/validation/InvalidFieldValueValidationError.yaml @@ -13,7 +13,6 @@ allOf: example: "functionDoesNotExist" required: - path - - value example: general: detail: "Referenced function does not exist." diff --git a/ext/openAPI/components/schemas/errors/validation/ValidationError.yaml b/ext/openAPI/components/schemas/errors/validation/ValidationError.yaml index cc608814cf..48d91902e8 100644 --- a/ext/openAPI/components/schemas/errors/validation/ValidationError.yaml +++ b/ext/openAPI/components/schemas/errors/validation/ValidationError.yaml @@ -17,13 +17,13 @@ discriminator: https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError: "../datahub/AtMostOneFunctionValidationError.yaml" https://hivemq.com/edge/api/model/EmptyFieldValidationError: "./EmptyFieldValidationError.yaml" https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError: "../datahub/FunctionMustBePairedValidationError.yaml" - https://hivemq.com/edge/api/model/GeneralPolicyValidationError: "../datahub/GeneralPolicyValidationError.yaml" https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError: "../datahub/IllegalEventTransitionValidationError.yaml" https://hivemq.com/edge/api/model/IllegalFunctionValidationError: "../datahub/IllegalFunctionValidationError.yaml" https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: "./InvalidFieldLengthValidationError.yaml" https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: "./InvalidFieldValueValidationError.yaml" https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError: "../datahub/InvalidFunctionOrderValidationError.yaml" https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: "./InvalidIdentifierValidationError.yaml" + https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError: "../datahub/InvalidSchemaVersionValidationError.yaml" https://hivemq.com/edge/api/model/MissingFieldValidationError: "./MissingFieldValidationError.yaml" https://hivemq.com/edge/api/model/UnknownVariableValidationError: "../datahub/UnknownVariableValidationError.yaml" https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: "./UnsupportedFieldValidationError.yaml" diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/ValidationErrorFactory.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/ValidationErrorFactory.java index bb17804b0a..39fc260a87 100644 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/ValidationErrorFactory.java +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/ValidationErrorFactory.java @@ -24,6 +24,7 @@ import com.hivemq.edge.api.model.MissingFieldValidationError; import com.hivemq.edge.api.model.UnsupportedFieldValidationError; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import java.util.List; import java.util.stream.Collectors; @@ -80,7 +81,7 @@ private ValidationErrorFactory() { public static @NotNull InvalidFieldValueValidationError invalidFieldValueValidationError( final @NotNull String detail, final @NotNull String path, - final @NotNull String value) { + final @Nullable String value) { return InvalidFieldValueValidationError.builder() .type(type(InvalidFieldValueValidationError.class)) .detail(detail) From a35a7e4ec36e060187119e188fb1db98bbf95b9b Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Fri, 13 Jun 2025 10:28:20 +0200 Subject: [PATCH 087/121] refactor: Add PolicyInsufficientStorageError, SchemaInsufficientStorageError, ScriptInsufficientStorageError --- ext/hivemq-edge-openapi-2025.9.yaml | 74 ++++++++++++++++--- .../components/schemas/errors/ApiError.yaml | 3 + .../PolicyInsufficientStorageError.yaml | 17 +++++ .../SchemaInsufficientStorageError.yaml | 17 +++++ .../ScriptInsufficientStorageError.yaml | 17 +++++ .../errors/http/InsufficientStorageError.yaml | 5 -- ...data-hub_behavior-validation_policies.yaml | 2 +- ...havior-validation_policies_{policyId}.yaml | 2 +- ..._v1_data-hub_data-validation_policies.yaml | 2 +- ...b_data-validation_policies_{policyId}.yaml | 2 +- .../paths/api_v1_data-hub_schemas.yaml | 2 +- .../paths/api_v1_data-hub_scripts.yaml | 2 +- 12 files changed, 123 insertions(+), 22 deletions(-) create mode 100644 ext/openAPI/components/schemas/errors/datahub/PolicyInsufficientStorageError.yaml create mode 100644 ext/openAPI/components/schemas/errors/datahub/SchemaInsufficientStorageError.yaml create mode 100644 ext/openAPI/components/schemas/errors/datahub/ScriptInsufficientStorageError.yaml diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index 916d6600b2..6a9eaf3983 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -490,7 +490,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/InsufficientStorageError' + $ref: '#/components/schemas/PolicyInsufficientStorageError' description: Insufficient storage summary: Create a new policy tags: @@ -795,7 +795,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/InsufficientStorageError' + $ref: '#/components/schemas/PolicyInsufficientStorageError' description: Insufficient storage summary: Update an existing behavior policy tags: @@ -1251,7 +1251,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/InsufficientStorageError' + $ref: '#/components/schemas/PolicyInsufficientStorageError' description: Insufficient storage summary: Create a new data policy tags: @@ -1556,7 +1556,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/InsufficientStorageError' + $ref: '#/components/schemas/PolicyInsufficientStorageError' description: Insufficient storage summary: Update an existing data policy tags: @@ -2064,7 +2064,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/InsufficientStorageError' + $ref: '#/components/schemas/SchemaInsufficientStorageError' description: Insufficient storage summary: Create a new schema tags: @@ -2428,7 +2428,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/InsufficientStorageError' + $ref: '#/components/schemas/ScriptInsufficientStorageError' description: Insufficient storage summary: Create a new script tags: @@ -4858,9 +4858,11 @@ components: https://hivemq.com/edge/api/model/DataPolicyRejectedError: '#/components/schemas/DataPolicyRejectedError' https://hivemq.com/edge/api/model/DataPolicyUpdateFailureError: '#/components/schemas/DataPolicyUpdateFailureError' https://hivemq.com/edge/api/model/PolicyIdMismatchError: '#/components/schemas/PolicyIdMismatchError' + https://hivemq.com/edge/api/model/PolicyInsufficientStorageError: '#/components/schemas/PolicyInsufficientStorageError' https://hivemq.com/edge/api/model/PolicyNotFoundError: '#/components/schemas/PolicyNotFoundError' https://hivemq.com/edge/api/model/SchemaAlreadyPresentError: '#/components/schemas/SchemaAlreadyPresentError' https://hivemq.com/edge/api/model/SchemaEtagMismatchError: '#/components/schemas/SchemaEtagMismatchError' + https://hivemq.com/edge/api/model/SchemaInsufficientStorageError: '#/components/schemas/SchemaInsufficientStorageError' https://hivemq.com/edge/api/model/SchemaInvalidErrors: '#/components/schemas/SchemaInvalidErrors' https://hivemq.com/edge/api/model/SchemaNotFoundError: '#/components/schemas/SchemaNotFoundError' https://hivemq.com/edge/api/model/SchemaParsingFailureError: '#/components/schemas/SchemaParsingFailureError' @@ -4868,6 +4870,7 @@ components: https://hivemq.com/edge/api/model/ScriptAlreadyPresentError: '#/components/schemas/ScriptAlreadyPresentError' https://hivemq.com/edge/api/model/ScriptCreationFailureError: '#/components/schemas/ScriptCreationFailureError' https://hivemq.com/edge/api/model/ScriptEtagMismatchError: '#/components/schemas/ScriptEtagMismatchError' + https://hivemq.com/edge/api/model/ScriptInsufficientStorageError: '#/components/schemas/ScriptInsufficientStorageError' https://hivemq.com/edge/api/model/ScriptInvalidErrors: '#/components/schemas/ScriptInvalidErrors' https://hivemq.com/edge/api/model/ScriptNotFoundError: '#/components/schemas/ScriptNotFoundError' https://hivemq.com/edge/api/model/ScriptParsingFailureError: '#/components/schemas/ScriptParsingFailureError' @@ -5610,6 +5613,24 @@ components: detail: The policy ID 'id1' in the request parameter does not match the policy ID 'id2' in the policy request body. id: abc type: https://hivemq.com/edge/api/model/PolicyIdMismatchError + PolicyInsufficientStorageError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The policy id. + example: abc + required: + - id + example: + general: + status: 507 + title: Policy Insufficient Storage + detail: Policy with ID '123' could not be added because of insufficient server storage. + id: abc + type: https://hivemq.com/edge/api/model/PolicyInsufficientStorageError PolicyNotFoundError: allOf: - $ref: '#/components/schemas/ApiError' @@ -5669,6 +5690,24 @@ components: id: abc eTag: 33a64df551425fcc55e4d42a148795d9f25f89d4 type: https://hivemq.com/edge/api/model/SchemaEtagMismatchError + SchemaInsufficientStorageError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The policy id. + example: abc + required: + - id + example: + general: + status: 507 + title: Schema Insufficient Storage + detail: Schema with ID '123' could not be added because of insufficient server storage. + id: abc + type: https://hivemq.com/edge/api/model/SchemaInsufficientStorageError SchemaValidationError: allOf: - $ref: '#/components/schemas/ValidationError' @@ -5818,6 +5857,24 @@ components: id: abc eTag: 33a64df551425fcc55e4d42a148795d9f25f89d4 type: https://hivemq.com/edge/api/model/ScriptEtagMismatchError + ScriptInsufficientStorageError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The policy id. + example: abc + required: + - id + example: + general: + status: 507 + title: Script Insufficient Storage + detail: Script with ID '123' could not be added because of insufficient server storage. + id: abc + type: https://hivemq.com/edge/api/model/ScriptInsufficientStorageError ScriptValidationError: allOf: - $ref: '#/components/schemas/ValidationError' @@ -5941,11 +5998,6 @@ components: title: Insufficient Storage detail: Insufficient Storage. type: https://hivemq.com/edge/api/model/InsufficientStorageError - policy: - status: 507 - title: Insufficient Storage - detail: 'Insufficient Storage: The policy with id ''123'' could not be added because of insufficient server storage.' - type: https://hivemq.com/edge/api/model/InsufficientStorageError InternalServerError: allOf: - $ref: '#/components/schemas/ApiError' diff --git a/ext/openAPI/components/schemas/errors/ApiError.yaml b/ext/openAPI/components/schemas/errors/ApiError.yaml index bee828310d..8de85a314f 100644 --- a/ext/openAPI/components/schemas/errors/ApiError.yaml +++ b/ext/openAPI/components/schemas/errors/ApiError.yaml @@ -19,9 +19,11 @@ discriminator: https://hivemq.com/edge/api/model/DataPolicyRejectedError: "./datahub/DataPolicyRejectedError.yaml" https://hivemq.com/edge/api/model/DataPolicyUpdateFailureError: "./datahub/DataPolicyUpdateFailureError.yaml" https://hivemq.com/edge/api/model/PolicyIdMismatchError: "./datahub/PolicyIdMismatchError.yaml" + https://hivemq.com/edge/api/model/PolicyInsufficientStorageError: "./datahub/PolicyInsufficientStorageError.yaml" https://hivemq.com/edge/api/model/PolicyNotFoundError: "./datahub/PolicyNotFoundError.yaml" https://hivemq.com/edge/api/model/SchemaAlreadyPresentError: "./datahub/SchemaAlreadyPresentError.yaml" https://hivemq.com/edge/api/model/SchemaEtagMismatchError: "./datahub/SchemaEtagMismatchError.yaml" + https://hivemq.com/edge/api/model/SchemaInsufficientStorageError: "./datahub/SchemaInsufficientStorageError.yaml" https://hivemq.com/edge/api/model/SchemaInvalidErrors: "./datahub/SchemaInvalidErrors.yaml" https://hivemq.com/edge/api/model/SchemaNotFoundError: "./datahub/SchemaNotFoundError.yaml" https://hivemq.com/edge/api/model/SchemaParsingFailureError: "./datahub/SchemaParsingFailureError.yaml" @@ -29,6 +31,7 @@ discriminator: https://hivemq.com/edge/api/model/ScriptAlreadyPresentError: "./datahub/ScriptAlreadyPresentError.yaml" https://hivemq.com/edge/api/model/ScriptCreationFailureError: "./datahub/ScriptCreationFailureError.yaml" https://hivemq.com/edge/api/model/ScriptEtagMismatchError: "./datahub/ScriptEtagMismatchError.yaml" + https://hivemq.com/edge/api/model/ScriptInsufficientStorageError: "./datahub/ScriptInsufficientStorageError.yaml" https://hivemq.com/edge/api/model/ScriptInvalidErrors: "./datahub/ScriptInvalidErrors.yaml" https://hivemq.com/edge/api/model/ScriptNotFoundError: "./datahub/ScriptNotFoundError.yaml" https://hivemq.com/edge/api/model/ScriptParsingFailureError: "./datahub/ScriptParsingFailureError.yaml" diff --git a/ext/openAPI/components/schemas/errors/datahub/PolicyInsufficientStorageError.yaml b/ext/openAPI/components/schemas/errors/datahub/PolicyInsufficientStorageError.yaml new file mode 100644 index 0000000000..a44d60b5fe --- /dev/null +++ b/ext/openAPI/components/schemas/errors/datahub/PolicyInsufficientStorageError.yaml @@ -0,0 +1,17 @@ +allOf: + - $ref: "../ApiError.yaml" + - type: object + properties: + id: + type: string + description: The policy id. + example: "abc" + required: + - id +example: + general: + status: 507 + title: "Policy Insufficient Storage" + detail: "Policy with ID '123' could not be added because of insufficient server storage." + id: "abc" + type: "https://hivemq.com/edge/api/model/PolicyInsufficientStorageError" diff --git a/ext/openAPI/components/schemas/errors/datahub/SchemaInsufficientStorageError.yaml b/ext/openAPI/components/schemas/errors/datahub/SchemaInsufficientStorageError.yaml new file mode 100644 index 0000000000..4997b4efd1 --- /dev/null +++ b/ext/openAPI/components/schemas/errors/datahub/SchemaInsufficientStorageError.yaml @@ -0,0 +1,17 @@ +allOf: + - $ref: "../ApiError.yaml" + - type: object + properties: + id: + type: string + description: The policy id. + example: "abc" + required: + - id +example: + general: + status: 507 + title: "Schema Insufficient Storage" + detail: "Schema with ID '123' could not be added because of insufficient server storage." + id: "abc" + type: "https://hivemq.com/edge/api/model/SchemaInsufficientStorageError" diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptInsufficientStorageError.yaml b/ext/openAPI/components/schemas/errors/datahub/ScriptInsufficientStorageError.yaml new file mode 100644 index 0000000000..605012355f --- /dev/null +++ b/ext/openAPI/components/schemas/errors/datahub/ScriptInsufficientStorageError.yaml @@ -0,0 +1,17 @@ +allOf: + - $ref: "../ApiError.yaml" + - type: object + properties: + id: + type: string + description: The policy id. + example: "abc" + required: + - id +example: + general: + status: 507 + title: "Script Insufficient Storage" + detail: "Script with ID '123' could not be added because of insufficient server storage." + id: "abc" + type: "https://hivemq.com/edge/api/model/ScriptInsufficientStorageError" diff --git a/ext/openAPI/components/schemas/errors/http/InsufficientStorageError.yaml b/ext/openAPI/components/schemas/errors/http/InsufficientStorageError.yaml index eaa4e2b510..95b438ad62 100644 --- a/ext/openAPI/components/schemas/errors/http/InsufficientStorageError.yaml +++ b/ext/openAPI/components/schemas/errors/http/InsufficientStorageError.yaml @@ -6,8 +6,3 @@ example: title: "Insufficient Storage" detail: "Insufficient Storage." type: "https://hivemq.com/edge/api/model/InsufficientStorageError" - policy: - status: 507 - title: "Insufficient Storage" - detail: "Insufficient Storage: The policy with id '123' could not be added because of insufficient server storage." - type: "https://hivemq.com/edge/api/model/InsufficientStorageError" diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies.yaml index 36c7dad855..df701832ba 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies.yaml @@ -316,7 +316,7 @@ post: content: application/json: schema: - $ref: "../components/schemas/errors/http/InsufficientStorageError.yaml" + $ref: "../components/schemas/errors/datahub/PolicyInsufficientStorageError.yaml" description: Insufficient storage summary: Create a new policy tags: diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies_{policyId}.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies_{policyId}.yaml index ed9606d887..d33f536d7d 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies_{policyId}.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies_{policyId}.yaml @@ -302,7 +302,7 @@ put: content: application/json: schema: - $ref: "../components/schemas/errors/http/InsufficientStorageError.yaml" + $ref: "../components/schemas/errors/datahub/PolicyInsufficientStorageError.yaml" description: Insufficient storage summary: Update an existing behavior policy tags: diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml index c3757147fe..8278ffd3d0 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml @@ -427,7 +427,7 @@ post: content: application/json: schema: - $ref: "../components/schemas/errors/http/InsufficientStorageError.yaml" + $ref: "../components/schemas/errors/datahub/PolicyInsufficientStorageError.yaml" description: Insufficient storage summary: Create a new data policy tags: diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml index bc5062edec..53c0c2160b 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml @@ -314,7 +314,7 @@ put: content: application/json: schema: - $ref: "../components/schemas/errors/http/InsufficientStorageError.yaml" + $ref: "../components/schemas/errors/datahub/PolicyInsufficientStorageError.yaml" description: Insufficient storage summary: Update an existing data policy tags: diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas.yaml index 1146c6a048..ee6518a351 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas.yaml @@ -256,7 +256,7 @@ post: content: application/json: schema: - $ref: "../components/schemas/errors/http/InsufficientStorageError.yaml" + $ref: "../components/schemas/errors/datahub/SchemaInsufficientStorageError.yaml" description: Insufficient storage summary: Create a new schema tags: diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts.yaml index 0eeae95da9..51cb6613de 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts.yaml @@ -247,7 +247,7 @@ post: content: application/json: schema: - $ref: "../components/schemas/errors/http/InsufficientStorageError.yaml" + $ref: "../components/schemas/errors/datahub/ScriptInsufficientStorageError.yaml" description: Insufficient storage summary: Create a new script tags: From cbab8d6721d8dc02af58f03bfc747b94e7831933 Mon Sep 17 00:00:00 2001 From: Nicolas Van Labeke Date: Tue, 17 Jun 2025 19:19:52 +0100 Subject: [PATCH 088/121] feat: add a root file for the data hub paths --- ext/openAPI/openapi-datahub.yaml | 159 +++++++++++++++++++++++++++++++ 1 file changed, 159 insertions(+) create mode 100644 ext/openAPI/openapi-datahub.yaml diff --git a/ext/openAPI/openapi-datahub.yaml b/ext/openAPI/openapi-datahub.yaml new file mode 100644 index 0000000000..cb19957ec1 --- /dev/null +++ b/ext/openAPI/openapi-datahub.yaml @@ -0,0 +1,159 @@ +openapi: 3.0.1 +info: + contact: + url: https://www.hivemq.com + description: > + # Introduction + + The HiveMQ Data Hub provides mechanisms to define how MQTT data and MQTT client behavior are handled in the HiveMQ broker. + + - Data Validation in the HiveMQ Data Hub allows you to implement declarative policies that check whether your data sources are sending data in the data format you expect. + + - Behavior Validation gives you the ability to model the behavior of your MQTT clients throughout the entire lifecycle of the client. + + ## Errors + + Conventional HTTP response codes are used to indicate the success or failure + of an API request. Codes in the 2xx range generally indicate success. Codes + in the 4xx range indicate an error that failed given the information + provided (e.g., a required parameter was omitted). Codes in the 5xx range + indicate an error on the server side. + + + For all errors a JSON response with additional details is returned in the + format [Problem JSON](https://tools.ietf.org/html/rfc7807). + + ## OpenAPI + + HiveMQ's REST API provides an OpenAPI 3.0 schema definition that can + imported into popular API tooling (e.g. Postman) or can be used to generate + client-code for multiple programming languages. + title: HiveMQ Data Hub REST API + version: 2025.10-SNAPSHOT + x-logo: + url: https://www.hivemq.com/img/svg/hivemq-bee.svg +tags: + - description: >- + This resource bundles endpoints for the available Finite State Machines + (FSMs) for Behavior Policies for the HiveMQ Data Hub. Currently this is + limited to getting the available FSMs. + name: Data Hub - FSM + - description: >- + This resource bundles endpoints for the available Functions for the HiveMQ + Data Hub. Currently this is limited to getting the available Functions. + name: Data Hub - Functions + - description: >- + Policies describe how you want the HiveMQ broker to validate the behavior + of MQTT clients. + + Each policy has four sections: + + + - Matching: Specifies which clients the policy engine validates. + + - Deserialization: Specifies deserializers for different message payloads. + + - Behavior: Specifies the behavior that is considered valid for matched + clients. + + - onTransitions: Specifies custom actions that are executed when a client + transitions to a different state within the specified behavior model that + is valid for that client. + + These endpoints can be used to create, update, delete, and list behavior + policies. + + + For more information on all capabilities the HiveMQ Data Hub offers, see + the [HiveMQ + documentation](https://docs.hivemq.com/hivemq/latest/data-hub/index.html). + name: Data Hub - Behavior Policies + - description: >- + Data Policies describe how you want the HiveMQ broker to apply schemas to + incoming MQTT message payload data and act on the validation results. + + Each policy has four sections: + + + - Matching: Specifies which packets the policy engine validates. + + - Validation: Specifies how the packets are validated. For example, based + on a JSON Schema. + + - OnSuccess: Defines which actions are executed when the outcome of a + validation is successful. + + - OnFailure: Defines which actions are executed when the validation fails. + + + These endpoints can be used to create, update, delete, and list data + policies. + + + For more information on all capabilities the HiveMQ Data Hub offers, see + the [HiveMQ + documentation](https://docs.hivemq.com/hivemq/latest/data-hub/index.html). + name: Data Hub - Data Policies + - description: >- + A schema defines the expected structure and format of incoming MQTT + message payload data. + + + This endpoint can be used to create, get, and delete schemas. + + + Schemas can be enforced with the use of a policy. + + + Currently, the following schema definitions are supported: + + + - [JSON Schema](https://json-schema.org/) + + - [Protocol Buffers (Protobuf)](https://protobuf.dev/) + + + For more information on how to define and use a schema in HiveMQ, see + [Schemas](https://docs.hivemq.com/hivemq/latest/data-hub/schemas.html). + name: Data Hub - Schemas + - description: >- + A script represents custom logic that can be executed in response to MQTT + messages. + + + This endpoint can be used to create, get, and delete scripts. + + + For more information on how to define and use a script in HiveMQ, see + [Scripts](https://docs.hivemq.com/hivemq/latest/data-hub/scripts.html). + name: Data Hub - Scripts + - description: >+ + These endpoints can be used to retrieve states of clients for the Data + Hub. + + name: Data Hub - State +paths: + /api/v1/data-hub/behavior-validation/policies: + $ref: paths/api_v1_data-hub_behavior-validation_policies.yaml + /api/v1/data-hub/behavior-validation/policies/{policyId}: + $ref: paths/api_v1_data-hub_behavior-validation_policies_{policyId}.yaml + /api/v1/data-hub/behavior-validation/states/{clientId}: + $ref: paths/api_v1_data-hub_behavior-validation_states_{clientId}.yaml + /api/v1/data-hub/data-validation/policies: + $ref: paths/api_v1_data-hub_data-validation_policies.yaml + /api/v1/data-hub/data-validation/policies/{policyId}: + $ref: paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml + /api/v1/data-hub/fsm: + $ref: paths/api_v1_data-hub_fsm.yaml + /api/v1/data-hub/functions: + $ref: paths/api_v1_data-hub_functions.yaml + /api/v1/data-hub/function-specs: + $ref: paths/api_v1_data-hub_function-specs.yaml + /api/v1/data-hub/schemas: + $ref: paths/api_v1_data-hub_schemas.yaml + /api/v1/data-hub/schemas/{schemaId}: + $ref: paths/api_v1_data-hub_schemas_{schemaId}.yaml + /api/v1/data-hub/scripts: + $ref: paths/api_v1_data-hub_scripts.yaml + /api/v1/data-hub/scripts/{scriptId}: + $ref: paths/api_v1_data-hub_scripts_{scriptId}.yaml From 27ee05d55361c6399c87de0b5aaec9d92fcd36cf Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Fri, 27 Jun 2025 11:37:56 +0200 Subject: [PATCH 089/121] fix: Generate openapi spec --- ext/hivemq-edge-openapi-2025.11.yaml | 1718 +++++++++++++++++++++++--- 1 file changed, 1580 insertions(+), 138 deletions(-) diff --git a/ext/hivemq-edge-openapi-2025.11.yaml b/ext/hivemq-edge-openapi-2025.11.yaml index b9ef383fa6..6b7939376f 100644 --- a/ext/hivemq-edge-openapi-2025.11.yaml +++ b/ext/hivemq-edge-openapi-2025.11.yaml @@ -354,12 +354,23 @@ paths: schema: $ref: '#/components/schemas/BehaviorPolicyList' description: Success + '400': + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/InvalidQueryParameterError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' + description: URL parameter missing '503': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporarily not available + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Get all policies tags: - Data Hub - Behavior Policies @@ -446,32 +457,43 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + oneOf: + - $ref: '#/components/schemas/BehaviorPolicyCreationFailureError' + - $ref: '#/components/schemas/BehaviorPolicyInvalidErrors' + - $ref: '#/components/schemas/BehaviorPolicyRejectedError' + - $ref: '#/components/schemas/RequestBodyMissingError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError: '#/components/schemas/BehaviorPolicyCreationFailureError' + https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors: '#/components/schemas/BehaviorPolicyInvalidErrors' + https://hivemq.com/edge/api/model/BehaviorPolicyRejectedError: '#/components/schemas/BehaviorPolicyRejectedError' + https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' description: Policy creation failed '409': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Already exists + $ref: '#/components/schemas/BehaviorPolicyAlreadyPresentError' + description: Behavior policy already present '500': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Internal error + $ref: '#/components/schemas/InternalServerError' + description: Internal server error '503': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporarily unavailable + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable '507': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Insufficient storage error + $ref: '#/components/schemas/PolicyInsufficientStorageError' + description: Insufficient storage summary: Create a new policy tags: - Data Hub - Behavior Policies @@ -503,32 +525,37 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' description: URL parameter missing '404': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Policy not found + $ref: '#/components/schemas/PolicyNotFoundError' + description: Behavior policy not found '412': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/PreconditionFailedError' description: Precondition failed '500': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Internal error + $ref: '#/components/schemas/InternalServerError' + description: Internal server error '503': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporarily not available + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Delete a behavior policy tags: - Data Hub - Behavior Policies @@ -598,14 +625,31 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Invalid query parameter + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + description: Bad request '404': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/BehaviorPolicyNotFoundError' description: Policy not found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerError' + description: Internal server error + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Get a policy tags: - Data Hub - Behavior Policies @@ -708,39 +752,54 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Policy creation failed + oneOf: + - $ref: '#/components/schemas/RequestBodyMissingError' + - $ref: '#/components/schemas/UrlParameterMissingError' + - $ref: '#/components/schemas/BehaviorPolicyCreationFailureError' + - $ref: '#/components/schemas/BehaviorPolicyInvalidErrors' + - $ref: '#/components/schemas/BehaviorPolicyUpdateFailureError' + - $ref: '#/components/schemas/PolicyIdMismatchError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError: '#/components/schemas/BehaviorPolicyCreationFailureError' + https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors: '#/components/schemas/BehaviorPolicyInvalidErrors' + https://hivemq.com/edge/api/model/BehaviorPolicyUpdateFailureError: '#/components/schemas/BehaviorPolicyUpdateFailureError' + https://hivemq.com/edge/api/model/PolicyIdMismatchError: '#/components/schemas/PolicyIdMismatchError' + description: Behavior policy creation failed '404': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Policy not found + $ref: '#/components/schemas/BehaviorPolicyNotFoundError' + description: Data policy not found '412': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/PreconditionFailedError' description: Precondition failed '500': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Internal error + $ref: '#/components/schemas/InternalServerError' + description: Internal server error '503': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporarily unavailable + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable '507': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Insufficient storage error - summary: Update an existing policy + $ref: '#/components/schemas/PolicyInsufficientStorageError' + description: Insufficient storage + summary: Update an existing behavior policy tags: - Data Hub - Behavior Policies /api/v1/data-hub/behavior-validation/states/{clientId}: @@ -786,20 +845,32 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' description: URL parameter missing '404': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Client is disconnected + oneOf: + - $ref: '#/components/schemas/ClientDisconnectedError' + - $ref: '#/components/schemas/ClientNotFoundError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/ClientDisconnectedError: '#/components/schemas/ClientDisconnectedError' + https://hivemq.com/edge/api/model/ClientNotFoundError: '#/components/schemas/ClientNotFoundError' + description: Client error '500': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Internal Server error + $ref: '#/components/schemas/InternalServerError' + description: Internal server error summary: Get the state of a client tags: - Data Hub - State @@ -1050,25 +1121,18 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + oneOf: + - $ref: '#/components/schemas/InvalidQueryParameterError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' description: URL parameter missing - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/ProblemDetails' - description: DataPolicy not found - '500': - content: - application/json: - schema: - $ref: '#/components/schemas/ProblemDetails' - description: Internal server error '503': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable summary: Get all data policies tags: @@ -1154,31 +1218,42 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: DataPolicy creation failed + oneOf: + - $ref: '#/components/schemas/RequestBodyMissingError' + - $ref: '#/components/schemas/DataPolicyCreationFailureError' + - $ref: '#/components/schemas/DataPolicyInvalidErrors' + - $ref: '#/components/schemas/DataPolicyRejectedError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' + https://hivemq.com/edge/api/model/DataPolicyCreationFailureError: '#/components/schemas/DataPolicyCreationFailureError' + https://hivemq.com/edge/api/model/DataPolicyInvalidErrors: '#/components/schemas/DataPolicyInvalidErrors' + https://hivemq.com/edge/api/model/DataPolicyRejectedError: '#/components/schemas/DataPolicyRejectedError' + description: Data policy creation failed '409': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: DataPolicy already present + $ref: '#/components/schemas/DataPolicyAlreadyPresentError' + description: Data policy already present '500': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable '507': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/PolicyInsufficientStorageError' description: Insufficient storage summary: Create a new data policy tags: @@ -1211,25 +1286,36 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' description: URL parameter missing '404': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: DataPolicy not found + $ref: '#/components/schemas/PolicyNotFoundError' + description: Data policy not found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/PreconditionFailedError' + description: Precondition failed '500': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable summary: Delete a data policy tags: @@ -1298,31 +1384,32 @@ paths: '400': content: application/json: - examples: - param-missing: - description: Example response when a required parameter is missing. - summary: Required URL parameter missing - value: - errors: - - title: Required parameter missing - detail: Required URL parameter 'parameterName' is missing schema: - $ref: '#/components/schemas/ProblemDetails' + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' description: Bad request '404': content: application/json: - examples: - not-found: - description: Policy not found - summary: Not found - value: - errors: - - title: Resource not found - detail: Resource with id 'my-resource-id' not found schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/PolicyNotFoundError' description: Resource not found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerError' + description: Internal server error + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Get a data policy tags: - Data Hub - Data Policies @@ -1424,31 +1511,54 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: DataPolicy creation failed + oneOf: + - $ref: '#/components/schemas/RequestBodyMissingError' + - $ref: '#/components/schemas/UrlParameterMissingError' + - $ref: '#/components/schemas/DataPolicyCreationFailureError' + - $ref: '#/components/schemas/DataPolicyInvalidErrors' + - $ref: '#/components/schemas/DataPolicyUpdateFailureError' + - $ref: '#/components/schemas/PolicyIdMismatchError' + - $ref: '#/components/schemas/TopicFilterMismatchError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + https://hivemq.com/edge/api/model/DataPolicyCreationFailureError: '#/components/schemas/DataPolicyCreationFailureError' + https://hivemq.com/edge/api/model/DataPolicyInvalidErrors: '#/components/schemas/DataPolicyInvalidErrors' + https://hivemq.com/edge/api/model/DataPolicyUpdateFailureError: '#/components/schemas/DataPolicyUpdateFailureError' + https://hivemq.com/edge/api/model/PolicyIdMismatchError: '#/components/schemas/PolicyIdMismatchError' + https://hivemq.com/edge/api/model/TopicFilterMismatchError: '#/components/schemas/TopicFilterMismatchError' + description: Data policy creation failed '404': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: DataPolicy not found + $ref: '#/components/schemas/DataPolicyNotFoundError' + description: Data policy not found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/PreconditionFailedError' + description: Precondition failed '500': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable '507': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/PolicyInsufficientStorageError' description: Insufficient storage summary: Update an existing data policy tags: @@ -1536,7 +1646,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Errors' + $ref: '#/components/schemas/InternalServerError' description: Internal server error summary: Get all FSMs as a JSON Schema tags: @@ -1698,7 +1808,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error summary: Get all functions as a JSON Schema tags: @@ -1738,7 +1848,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error summary: Get all functions as a list of function specifications tags: @@ -1873,11 +1983,22 @@ paths: schema: $ref: '#/components/schemas/SchemaList' description: Success + '400': + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/InvalidQueryParameterError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' + description: URL parameter missing '503': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable summary: Get all schemas tags: @@ -1926,31 +2047,46 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Schema could not be validatetd + oneOf: + - $ref: '#/components/schemas/RequestBodyParameterMissingError' + - $ref: '#/components/schemas/SchemaInvalidErrors' + - $ref: '#/components/schemas/SchemaParsingFailureError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/RequestBodyParameterMissingError: '#/components/schemas/RequestBodyParameterMissingError' + https://hivemq.com/edge/api/model/SchemaInvalidErrors: '#/components/schemas/SchemaInvalidErrors' + https://hivemq.com/edge/api/model/SchemaParsingFailureError: '#/components/schemas/SchemaParsingFailureError' + description: Schema creation failed '409': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Schema already exists + $ref: '#/components/schemas/SchemaAlreadyPresentError' + description: Schema is already present '412': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Mismatch between schema and etag + $ref: '#/components/schemas/SchemaEtagMismatchError' + description: Schema doesn't match etag '500': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable '507': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/SchemaInsufficientStorageError' description: Insufficient storage summary: Create a new schema tags: @@ -1983,31 +2119,38 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Schema referenced + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + - $ref: '#/components/schemas/SchemaReferencedError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + https://hivemq.com/edge/api/model/SchemaReferencedError: '#/components/schemas/SchemaReferencedError' + description: URL parameter missing '404': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/SchemaNotFoundError' description: Schema not found '412': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Mismatch between schema and etag + $ref: '#/components/schemas/SchemaEtagMismatchError' + description: Schema doesn't match etag '500': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Internal server error + $ref: '#/components/schemas/InternalServerError' + description: Internal Server error '503': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable summary: Delete all versions of the schema tags: @@ -2055,20 +2198,31 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: A url parameter is missing + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + description: URL parameter missing '404': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/SchemaNotFoundError' description: Schema not found '500': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Get a schema tags: - Data Hub - Schemas @@ -2189,12 +2343,23 @@ paths: schema: $ref: '#/components/schemas/ScriptList' description: Success + '400': + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/InvalidQueryParameterError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' + description: URL parameter missing '503': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporary not available + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Get all scripts tags: - Data Hub - Scripts @@ -2242,37 +2407,50 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Script is invalid + oneOf: + - $ref: '#/components/schemas/RequestBodyParameterMissingError' + - $ref: '#/components/schemas/ScriptCreationFailureError' + - $ref: '#/components/schemas/ScriptInvalidErrors' + - $ref: '#/components/schemas/ScriptParsingFailureError' + - $ref: '#/components/schemas/ScriptSanitationFailureError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/RequestBodyParameterMissingError: '#/components/schemas/RequestBodyParameterMissingError' + https://hivemq.com/edge/api/model/ScriptCreationFailureError: '#/components/schemas/ScriptCreationFailureError' + https://hivemq.com/edge/api/model/ScriptInvalidErrors: '#/components/schemas/ScriptInvalidErrors' + https://hivemq.com/edge/api/model/ScriptParsingFailureError: '#/components/schemas/ScriptParsingFailureError' + https://hivemq.com/edge/api/model/ScriptSanitationFailureError: '#/components/schemas/ScriptSanitationFailureError' + description: Script creation failed '409': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/ScriptAlreadyPresentError' description: Script is already present '412': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/ScriptEtagMismatchError' description: Script doesn't match etag '500': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporary not available + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable '507': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/ScriptInsufficientStorageError' description: Insufficient storage summary: Create a new script tags: @@ -2302,32 +2480,39 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Script is referenced + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + - $ref: '#/components/schemas/ScriptReferencedError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + https://hivemq.com/edge/api/model/ScriptReferencedError: '#/components/schemas/ScriptReferencedError' + description: URL parameter missing '404': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/ScriptNotFoundError' description: Script not found '412': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/ScriptEtagMismatchError' description: Script doesn't match etag '500': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal Server error '503': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporary not available + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Delete a script tags: - Data Hub - Scripts @@ -2370,26 +2555,31 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' description: URL parameter missing '404': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/ScriptNotFoundError' description: Script not found '500': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal Server error '503': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporary not available + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Get a script tags: - Data Hub - Scripts @@ -4504,6 +4694,7 @@ components: detail: type: string errors: + deprecated: true type: array items: $ref: '#/components/schemas/Error' @@ -4668,6 +4859,1259 @@ components: description: List of result items that are returned by this endpoint items: $ref: '#/components/schemas/BehaviorPolicy' + ApiError: + allOf: + - $ref: '#/components/schemas/ProblemDetails' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/BehaviorPolicyAlreadyPresentError: '#/components/schemas/BehaviorPolicyAlreadyPresentError' + https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError: '#/components/schemas/BehaviorPolicyCreationFailureError' + https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors: '#/components/schemas/BehaviorPolicyInvalidErrors' + https://hivemq.com/edge/api/model/BehaviorPolicyNotFoundError: '#/components/schemas/BehaviorPolicyNotFoundError' + https://hivemq.com/edge/api/model/BehaviorPolicyRejectedError: '#/components/schemas/BehaviorPolicyRejectedError' + https://hivemq.com/edge/api/model/BehaviorPolicyUpdateFailureError: '#/components/schemas/BehaviorPolicyUpdateFailureError' + https://hivemq.com/edge/api/model/ClientDisconnectedError: '#/components/schemas/ClientDisconnectedError' + https://hivemq.com/edge/api/model/ClientNotFoundError: '#/components/schemas/ClientNotFoundError' + https://hivemq.com/edge/api/model/DataPolicyAlreadyPresentError: '#/components/schemas/DataPolicyAlreadyPresentError' + https://hivemq.com/edge/api/model/DataPolicyCreationFailureError: '#/components/schemas/DataPolicyCreationFailureError' + https://hivemq.com/edge/api/model/DataPolicyInvalidErrors: '#/components/schemas/DataPolicyInvalidErrors' + https://hivemq.com/edge/api/model/DataPolicyNotFoundError: '#/components/schemas/DataPolicyNotFoundError' + https://hivemq.com/edge/api/model/DataPolicyRejectedError: '#/components/schemas/DataPolicyRejectedError' + https://hivemq.com/edge/api/model/DataPolicyUpdateFailureError: '#/components/schemas/DataPolicyUpdateFailureError' + https://hivemq.com/edge/api/model/PolicyIdMismatchError: '#/components/schemas/PolicyIdMismatchError' + https://hivemq.com/edge/api/model/PolicyInsufficientStorageError: '#/components/schemas/PolicyInsufficientStorageError' + https://hivemq.com/edge/api/model/PolicyNotFoundError: '#/components/schemas/PolicyNotFoundError' + https://hivemq.com/edge/api/model/SchemaAlreadyPresentError: '#/components/schemas/SchemaAlreadyPresentError' + https://hivemq.com/edge/api/model/SchemaEtagMismatchError: '#/components/schemas/SchemaEtagMismatchError' + https://hivemq.com/edge/api/model/SchemaInsufficientStorageError: '#/components/schemas/SchemaInsufficientStorageError' + https://hivemq.com/edge/api/model/SchemaInvalidErrors: '#/components/schemas/SchemaInvalidErrors' + https://hivemq.com/edge/api/model/SchemaNotFoundError: '#/components/schemas/SchemaNotFoundError' + https://hivemq.com/edge/api/model/SchemaParsingFailureError: '#/components/schemas/SchemaParsingFailureError' + https://hivemq.com/edge/api/model/SchemaReferencedError: '#/components/schemas/SchemaReferencedError' + https://hivemq.com/edge/api/model/ScriptAlreadyPresentError: '#/components/schemas/ScriptAlreadyPresentError' + https://hivemq.com/edge/api/model/ScriptCreationFailureError: '#/components/schemas/ScriptCreationFailureError' + https://hivemq.com/edge/api/model/ScriptEtagMismatchError: '#/components/schemas/ScriptEtagMismatchError' + https://hivemq.com/edge/api/model/ScriptInsufficientStorageError: '#/components/schemas/ScriptInsufficientStorageError' + https://hivemq.com/edge/api/model/ScriptInvalidErrors: '#/components/schemas/ScriptInvalidErrors' + https://hivemq.com/edge/api/model/ScriptNotFoundError: '#/components/schemas/ScriptNotFoundError' + https://hivemq.com/edge/api/model/ScriptParsingFailureError: '#/components/schemas/ScriptParsingFailureError' + https://hivemq.com/edge/api/model/ScriptReferencedError: '#/components/schemas/ScriptReferencedError' + https://hivemq.com/edge/api/model/ScriptSanitationFailureError: '#/components/schemas/ScriptSanitationFailureError' + https://hivemq.com/edge/api/model/TopicFilterMismatchError: '#/components/schemas/TopicFilterMismatchError' + https://hivemq.com/edge/api/model/InsufficientStorageError: '#/components/schemas/InsufficientStorageError' + https://hivemq.com/edge/api/model/InternalServerError: '#/components/schemas/InternalServerError' + https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' + https://hivemq.com/edge/api/model/PreconditionFailedError: '#/components/schemas/PreconditionFailedError' + https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' + https://hivemq.com/edge/api/model/RequestBodyParameterMissingError: '#/components/schemas/RequestBodyParameterMissingError' + https://hivemq.com/edge/api/model/TemporaryNotAvailableError: '#/components/schemas/TemporaryNotAvailableError' + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + BehaviorPolicyAlreadyPresentError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The behavior policy id. + example: abc + required: + - id + example: + general: + status: 409 + title: Behavior Policy Already Present + detail: The given behavior policy 'abc' is already present. + id: abc + type: https://hivemq.com/edge/api/model/BehaviorPolicyAlreadyPresentError + BehaviorPolicyCreationFailureError: + allOf: + - $ref: '#/components/schemas/ApiError' + example: + general: + status: 400 + title: Behavior Policy Creation Failed + detail: 'Behavior policy creation failed: The policy was rejected.' + type: https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError + AtLeastOneFieldMissingValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + paths: + type: array + description: The missing json paths. + items: + type: string + format: json-path + description: The json path. + example: + - $.field1 + - $.field2 + required: + - paths + example: + general: + detail: 'At least one of the fields must be present: ''$.field1'', ''$.field2''.' + paths: + - $.field1 + - $.field2 + type: https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError + ValidationError: + type: object + properties: + detail: + type: string + description: Detailed contextual description of the validation error. + type: + type: string + format: uri + description: Type of the validation error. + required: + - detail + - type + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError: '#/components/schemas/AtLeastOneFieldMissingValidationError' + https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError: '#/components/schemas/AtMostOneFunctionValidationError' + https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' + https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError: '#/components/schemas/FunctionMustBePairedValidationError' + https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError: '#/components/schemas/IllegalEventTransitionValidationError' + https://hivemq.com/edge/api/model/IllegalFunctionValidationError: '#/components/schemas/IllegalFunctionValidationError' + https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' + https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' + https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError: '#/components/schemas/InvalidFunctionOrderValidationError' + https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' + https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError: '#/components/schemas/InvalidSchemaVersionValidationError' + https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' + https://hivemq.com/edge/api/model/UnknownVariableValidationError: '#/components/schemas/UnknownVariableValidationError' + https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' + AtMostOneFunctionValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + function: + type: string + description: The function. + example: function1 + occurrences: + type: integer + format: int32 + description: The occurrences of the function. + minimum: 0 + example: 3 + paths: + type: array + items: + type: string + format: json-path + description: The json paths where the function occurs. + example: + - $.path1 + - $.path2 + - $.path3 + required: + - function + - occurrences + - paths + example: + general: + detail: The pipeline must contain at most one 'function1' function, but 3 were found at ['$.path1', '$.path2', '$.path3']. + function: function1 + occurrences: 3 + paths: + - $.path1 + - $.path2 + - $.path3 + type: https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError + EmptyFieldValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + path: + type: string + format: json-path + description: The missing field. + example: $.field + required: + - path + example: + general: + detail: Required field '$.field' is empty. + path: $.field + type: https://hivemq.com/edge/api/model/EmptyFieldValidationError + FunctionMustBePairedValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + existingFunction: + type: string + description: The existing function. + example: function1 + missingFunction: + type: string + description: The missing function. + example: function2 + required: + - existingFunction + - missingFunction + example: + general: + detail: If 'function1' function is present in the pipeline, 'function2' function must be present as well. + existingFunction: function1 + missingFunction: function2 + type: https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError + IllegalEventTransitionValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + event: + type: string + description: The event name. + example: event1 + fromState: + type: string + description: The event from state. + example: state1 + id: + type: string + description: The event id. + example: abc + path: + type: string + description: The path. + example: $.event + toState: + type: string + description: The event to state. + example: state2 + required: + - event + - fromState + - id + - path + - toState + example: + general: + detail: The transition from state 'state1' to state 'state2' on event 'event1' in '$.event' is not defined for behavior 'abc'. + event: event1 + fromState: state1 + toState: state2 + id: abc + path: $.event + type: https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError + IllegalFunctionValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + event: + type: string + description: The event name. + example: event1 + id: + type: string + description: The function id. + example: abc + path: + type: string + format: json-path + description: The json path. + example: $.event + required: + - event + - id + - path + example: + general: + detail: The function 'abc' is not allowed for event 'event1' in '$.event'. + event: event1 + id: abc + path: $.event + type: https://hivemq.com/edge/api/model/IllegalFunctionValidationError + InvalidFieldLengthValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + actualLength: + type: integer + format: int32 + description: The actual length of the field value. + example: 10 + expectedMinimumLength: + type: integer + format: int32 + description: The minimum length expected for the field value. + minimum: 0 + example: 5 + expectedMaximumLength: + type: integer + format: int32 + description: The maximum length expected for the field value. + minimum: 0 + example: 20 + path: + type: string + format: json-path + description: The invalid json path. + example: $.field + value: + type: string + description: The invalid value. + example: function transform() { return 'Hello, World!'; } + required: + - actualLength + - expectedMinimumLength + - expectedMaximumLength + - path + - value + example: + general: + detail: The length of script field '$.transform' 48 must be between 0 and 20. + actualLength: 48 + minimumLength: 0 + maximumLength: 20 + path: $.transform + value: function transform() { return 'Hello, World!'; } + type: https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError + InvalidFieldValueValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + path: + type: string + format: json-path + description: The invalid json path. + example: $.action.pipeline[1].field + value: + type: string + description: The invalid value. + example: functionDoesNotExist + required: + - path + example: + general: + detail: Referenced function does not exist. + path: $.action.pipeline[1].field + value: functionDoesNotExist + type: https://hivemq.com/edge/api/model/InvalidFieldValueValidationError + InvalidFunctionOrderValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + function: + type: string + description: The function. + example: transform + path: + type: string + format: json-path + description: The json path. + example: $.path + previousFunction: + type: string + description: The previous function. + example: init + required: + - function + - path + - previousFunction + example: + general: + detail: The operation at '$.path' with the functionId 'transform' must be after a 'init' operation. + function: transform + path: $.path + previousFunction: init + type: https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError + InvalidIdentifierValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + path: + type: string + format: json-path + description: The invalid identifier path. + example: $.id + value: + type: string + description: The invalid identifier value. + example: invalidId + required: + - path + - value + example: + general: + detail: Identifier script 'id' must begin with a letter and may only consist of lowercase letters, uppercase letters, numbers, periods, hyphens, and underscores. + path: $.id + value: invalidId + type: https://hivemq.com/edge/api/model/InvalidIdentifierValidationError + InvalidSchemaVersionValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + id: + type: string + description: The schema id. + example: abc + version: + type: string + description: The schema version. + example: '2' + required: + - id + - version + example: + general: + detail: The referenced schema with id 'abc' and version '2' was not found. + id: abc + version: '2' + type: https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError + MissingFieldValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + path: + type: string + format: json-path + description: The missing path. + example: $.id + required: + - path + example: + general: + detail: Required field '$.id' is missing. + path: $.id + type: https://hivemq.com/edge/api/model/MissingFieldValidationError + UnknownVariableValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + path: + type: string + description: The json path of the field. + example: $.path + variables: + type: array + items: + type: string + description: The unknown variables. + example: + - a + - b + - c + required: + - path + - variables + example: + general: + detail: 'Field ''$.path'' contains unknown variables: [a, b, c].' + path: $.path + variables: + - a + - b + - c + type: https://hivemq.com/edge/api/model/UnknownVariableValidationError + UnsupportedFieldValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + actualValue: + type: string + description: The actual value. + expectedValue: + type: string + description: The expected value. + path: + type: string + format: json-path + description: The json path. + example: $.id + required: + - actualValue + - expectedValue + - path + example: + general: + detail: Unsupported type 'String' for field '$.id'. Expected type is 'Object'. + actualValue: String + expectedValue: Object + path: $.id + type: https://hivemq.com/edge/api/model/UnsupportedFieldValidationError + BehaviorPolicyValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - oneOf: + - $ref: '#/components/schemas/IllegalEventTransitionValidationError' + - $ref: '#/components/schemas/IllegalFunctionValidationError' + - $ref: '#/components/schemas/InvalidSchemaVersionValidationError' + - $ref: '#/components/schemas/AtLeastOneFieldMissingValidationError' + - $ref: '#/components/schemas/EmptyFieldValidationError' + - $ref: '#/components/schemas/InvalidFieldLengthValidationError' + - $ref: '#/components/schemas/InvalidFieldValueValidationError' + - $ref: '#/components/schemas/InvalidIdentifierValidationError' + - $ref: '#/components/schemas/MissingFieldValidationError' + - $ref: '#/components/schemas/UnsupportedFieldValidationError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError: '#/components/schemas/AtLeastOneFieldMissingValidationError' + https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' + https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError: '#/components/schemas/IllegalEventTransitionValidationError' + https://hivemq.com/edge/api/model/IllegalFunctionValidationError: '#/components/schemas/IllegalFunctionValidationError' + https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' + https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' + https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' + https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError: '#/components/schemas/InvalidSchemaVersionValidationError' + https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' + https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' + BehaviorPolicyInvalidErrors: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + childErrors: + type: array + description: List of child validation errors. + items: + $ref: '#/components/schemas/BehaviorPolicyValidationError' + required: + - childErrors + example: + general: + status: 400 + title: Behavior Policy Invalid + detail: Behavior policy is invalid due to validation errors. + type: https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors + childErrors: + - detail: The transition from state 'state1' to state 'state2' on event 'event1' in '$.path' is not defined for behavior 'id1'. + fromState: state1 + toState: state2 + path: $.path + id: id1 + type: https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError + BehaviorPolicyNotFoundError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The data policy id. + example: abc + required: + - id + example: + general: + status: 404 + title: Behavior Policy Not Found + detail: Behavior policy with ID 'abc' is not found. + id: abc + type: https://hivemq.com/edge/api/model/BehaviorPolicyNotFoundError + BehaviorPolicyRejectedError: + allOf: + - $ref: '#/components/schemas/ApiError' + example: + general: + status: 400 + title: Behavior Policy Rejected + detail: Behavior policy is rejected. + type: https://hivemq.com/edge/api/model/BehaviorPolicyRejectedError + BehaviorPolicyUpdateFailureError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The ID of the policy that failed to update. + example: abc + required: + - id + example: + general: + status: 400 + title: Behavior Policy Update Failed + detail: Behavior policy with ID 'abc' update failed. + id: abc + type: https://hivemq.com/edge/api/model/BehaviorPolicyUpdateFailureError + ClientDisconnectedError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The client id. + example: abc + required: + - id + example: + general: + status: 404 + title: Client Disconnected + detail: Client with ID 'abc' is disconnected. + id: abc + type: https://hivemq.com/edge/api/model/ClientDisconnectedError + ClientNotFoundError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The client id. + example: abc + required: + - id + example: + general: + status: 404 + title: Client Not Found + detail: Client with ID 'abc' is not found. + id: abc + type: https://hivemq.com/edge/api/model/ClientNotFoundError + DataPolicyAlreadyPresentError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The data policy id. + example: abc + required: + - id + example: + general: + status: 409 + title: Data Policy Already Present + detail: The given data policy 'abc' is already present. + id: abc + type: https://hivemq.com/edge/api/model/DataPolicyAlreadyPresentError + DataPolicyCreationFailureError: + allOf: + - $ref: '#/components/schemas/ApiError' + example: + general: + status: 400 + title: Data Policy Creation Failed + detail: 'Data policy creation failed: The policy was rejected.' + type: https://hivemq.com/edge/api/model/DataPolicyCreationFailureError + DataPolicyValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - oneOf: + - $ref: '#/components/schemas/AtMostOneFunctionValidationError' + - $ref: '#/components/schemas/FunctionMustBePairedValidationError' + - $ref: '#/components/schemas/InvalidFunctionOrderValidationError' + - $ref: '#/components/schemas/InvalidSchemaVersionValidationError' + - $ref: '#/components/schemas/UnknownVariableValidationError' + - $ref: '#/components/schemas/EmptyFieldValidationError' + - $ref: '#/components/schemas/InvalidFieldLengthValidationError' + - $ref: '#/components/schemas/InvalidFieldValueValidationError' + - $ref: '#/components/schemas/InvalidIdentifierValidationError' + - $ref: '#/components/schemas/MissingFieldValidationError' + - $ref: '#/components/schemas/UnsupportedFieldValidationError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError: '#/components/schemas/AtMostOneFunctionValidationError' + https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' + https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError: '#/components/schemas/FunctionMustBePairedValidationError' + https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' + https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' + https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError: '#/components/schemas/InvalidFunctionOrderValidationError' + https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' + https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError: '#/components/schemas/InvalidSchemaVersionValidationError' + https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' + https://hivemq.com/edge/api/model/UnknownVariableValidationError: '#/components/schemas/UnknownVariableValidationError' + https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' + DataPolicyInvalidErrors: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + childErrors: + type: array + description: List of child validation errors. + items: + $ref: '#/components/schemas/DataPolicyValidationError' + required: + - childErrors + example: + general: + status: 400 + title: Data Policy Invalid + detail: Data policy is invalid due to validation errors. + type: https://hivemq.com/edge/api/model/DataPolicyInvalidErrors + childErrors: + - detail: The pipeline must contain at most one 'function1' function, but 3 were found at ['$.path1', '$.path2', '$.path3']. + function: function1 + occurrences: 3 + paths: + - $.path1 + - $.path2 + - $.path3 + type: https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError + DataPolicyNotFoundError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The data policy id. + example: abc + required: + - id + example: + general: + status: 404 + title: Data Policy Not Found + detail: Data policy with ID 'abc' is not found. + id: abc + type: https://hivemq.com/edge/api/model/DataPolicyNotFoundError + DataPolicyRejectedError: + allOf: + - $ref: '#/components/schemas/ApiError' + example: + general: + status: 400 + title: Data Policy Rejected + detail: Data policy is rejected. + type: https://hivemq.com/edge/api/model/DataPolicyRejectedError + DataPolicyUpdateFailureError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The ID of the policy that failed to update. + example: abc + required: + - id + example: + general: + status: 400 + title: Data Policy Update Failed + detail: Data policy with ID 'abc' update failed. + id: abc + type: https://hivemq.com/edge/api/model/DataPolicyUpdateFailureError + PolicyIdMismatchError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + actualId: + type: string + description: The actual id. + example: id1 + expectedId: + type: string + description: The expected id. + example: id2 + required: + - actualId + - expectedId + example: + general: + status: 400 + title: Policy ID Mismatch + detail: The policy ID 'id1' in the request parameter does not match the policy ID 'id2' in the policy request body. + id: abc + type: https://hivemq.com/edge/api/model/PolicyIdMismatchError + PolicyInsufficientStorageError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The policy id. + example: abc + required: + - id + example: + general: + status: 507 + title: Policy Insufficient Storage + detail: Policy with ID '123' could not be added because of insufficient server storage. + id: abc + type: https://hivemq.com/edge/api/model/PolicyInsufficientStorageError + PolicyNotFoundError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The policy id. + example: abc + required: + - id + example: + general: + status: 404 + title: Policy Not Found + detail: Policy with ID 'abc' is not found. + id: abc + type: https://hivemq.com/edge/api/model/PolicyNotFoundError + SchemaAlreadyPresentError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The schema id. + example: abc + required: + - id + example: + general: + status: 409 + title: Schema Already Present + detail: The given schema is already present as the latest version for the schema id 'abc'. + id: abc + type: https://hivemq.com/edge/api/model/SchemaAlreadyPresentError + SchemaEtagMismatchError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The schema id. + example: abc + eTag: + type: string + description: The eTag. + example: 33a64df551425fcc55e4d42a148795d9f25f89d4 + required: + - id + example: + general: + status: 412 + title: Schema eTag Mismatch + detail: Schema with id 'abc' does not match the given etag '33a64df551425fcc55e4d42a148795d9f25f89d4'. + id: abc + eTag: 33a64df551425fcc55e4d42a148795d9f25f89d4 + type: https://hivemq.com/edge/api/model/SchemaEtagMismatchError + SchemaInsufficientStorageError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The policy id. + example: abc + required: + - id + example: + general: + status: 507 + title: Schema Insufficient Storage + detail: Schema with ID '123' could not be added because of insufficient server storage. + id: abc + type: https://hivemq.com/edge/api/model/SchemaInsufficientStorageError + SchemaValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - oneOf: + - $ref: '#/components/schemas/EmptyFieldValidationError' + - $ref: '#/components/schemas/InvalidFieldLengthValidationError' + - $ref: '#/components/schemas/InvalidFieldValueValidationError' + - $ref: '#/components/schemas/InvalidIdentifierValidationError' + - $ref: '#/components/schemas/MissingFieldValidationError' + - $ref: '#/components/schemas/UnsupportedFieldValidationError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' + https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' + https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' + https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' + https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' + https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' + SchemaInvalidErrors: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + childErrors: + type: array + description: List of child validation errors. + items: + $ref: '#/components/schemas/SchemaValidationError' + required: + - childErrors + example: + general: + status: 400 + title: Schema Invalid + detail: Schema is invalid due to validation errors. + type: https://hivemq.com/edge/api/model/SchemaInvalidErrors + childErrors: + - detail: The length of script field '$.id' 1025 must be between 0 and 1024. + paths: $.id + value: aaa...aaa + actualLength: 1025 + expectedMinimumLength: 0 + expectedMaximumLength: 1024 + type: https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError + SchemaNotFoundError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The schema ID. + example: abc + required: + - id + example: + general: + status: 404 + title: Schema Not Found + detail: Schema with ID 'abc' is not found. + id: abc + type: https://hivemq.com/edge/api/model/SchemaNotFoundError + SchemaParsingFailureError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + alias: + type: string + description: The schema alias. + example: abc + required: + - alias + example: + general: + status: 400 + title: Schema Parsing Failure + detail: The given schema 'abc' could not be parsed. + alias: abc + type: https://hivemq.com/edge/api/model/SchemaParsingFailureError + SchemaReferencedError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The schema ID. + example: abc + required: + - id + example: + general: + status: 400 + title: Schema Referenced + detail: Schema with ID 'abc' is referenced. + id: abc + type: https://hivemq.com/edge/api/model/SchemaReferencedError + ScriptAlreadyPresentError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The script id. + example: abc + required: + - id + example: + general: + status: 409 + title: Script Already Present + detail: The given script 'abc' is already present. + id: abc + type: https://hivemq.com/edge/api/model/ScriptAlreadyPresentError + ScriptCreationFailureError: + allOf: + - $ref: '#/components/schemas/ApiError' + example: + general: + status: 400 + title: Script Creation Failure + detail: The given script could not be created. + type: https://hivemq.com/edge/api/model/ScriptCreationFailureError + ScriptEtagMismatchError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The script id. + example: abc + eTag: + type: string + description: The eTag. + example: 33a64df551425fcc55e4d42a148795d9f25f89d4 + required: + - id + example: + general: + status: 412 + title: Script eTag Mismatch + detail: Script with id 'abc' does not match the given etag '33a64df551425fcc55e4d42a148795d9f25f89d4'. + id: abc + eTag: 33a64df551425fcc55e4d42a148795d9f25f89d4 + type: https://hivemq.com/edge/api/model/ScriptEtagMismatchError + ScriptInsufficientStorageError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The policy id. + example: abc + required: + - id + example: + general: + status: 507 + title: Script Insufficient Storage + detail: Script with ID '123' could not be added because of insufficient server storage. + id: abc + type: https://hivemq.com/edge/api/model/ScriptInsufficientStorageError + ScriptValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - oneOf: + - $ref: '#/components/schemas/InvalidFieldLengthValidationError' + - $ref: '#/components/schemas/InvalidFieldValueValidationError' + - $ref: '#/components/schemas/InvalidIdentifierValidationError' + - $ref: '#/components/schemas/MissingFieldValidationError' + - $ref: '#/components/schemas/UnsupportedFieldValidationError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' + https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' + https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' + https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' + https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' + ScriptInvalidErrors: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + childErrors: + type: array + description: List of child validation errors. + items: + $ref: '#/components/schemas/ScriptValidationError' + required: + - childErrors + example: + general: + status: 400 + title: Script Invalid + detail: Script is invalid due to validation errors. + type: https://hivemq.com/edge/api/model/ScriptInvalidErrors + childErrors: + - detail: The length of script field '$.id' 1025 must be between 0 and 1024. + paths: $.id + value: aaa...aaa + actualLength: 1025 + expectedMinimumLength: 0 + expectedMaximumLength: 1024 + type: https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError + ScriptNotFoundError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The script ID. + example: abc + required: + - id + example: + general: + status: 404 + title: Script Not Found + detail: Script with ID 'abc' is not found. + id: abc + type: https://hivemq.com/edge/api/model/ScriptNotFoundError + ScriptParsingFailureError: + allOf: + - $ref: '#/components/schemas/ApiError' + example: + general: + status: 400 + title: Script Parsing Failure + detail: The given script 'abc' could not be parsed. + type: https://hivemq.com/edge/api/model/ScriptParsingFailureError + ScriptReferencedError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The script ID. + example: abc + required: + - id + example: + general: + status: 400 + title: Script Referenced + detail: Script with ID 'abc' is referenced. + id: abc + type: https://hivemq.com/edge/api/model/ScriptReferencedError + ScriptSanitationFailureError: + allOf: + - $ref: '#/components/schemas/ApiError' + example: + general: + status: 400 + title: Script Sanitation Failure + detail: The given script could not be sanitized. + type: https://hivemq.com/edge/api/model/ScriptSanitationFailureError + TopicFilterMismatchError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + path: + type: string + description: The json path of the topic filter. + example: $.filter + required: + - path + example: + general: + status: 400 + title: Topic Filter Mismatch + detail: The topic filter '$.filter' mismatches. + type: https://hivemq.com/edge/api/model/TopicFilterMismatchError + InsufficientStorageError: + allOf: + - $ref: '#/components/schemas/ApiError' + example: + general: + status: 507 + title: Insufficient Storage + detail: Insufficient Storage. + type: https://hivemq.com/edge/api/model/InsufficientStorageError + InternalServerError: + allOf: + - $ref: '#/components/schemas/ApiError' + example: + general: + status: 500 + title: Internal Server Error + detail: An unexpected error occurred, check the logs. + type: https://hivemq.com/edge/api/model/InternalServerError + creation: + status: 500 + title: Internal Server Error + detail: 'An unexpected error occurred: Exception during creation of the Json Schema for functions.' + type: https://hivemq.com/edge/api/model/InternalServerError + InvalidQueryParameterError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + parameter: + type: string + description: The query parameter. + required: + - parameter + example: + general: + status: 400 + title: Query Parameter is Invalid + detail: 'Query parameter ''a'' is invalid: ''a'' could not be parsed.' + parameter: a + type: https://hivemq.com/edge/api/model/InvalidQueryParameterError + PreconditionFailedError: + allOf: + - $ref: '#/components/schemas/ApiError' + example: + general: + status: 412 + title: Precondition Failed + detail: 'A precondition required for fulfilling the request was not fulfilled: Policy does not match the given etag ''abc''.' + type: https://hivemq.com/edge/api/model/PreconditionFailedError + RequestBodyMissingError: + allOf: + - $ref: '#/components/schemas/ApiError' + example: + general: + status: 400 + title: Required Request Body Missing + detail: Required request body is missing. + type: https://hivemq.com/edge/api/model/RequestBodyMissingError + RequestBodyParameterMissingError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + parameter: + type: string + description: The the missing request body parameter. + required: + - parameter + example: + general: + status: 400 + title: Required Request Body Parameter Missing + detail: Required request body parameter 'a' is missing. + parameter: a + type: https://hivemq.com/edge/api/model/RequestBodyParameterMissingError + TemporaryNotAvailableError: + allOf: + - $ref: '#/components/schemas/ApiError' + example: + general: + status: 503 + title: Endpoint Temporarily not Available + detail: The endpoint is temporarily not available, please try again later. + type: https://hivemq.com/edge/api/model/TemporaryNotAvailableError + UrlParameterMissingError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + parameter: + type: string + description: The name of the missing parameter. + required: + - parameter + example: + general: + status: 400 + title: Required URL Parameter Missing + detail: Required URL parameter 'a' is missing. + parameter: a + type: https://hivemq.com/edge/api/model/UrlParameterMissingError JsonNode: type: object description: The arguments of the fsm derived from the behavior policy. @@ -4789,8 +6233,6 @@ components: description: List of result items that are returned by this endpoint items: $ref: '#/components/schemas/DataPolicy' - Errors: - type: object PolicyType: description: The type of policy in Data Hub type: string From f0c016b320a3512bbb548b4c76d60831c4543507 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Fri, 27 Jun 2025 13:32:06 +0200 Subject: [PATCH 090/121] fix: Remove duplicated const --- .../src/extensions/datahub/utils/datahub.utils.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/hivemq-edge-frontend/src/extensions/datahub/utils/datahub.utils.ts b/hivemq-edge-frontend/src/extensions/datahub/utils/datahub.utils.ts index bd795fdeed..8b86eee383 100644 --- a/hivemq-edge-frontend/src/extensions/datahub/utils/datahub.utils.ts +++ b/hivemq-edge-frontend/src/extensions/datahub/utils/datahub.utils.ts @@ -3,8 +3,6 @@ import { OperationData } from '@datahub/types.ts' export const DND_DESIGNER_NODE_TYPE = 'application/reactflow;type=designer-node' -export const DND_DESIGNER_NODE_TYPE = 'application/reactflow;type=designer-node' - export const SCRIPT_FUNCTION_SEPARATOR = ':' export const SCRIPT_FUNCTION_PREFIX = 'fn' export const SCRIPT_FUNCTION_LATEST = 'latest' From 8753563ecb25e3997a1cbbadec529ed0f005be38 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Mon, 30 Jun 2025 09:30:36 +0200 Subject: [PATCH 091/121] refactor: Change 500 for /api/v1/data-hub/interpolation-variables --- ext/hivemq-edge-openapi-2025.11.yaml | 2 +- .../openapi/paths/api_v1_data-hub_interpolation-variables.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/hivemq-edge-openapi-2025.11.yaml b/ext/hivemq-edge-openapi-2025.11.yaml index 6b7939376f..29ca936801 100644 --- a/ext/hivemq-edge-openapi-2025.11.yaml +++ b/ext/hivemq-edge-openapi-2025.11.yaml @@ -1828,7 +1828,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error summary: Get all interpolation variables tags: diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_interpolation-variables.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_interpolation-variables.yaml index 05b184908f..505d557738 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_interpolation-variables.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_interpolation-variables.yaml @@ -12,7 +12,7 @@ get: content: application/json: schema: - $ref: ../components/schemas/ProblemDetails.yaml + $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal server error summary: Get all interpolation variables tags: From 42cbc4782ac6f9cba4a39fefcd554d52741a121a Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Tue, 1 Jul 2025 13:07:01 +0200 Subject: [PATCH 092/121] feat: Add openAPI/templates/Java/typeInfoAnnotation.mustache --- ext/hivemq-edge-openapi-2025.11.yaml | 7 ++++- .../components/schemas/errors/ApiError.yaml | 5 ++++ ext/openAPI/templates/Java/README.md | 29 +++++++++++++++++++ .../Java/typeInfoAnnotation.mustache | 24 +++++++++++++++ hivemq-edge-openapi/openapi/openapi.yaml | 2 +- hivemq-edge/build.gradle.kts | 1 + 6 files changed, 66 insertions(+), 2 deletions(-) create mode 100644 ext/openAPI/templates/Java/README.md create mode 100644 ext/openAPI/templates/Java/typeInfoAnnotation.mustache diff --git a/ext/hivemq-edge-openapi-2025.11.yaml b/ext/hivemq-edge-openapi-2025.11.yaml index 29ca936801..1a70c79239 100644 --- a/ext/hivemq-edge-openapi-2025.11.yaml +++ b/ext/hivemq-edge-openapi-2025.11.yaml @@ -14,7 +14,7 @@ info: ## OpenAPI HiveMQ's REST API provides an OpenAPI 3.0 schema definition that can imported into popular API tooling (e.g. Postman) or can be used to generate client-code for multiple programming languages. title: HiveMQ Edge REST API - version: 2025.10-SNAPSHOT + version: 2025.11-SNAPSHOT x-logo: url: https://www.hivemq.com/img/svg/hivemq-bee.svg tags: @@ -4862,6 +4862,11 @@ components: ApiError: allOf: - $ref: '#/components/schemas/ProblemDetails' + - type: object + required: + - detail + - status + - type discriminator: propertyName: type mapping: diff --git a/ext/openAPI/components/schemas/errors/ApiError.yaml b/ext/openAPI/components/schemas/errors/ApiError.yaml index 8de85a314f..1f929c1023 100644 --- a/ext/openAPI/components/schemas/errors/ApiError.yaml +++ b/ext/openAPI/components/schemas/errors/ApiError.yaml @@ -1,5 +1,10 @@ allOf: - $ref: "../ProblemDetails.yaml" + - type: object + required: + - detail + - status + - type discriminator: propertyName: type mapping: diff --git a/ext/openAPI/templates/Java/README.md b/ext/openAPI/templates/Java/README.md new file mode 100644 index 0000000000..2b408e9b31 --- /dev/null +++ b/ext/openAPI/templates/Java/README.md @@ -0,0 +1,29 @@ +# OpenAPI Templates - Java + +This folder is for overwriting the default OpenAPI Java templates. + +## Where to Download the Templates? + +```bash +git clone https://github.com/OpenAPITools/openapi-generator.git +``` + +## Change Logs + +Last updated: 2025-07-01 + +### `typeInfoAnnotation.mustache` + +The discriminator name `type` conflicts with the JackSon `type`. This patch changes the JackSon `type` to `jsontype`. + +```diff +@JsonIgnoreProperties( +- value = "{{{discriminator.propertyBaseName}}}", // ignore manually set {{{discriminator.propertyBaseName}}}, it will be automatically generated by Jackson during serialization +- allowSetters = true // allows the {{{discriminator.propertyBaseName}}} to be set during deserialization + value = "json{{{discriminator.propertyBaseName}}}", // ignore manually set json{{{discriminator.propertyBaseName}}}, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the json{{{discriminator.propertyBaseName}}} to be set during deserialization +) + +- @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "{{{discriminator.propertyBaseName}}}", visible = true) ++ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "json{{{discriminator.propertyBaseName}}}", visible = true) +``` diff --git a/ext/openAPI/templates/Java/typeInfoAnnotation.mustache b/ext/openAPI/templates/Java/typeInfoAnnotation.mustache new file mode 100644 index 0000000000..76594d1956 --- /dev/null +++ b/ext/openAPI/templates/Java/typeInfoAnnotation.mustache @@ -0,0 +1,24 @@ +{{#jackson}} + +@JsonIgnoreProperties( + value = "json{{{discriminator.propertyBaseName}}}", // ignore manually set json{{{discriminator.propertyBaseName}}}, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the json{{{discriminator.propertyBaseName}}} to be set during deserialization +) + +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "json{{{discriminator.propertyBaseName}}}", visible = true) +{{#discriminator.mappedModels}} +{{#-first}} +@JsonSubTypes({ +{{/-first}} + @JsonSubTypes.Type(value = {{modelName}}.class, name = "{{^vendorExtensions.x-discriminator-value}}{{mappingName}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{vendorExtensions.x-discriminator-value}}}{{/vendorExtensions.x-discriminator-value}}"), +{{#-last}} +}) +{{/-last}} +{{/discriminator.mappedModels}} +{{/jackson}} +{{#jsonbPolymorphism}} +@JsonbTypeInfo(key = "{{{discriminator.propertyBaseName}}}"{{#discriminator.mappedModels}}{{#-first}}, value = { +{{/-first}} + @JsonbSubtype(alias = "{{^vendorExtensions.x-discriminator-value}}{{mappingName}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{vendorExtensions.x-discriminator-value}}}{{/vendorExtensions.x-discriminator-value}}", type = {{modelName}}.class), +{{#-last}} +}{{/-last}}{{/discriminator.mappedModels}}){{/jsonbPolymorphism}} \ No newline at end of file diff --git a/hivemq-edge-openapi/openapi/openapi.yaml b/hivemq-edge-openapi/openapi/openapi.yaml index eb6f8b5700..1c2b8f6eb4 100644 --- a/hivemq-edge-openapi/openapi/openapi.yaml +++ b/hivemq-edge-openapi/openapi/openapi.yaml @@ -30,7 +30,7 @@ info: imported into popular API tooling (e.g. Postman) or can be used to generate client-code for multiple programming languages. title: HiveMQ Edge REST API - version: 2025.14-SNAPSHOT + version: 2025.11-SNAPSHOT x-logo: url: https://www.hivemq.com/img/svg/hivemq-bee.svg tags: diff --git a/hivemq-edge/build.gradle.kts b/hivemq-edge/build.gradle.kts index 5c22c8a761..0e60453fc2 100644 --- a/hivemq-edge/build.gradle.kts +++ b/hivemq-edge/build.gradle.kts @@ -297,6 +297,7 @@ val buildDirectory = layout.buildDirectory.get() tasks.register("genJaxRs") { inputSpec.set("${projectDir}/../ext/hivemq-edge-openapi-${project.version}.yaml") outputDir.set("${buildDirectory}/generated/openapi") + templateDir.set("$projectDir/../ext/openapi/templates/Java") generatorName.set("jaxrs-spec") apiPackage.set("com.hivemq.edge.api") modelPackage.set("com.hivemq.edge.api.model") From 6d115d944b290e93d382e5082f7c23d6f0ade87a Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Tue, 1 Jul 2025 14:50:12 +0200 Subject: [PATCH 093/121] fix: Change openapi to openAPI --- hivemq-edge/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hivemq-edge/build.gradle.kts b/hivemq-edge/build.gradle.kts index 0e60453fc2..2847d90813 100644 --- a/hivemq-edge/build.gradle.kts +++ b/hivemq-edge/build.gradle.kts @@ -297,7 +297,7 @@ val buildDirectory = layout.buildDirectory.get() tasks.register("genJaxRs") { inputSpec.set("${projectDir}/../ext/hivemq-edge-openapi-${project.version}.yaml") outputDir.set("${buildDirectory}/generated/openapi") - templateDir.set("$projectDir/../ext/openapi/templates/Java") + templateDir.set("$projectDir/../ext/openAPI/templates/Java") generatorName.set("jaxrs-spec") apiPackage.set("com.hivemq.edge.api") modelPackage.set("com.hivemq.edge.api.model") From 4debea56d893350b406b11a968079d98d7ddc864 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Tue, 1 Jul 2025 15:05:47 +0200 Subject: [PATCH 094/121] chorg: Rebase from master --- ext/hivemq-edge-openapi-2025.12.yaml | 1727 ++++++++++++++++++++-- hivemq-edge-openapi/openapi/openapi.yaml | 2 +- 2 files changed, 1588 insertions(+), 141 deletions(-) diff --git a/ext/hivemq-edge-openapi-2025.12.yaml b/ext/hivemq-edge-openapi-2025.12.yaml index d89fb88f34..fcc4856987 100644 --- a/ext/hivemq-edge-openapi-2025.12.yaml +++ b/ext/hivemq-edge-openapi-2025.12.yaml @@ -14,7 +14,7 @@ info: ## OpenAPI HiveMQ's REST API provides an OpenAPI 3.0 schema definition that can imported into popular API tooling (e.g. Postman) or can be used to generate client-code for multiple programming languages. title: HiveMQ Edge REST API - version: 2025.10-SNAPSHOT + version: 2025.12-SNAPSHOT x-logo: url: https://www.hivemq.com/img/svg/hivemq-bee.svg tags: @@ -354,12 +354,23 @@ paths: schema: $ref: '#/components/schemas/BehaviorPolicyList' description: Success + '400': + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/InvalidQueryParameterError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' + description: URL parameter missing '503': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporarily not available + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Get all policies tags: - Data Hub - Behavior Policies @@ -446,32 +457,43 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + oneOf: + - $ref: '#/components/schemas/BehaviorPolicyCreationFailureError' + - $ref: '#/components/schemas/BehaviorPolicyInvalidErrors' + - $ref: '#/components/schemas/BehaviorPolicyRejectedError' + - $ref: '#/components/schemas/RequestBodyMissingError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError: '#/components/schemas/BehaviorPolicyCreationFailureError' + https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors: '#/components/schemas/BehaviorPolicyInvalidErrors' + https://hivemq.com/edge/api/model/BehaviorPolicyRejectedError: '#/components/schemas/BehaviorPolicyRejectedError' + https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' description: Policy creation failed '409': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Already exists + $ref: '#/components/schemas/BehaviorPolicyAlreadyPresentError' + description: Behavior policy already present '500': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Internal error + $ref: '#/components/schemas/InternalServerError' + description: Internal server error '503': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporarily unavailable + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable '507': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Insufficient storage error + $ref: '#/components/schemas/PolicyInsufficientStorageError' + description: Insufficient storage summary: Create a new policy tags: - Data Hub - Behavior Policies @@ -503,32 +525,37 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' description: URL parameter missing '404': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Policy not found + $ref: '#/components/schemas/PolicyNotFoundError' + description: Behavior policy not found '412': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/PreconditionFailedError' description: Precondition failed '500': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Internal error + $ref: '#/components/schemas/InternalServerError' + description: Internal server error '503': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporarily not available + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Delete a behavior policy tags: - Data Hub - Behavior Policies @@ -598,14 +625,31 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Invalid query parameter + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + description: Bad request '404': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/BehaviorPolicyNotFoundError' description: Policy not found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerError' + description: Internal server error + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Get a policy tags: - Data Hub - Behavior Policies @@ -708,39 +752,54 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Policy creation failed + oneOf: + - $ref: '#/components/schemas/RequestBodyMissingError' + - $ref: '#/components/schemas/UrlParameterMissingError' + - $ref: '#/components/schemas/BehaviorPolicyCreationFailureError' + - $ref: '#/components/schemas/BehaviorPolicyInvalidErrors' + - $ref: '#/components/schemas/BehaviorPolicyUpdateFailureError' + - $ref: '#/components/schemas/PolicyIdMismatchError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError: '#/components/schemas/BehaviorPolicyCreationFailureError' + https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors: '#/components/schemas/BehaviorPolicyInvalidErrors' + https://hivemq.com/edge/api/model/BehaviorPolicyUpdateFailureError: '#/components/schemas/BehaviorPolicyUpdateFailureError' + https://hivemq.com/edge/api/model/PolicyIdMismatchError: '#/components/schemas/PolicyIdMismatchError' + description: Behavior policy creation failed '404': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Policy not found + $ref: '#/components/schemas/BehaviorPolicyNotFoundError' + description: Data policy not found '412': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/PreconditionFailedError' description: Precondition failed '500': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Internal error + $ref: '#/components/schemas/InternalServerError' + description: Internal server error '503': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporarily unavailable + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable '507': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Insufficient storage error - summary: Update an existing policy + $ref: '#/components/schemas/PolicyInsufficientStorageError' + description: Insufficient storage + summary: Update an existing behavior policy tags: - Data Hub - Behavior Policies /api/v1/data-hub/behavior-validation/states/{clientId}: @@ -786,20 +845,32 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' description: URL parameter missing '404': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Client is disconnected + oneOf: + - $ref: '#/components/schemas/ClientDisconnectedError' + - $ref: '#/components/schemas/ClientNotFoundError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/ClientDisconnectedError: '#/components/schemas/ClientDisconnectedError' + https://hivemq.com/edge/api/model/ClientNotFoundError: '#/components/schemas/ClientNotFoundError' + description: Client error '500': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Internal Server error + $ref: '#/components/schemas/InternalServerError' + description: Internal server error summary: Get the state of a client tags: - Data Hub - State @@ -1050,25 +1121,18 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + oneOf: + - $ref: '#/components/schemas/InvalidQueryParameterError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' description: URL parameter missing - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/ProblemDetails' - description: DataPolicy not found - '500': - content: - application/json: - schema: - $ref: '#/components/schemas/ProblemDetails' - description: Internal server error '503': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable summary: Get all data policies tags: @@ -1154,31 +1218,42 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: DataPolicy creation failed + oneOf: + - $ref: '#/components/schemas/RequestBodyMissingError' + - $ref: '#/components/schemas/DataPolicyCreationFailureError' + - $ref: '#/components/schemas/DataPolicyInvalidErrors' + - $ref: '#/components/schemas/DataPolicyRejectedError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' + https://hivemq.com/edge/api/model/DataPolicyCreationFailureError: '#/components/schemas/DataPolicyCreationFailureError' + https://hivemq.com/edge/api/model/DataPolicyInvalidErrors: '#/components/schemas/DataPolicyInvalidErrors' + https://hivemq.com/edge/api/model/DataPolicyRejectedError: '#/components/schemas/DataPolicyRejectedError' + description: Data policy creation failed '409': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: DataPolicy already present + $ref: '#/components/schemas/DataPolicyAlreadyPresentError' + description: Data policy already present '500': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable '507': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/PolicyInsufficientStorageError' description: Insufficient storage summary: Create a new data policy tags: @@ -1211,25 +1286,36 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' description: URL parameter missing '404': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: DataPolicy not found + $ref: '#/components/schemas/PolicyNotFoundError' + description: Data policy not found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/PreconditionFailedError' + description: Precondition failed '500': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable summary: Delete a data policy tags: @@ -1298,31 +1384,32 @@ paths: '400': content: application/json: - examples: - param-missing: - description: Example response when a required parameter is missing. - summary: Required URL parameter missing - value: - errors: - - title: Required parameter missing - detail: Required URL parameter 'parameterName' is missing schema: - $ref: '#/components/schemas/ProblemDetails' + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' description: Bad request '404': content: application/json: - examples: - not-found: - description: Policy not found - summary: Not found - value: - errors: - - title: Resource not found - detail: Resource with id 'my-resource-id' not found schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/PolicyNotFoundError' description: Resource not found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerError' + description: Internal server error + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Get a data policy tags: - Data Hub - Data Policies @@ -1424,31 +1511,54 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: DataPolicy creation failed + oneOf: + - $ref: '#/components/schemas/RequestBodyMissingError' + - $ref: '#/components/schemas/UrlParameterMissingError' + - $ref: '#/components/schemas/DataPolicyCreationFailureError' + - $ref: '#/components/schemas/DataPolicyInvalidErrors' + - $ref: '#/components/schemas/DataPolicyUpdateFailureError' + - $ref: '#/components/schemas/PolicyIdMismatchError' + - $ref: '#/components/schemas/TopicFilterMismatchError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + https://hivemq.com/edge/api/model/DataPolicyCreationFailureError: '#/components/schemas/DataPolicyCreationFailureError' + https://hivemq.com/edge/api/model/DataPolicyInvalidErrors: '#/components/schemas/DataPolicyInvalidErrors' + https://hivemq.com/edge/api/model/DataPolicyUpdateFailureError: '#/components/schemas/DataPolicyUpdateFailureError' + https://hivemq.com/edge/api/model/PolicyIdMismatchError: '#/components/schemas/PolicyIdMismatchError' + https://hivemq.com/edge/api/model/TopicFilterMismatchError: '#/components/schemas/TopicFilterMismatchError' + description: Data policy creation failed '404': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: DataPolicy not found + $ref: '#/components/schemas/DataPolicyNotFoundError' + description: Data policy not found + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/PreconditionFailedError' + description: Precondition failed '500': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable '507': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/PolicyInsufficientStorageError' description: Insufficient storage summary: Update an existing data policy tags: @@ -1536,7 +1646,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Errors' + $ref: '#/components/schemas/InternalServerError' description: Internal server error summary: Get all FSMs as a JSON Schema tags: @@ -1698,7 +1808,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error summary: Get all functions as a JSON Schema tags: @@ -1718,7 +1828,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error summary: Get all interpolation variables tags: @@ -1738,7 +1848,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error summary: Get all functions as a list of function specifications tags: @@ -1873,11 +1983,22 @@ paths: schema: $ref: '#/components/schemas/SchemaList' description: Success + '400': + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/InvalidQueryParameterError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' + description: URL parameter missing '503': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable summary: Get all schemas tags: @@ -1926,31 +2047,46 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Schema could not be validatetd + oneOf: + - $ref: '#/components/schemas/RequestBodyParameterMissingError' + - $ref: '#/components/schemas/SchemaInvalidErrors' + - $ref: '#/components/schemas/SchemaParsingFailureError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/RequestBodyParameterMissingError: '#/components/schemas/RequestBodyParameterMissingError' + https://hivemq.com/edge/api/model/SchemaInvalidErrors: '#/components/schemas/SchemaInvalidErrors' + https://hivemq.com/edge/api/model/SchemaParsingFailureError: '#/components/schemas/SchemaParsingFailureError' + description: Schema creation failed '409': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Schema already exists + $ref: '#/components/schemas/SchemaAlreadyPresentError' + description: Schema is already present '412': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Mismatch between schema and etag + $ref: '#/components/schemas/SchemaEtagMismatchError' + description: Schema doesn't match etag '500': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable '507': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/SchemaInsufficientStorageError' description: Insufficient storage summary: Create a new schema tags: @@ -1983,31 +2119,38 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Schema referenced + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + - $ref: '#/components/schemas/SchemaReferencedError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + https://hivemq.com/edge/api/model/SchemaReferencedError: '#/components/schemas/SchemaReferencedError' + description: URL parameter missing '404': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/SchemaNotFoundError' description: Schema not found '412': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Mismatch between schema and etag + $ref: '#/components/schemas/SchemaEtagMismatchError' + description: Schema doesn't match etag '500': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Internal server error + $ref: '#/components/schemas/InternalServerError' + description: Internal Server error '503': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable summary: Delete all versions of the schema tags: @@ -2055,20 +2198,31 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: A url parameter is missing + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + description: URL parameter missing '404': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/SchemaNotFoundError' description: Schema not found '500': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Get a schema tags: - Data Hub - Schemas @@ -2189,12 +2343,23 @@ paths: schema: $ref: '#/components/schemas/ScriptList' description: Success + '400': + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/InvalidQueryParameterError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' + description: URL parameter missing '503': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporary not available + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Get all scripts tags: - Data Hub - Scripts @@ -2242,37 +2407,50 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Script is invalid + oneOf: + - $ref: '#/components/schemas/RequestBodyParameterMissingError' + - $ref: '#/components/schemas/ScriptCreationFailureError' + - $ref: '#/components/schemas/ScriptInvalidErrors' + - $ref: '#/components/schemas/ScriptParsingFailureError' + - $ref: '#/components/schemas/ScriptSanitationFailureError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/RequestBodyParameterMissingError: '#/components/schemas/RequestBodyParameterMissingError' + https://hivemq.com/edge/api/model/ScriptCreationFailureError: '#/components/schemas/ScriptCreationFailureError' + https://hivemq.com/edge/api/model/ScriptInvalidErrors: '#/components/schemas/ScriptInvalidErrors' + https://hivemq.com/edge/api/model/ScriptParsingFailureError: '#/components/schemas/ScriptParsingFailureError' + https://hivemq.com/edge/api/model/ScriptSanitationFailureError: '#/components/schemas/ScriptSanitationFailureError' + description: Script creation failed '409': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/ScriptAlreadyPresentError' description: Script is already present '412': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/ScriptEtagMismatchError' description: Script doesn't match etag '500': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporary not available + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable '507': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/ScriptInsufficientStorageError' description: Insufficient storage summary: Create a new script tags: @@ -2302,32 +2480,39 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Script is referenced + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + - $ref: '#/components/schemas/ScriptReferencedError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + https://hivemq.com/edge/api/model/ScriptReferencedError: '#/components/schemas/ScriptReferencedError' + description: URL parameter missing '404': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/ScriptNotFoundError' description: Script not found '412': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/ScriptEtagMismatchError' description: Script doesn't match etag '500': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal Server error '503': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporary not available + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Delete a script tags: - Data Hub - Scripts @@ -2370,26 +2555,31 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' description: URL parameter missing '404': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/ScriptNotFoundError' description: Script not found '500': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal Server error '503': content: application/json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporary not available + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Get a script tags: - Data Hub - Scripts @@ -4510,6 +4700,7 @@ components: detail: type: string errors: + deprecated: true type: array items: $ref: '#/components/schemas/Error' @@ -4674,6 +4865,1264 @@ components: description: List of result items that are returned by this endpoint items: $ref: '#/components/schemas/BehaviorPolicy' + ApiError: + allOf: + - $ref: '#/components/schemas/ProblemDetails' + - type: object + required: + - detail + - status + - type + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/BehaviorPolicyAlreadyPresentError: '#/components/schemas/BehaviorPolicyAlreadyPresentError' + https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError: '#/components/schemas/BehaviorPolicyCreationFailureError' + https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors: '#/components/schemas/BehaviorPolicyInvalidErrors' + https://hivemq.com/edge/api/model/BehaviorPolicyNotFoundError: '#/components/schemas/BehaviorPolicyNotFoundError' + https://hivemq.com/edge/api/model/BehaviorPolicyRejectedError: '#/components/schemas/BehaviorPolicyRejectedError' + https://hivemq.com/edge/api/model/BehaviorPolicyUpdateFailureError: '#/components/schemas/BehaviorPolicyUpdateFailureError' + https://hivemq.com/edge/api/model/ClientDisconnectedError: '#/components/schemas/ClientDisconnectedError' + https://hivemq.com/edge/api/model/ClientNotFoundError: '#/components/schemas/ClientNotFoundError' + https://hivemq.com/edge/api/model/DataPolicyAlreadyPresentError: '#/components/schemas/DataPolicyAlreadyPresentError' + https://hivemq.com/edge/api/model/DataPolicyCreationFailureError: '#/components/schemas/DataPolicyCreationFailureError' + https://hivemq.com/edge/api/model/DataPolicyInvalidErrors: '#/components/schemas/DataPolicyInvalidErrors' + https://hivemq.com/edge/api/model/DataPolicyNotFoundError: '#/components/schemas/DataPolicyNotFoundError' + https://hivemq.com/edge/api/model/DataPolicyRejectedError: '#/components/schemas/DataPolicyRejectedError' + https://hivemq.com/edge/api/model/DataPolicyUpdateFailureError: '#/components/schemas/DataPolicyUpdateFailureError' + https://hivemq.com/edge/api/model/PolicyIdMismatchError: '#/components/schemas/PolicyIdMismatchError' + https://hivemq.com/edge/api/model/PolicyInsufficientStorageError: '#/components/schemas/PolicyInsufficientStorageError' + https://hivemq.com/edge/api/model/PolicyNotFoundError: '#/components/schemas/PolicyNotFoundError' + https://hivemq.com/edge/api/model/SchemaAlreadyPresentError: '#/components/schemas/SchemaAlreadyPresentError' + https://hivemq.com/edge/api/model/SchemaEtagMismatchError: '#/components/schemas/SchemaEtagMismatchError' + https://hivemq.com/edge/api/model/SchemaInsufficientStorageError: '#/components/schemas/SchemaInsufficientStorageError' + https://hivemq.com/edge/api/model/SchemaInvalidErrors: '#/components/schemas/SchemaInvalidErrors' + https://hivemq.com/edge/api/model/SchemaNotFoundError: '#/components/schemas/SchemaNotFoundError' + https://hivemq.com/edge/api/model/SchemaParsingFailureError: '#/components/schemas/SchemaParsingFailureError' + https://hivemq.com/edge/api/model/SchemaReferencedError: '#/components/schemas/SchemaReferencedError' + https://hivemq.com/edge/api/model/ScriptAlreadyPresentError: '#/components/schemas/ScriptAlreadyPresentError' + https://hivemq.com/edge/api/model/ScriptCreationFailureError: '#/components/schemas/ScriptCreationFailureError' + https://hivemq.com/edge/api/model/ScriptEtagMismatchError: '#/components/schemas/ScriptEtagMismatchError' + https://hivemq.com/edge/api/model/ScriptInsufficientStorageError: '#/components/schemas/ScriptInsufficientStorageError' + https://hivemq.com/edge/api/model/ScriptInvalidErrors: '#/components/schemas/ScriptInvalidErrors' + https://hivemq.com/edge/api/model/ScriptNotFoundError: '#/components/schemas/ScriptNotFoundError' + https://hivemq.com/edge/api/model/ScriptParsingFailureError: '#/components/schemas/ScriptParsingFailureError' + https://hivemq.com/edge/api/model/ScriptReferencedError: '#/components/schemas/ScriptReferencedError' + https://hivemq.com/edge/api/model/ScriptSanitationFailureError: '#/components/schemas/ScriptSanitationFailureError' + https://hivemq.com/edge/api/model/TopicFilterMismatchError: '#/components/schemas/TopicFilterMismatchError' + https://hivemq.com/edge/api/model/InsufficientStorageError: '#/components/schemas/InsufficientStorageError' + https://hivemq.com/edge/api/model/InternalServerError: '#/components/schemas/InternalServerError' + https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' + https://hivemq.com/edge/api/model/PreconditionFailedError: '#/components/schemas/PreconditionFailedError' + https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' + https://hivemq.com/edge/api/model/RequestBodyParameterMissingError: '#/components/schemas/RequestBodyParameterMissingError' + https://hivemq.com/edge/api/model/TemporaryNotAvailableError: '#/components/schemas/TemporaryNotAvailableError' + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + BehaviorPolicyAlreadyPresentError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The behavior policy id. + example: abc + required: + - id + example: + general: + status: 409 + title: Behavior Policy Already Present + detail: The given behavior policy 'abc' is already present. + id: abc + type: https://hivemq.com/edge/api/model/BehaviorPolicyAlreadyPresentError + BehaviorPolicyCreationFailureError: + allOf: + - $ref: '#/components/schemas/ApiError' + example: + general: + status: 400 + title: Behavior Policy Creation Failed + detail: 'Behavior policy creation failed: The policy was rejected.' + type: https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError + AtLeastOneFieldMissingValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + paths: + type: array + description: The missing json paths. + items: + type: string + format: json-path + description: The json path. + example: + - $.field1 + - $.field2 + required: + - paths + example: + general: + detail: 'At least one of the fields must be present: ''$.field1'', ''$.field2''.' + paths: + - $.field1 + - $.field2 + type: https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError + ValidationError: + type: object + properties: + detail: + type: string + description: Detailed contextual description of the validation error. + type: + type: string + format: uri + description: Type of the validation error. + required: + - detail + - type + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError: '#/components/schemas/AtLeastOneFieldMissingValidationError' + https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError: '#/components/schemas/AtMostOneFunctionValidationError' + https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' + https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError: '#/components/schemas/FunctionMustBePairedValidationError' + https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError: '#/components/schemas/IllegalEventTransitionValidationError' + https://hivemq.com/edge/api/model/IllegalFunctionValidationError: '#/components/schemas/IllegalFunctionValidationError' + https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' + https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' + https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError: '#/components/schemas/InvalidFunctionOrderValidationError' + https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' + https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError: '#/components/schemas/InvalidSchemaVersionValidationError' + https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' + https://hivemq.com/edge/api/model/UnknownVariableValidationError: '#/components/schemas/UnknownVariableValidationError' + https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' + AtMostOneFunctionValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + function: + type: string + description: The function. + example: function1 + occurrences: + type: integer + format: int32 + description: The occurrences of the function. + minimum: 0 + example: 3 + paths: + type: array + items: + type: string + format: json-path + description: The json paths where the function occurs. + example: + - $.path1 + - $.path2 + - $.path3 + required: + - function + - occurrences + - paths + example: + general: + detail: The pipeline must contain at most one 'function1' function, but 3 were found at ['$.path1', '$.path2', '$.path3']. + function: function1 + occurrences: 3 + paths: + - $.path1 + - $.path2 + - $.path3 + type: https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError + EmptyFieldValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + path: + type: string + format: json-path + description: The missing field. + example: $.field + required: + - path + example: + general: + detail: Required field '$.field' is empty. + path: $.field + type: https://hivemq.com/edge/api/model/EmptyFieldValidationError + FunctionMustBePairedValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + existingFunction: + type: string + description: The existing function. + example: function1 + missingFunction: + type: string + description: The missing function. + example: function2 + required: + - existingFunction + - missingFunction + example: + general: + detail: If 'function1' function is present in the pipeline, 'function2' function must be present as well. + existingFunction: function1 + missingFunction: function2 + type: https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError + IllegalEventTransitionValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + event: + type: string + description: The event name. + example: event1 + fromState: + type: string + description: The event from state. + example: state1 + id: + type: string + description: The event id. + example: abc + path: + type: string + description: The path. + example: $.event + toState: + type: string + description: The event to state. + example: state2 + required: + - event + - fromState + - id + - path + - toState + example: + general: + detail: The transition from state 'state1' to state 'state2' on event 'event1' in '$.event' is not defined for behavior 'abc'. + event: event1 + fromState: state1 + toState: state2 + id: abc + path: $.event + type: https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError + IllegalFunctionValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + event: + type: string + description: The event name. + example: event1 + id: + type: string + description: The function id. + example: abc + path: + type: string + format: json-path + description: The json path. + example: $.event + required: + - event + - id + - path + example: + general: + detail: The function 'abc' is not allowed for event 'event1' in '$.event'. + event: event1 + id: abc + path: $.event + type: https://hivemq.com/edge/api/model/IllegalFunctionValidationError + InvalidFieldLengthValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + actualLength: + type: integer + format: int32 + description: The actual length of the field value. + example: 10 + expectedMinimumLength: + type: integer + format: int32 + description: The minimum length expected for the field value. + minimum: 0 + example: 5 + expectedMaximumLength: + type: integer + format: int32 + description: The maximum length expected for the field value. + minimum: 0 + example: 20 + path: + type: string + format: json-path + description: The invalid json path. + example: $.field + value: + type: string + description: The invalid value. + example: function transform() { return 'Hello, World!'; } + required: + - actualLength + - expectedMinimumLength + - expectedMaximumLength + - path + - value + example: + general: + detail: The length of script field '$.transform' 48 must be between 0 and 20. + actualLength: 48 + minimumLength: 0 + maximumLength: 20 + path: $.transform + value: function transform() { return 'Hello, World!'; } + type: https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError + InvalidFieldValueValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + path: + type: string + format: json-path + description: The invalid json path. + example: $.action.pipeline[1].field + value: + type: string + description: The invalid value. + example: functionDoesNotExist + required: + - path + example: + general: + detail: Referenced function does not exist. + path: $.action.pipeline[1].field + value: functionDoesNotExist + type: https://hivemq.com/edge/api/model/InvalidFieldValueValidationError + InvalidFunctionOrderValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + function: + type: string + description: The function. + example: transform + path: + type: string + format: json-path + description: The json path. + example: $.path + previousFunction: + type: string + description: The previous function. + example: init + required: + - function + - path + - previousFunction + example: + general: + detail: The operation at '$.path' with the functionId 'transform' must be after a 'init' operation. + function: transform + path: $.path + previousFunction: init + type: https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError + InvalidIdentifierValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + path: + type: string + format: json-path + description: The invalid identifier path. + example: $.id + value: + type: string + description: The invalid identifier value. + example: invalidId + required: + - path + - value + example: + general: + detail: Identifier script 'id' must begin with a letter and may only consist of lowercase letters, uppercase letters, numbers, periods, hyphens, and underscores. + path: $.id + value: invalidId + type: https://hivemq.com/edge/api/model/InvalidIdentifierValidationError + InvalidSchemaVersionValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + id: + type: string + description: The schema id. + example: abc + version: + type: string + description: The schema version. + example: '2' + required: + - id + - version + example: + general: + detail: The referenced schema with id 'abc' and version '2' was not found. + id: abc + version: '2' + type: https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError + MissingFieldValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + path: + type: string + format: json-path + description: The missing path. + example: $.id + required: + - path + example: + general: + detail: Required field '$.id' is missing. + path: $.id + type: https://hivemq.com/edge/api/model/MissingFieldValidationError + UnknownVariableValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + path: + type: string + description: The json path of the field. + example: $.path + variables: + type: array + items: + type: string + description: The unknown variables. + example: + - a + - b + - c + required: + - path + - variables + example: + general: + detail: 'Field ''$.path'' contains unknown variables: [a, b, c].' + path: $.path + variables: + - a + - b + - c + type: https://hivemq.com/edge/api/model/UnknownVariableValidationError + UnsupportedFieldValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + actualValue: + type: string + description: The actual value. + expectedValue: + type: string + description: The expected value. + path: + type: string + format: json-path + description: The json path. + example: $.id + required: + - actualValue + - expectedValue + - path + example: + general: + detail: Unsupported type 'String' for field '$.id'. Expected type is 'Object'. + actualValue: String + expectedValue: Object + path: $.id + type: https://hivemq.com/edge/api/model/UnsupportedFieldValidationError + BehaviorPolicyValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - oneOf: + - $ref: '#/components/schemas/IllegalEventTransitionValidationError' + - $ref: '#/components/schemas/IllegalFunctionValidationError' + - $ref: '#/components/schemas/InvalidSchemaVersionValidationError' + - $ref: '#/components/schemas/AtLeastOneFieldMissingValidationError' + - $ref: '#/components/schemas/EmptyFieldValidationError' + - $ref: '#/components/schemas/InvalidFieldLengthValidationError' + - $ref: '#/components/schemas/InvalidFieldValueValidationError' + - $ref: '#/components/schemas/InvalidIdentifierValidationError' + - $ref: '#/components/schemas/MissingFieldValidationError' + - $ref: '#/components/schemas/UnsupportedFieldValidationError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError: '#/components/schemas/AtLeastOneFieldMissingValidationError' + https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' + https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError: '#/components/schemas/IllegalEventTransitionValidationError' + https://hivemq.com/edge/api/model/IllegalFunctionValidationError: '#/components/schemas/IllegalFunctionValidationError' + https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' + https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' + https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' + https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError: '#/components/schemas/InvalidSchemaVersionValidationError' + https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' + https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' + BehaviorPolicyInvalidErrors: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + childErrors: + type: array + description: List of child validation errors. + items: + $ref: '#/components/schemas/BehaviorPolicyValidationError' + required: + - childErrors + example: + general: + status: 400 + title: Behavior Policy Invalid + detail: Behavior policy is invalid due to validation errors. + type: https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors + childErrors: + - detail: The transition from state 'state1' to state 'state2' on event 'event1' in '$.path' is not defined for behavior 'id1'. + fromState: state1 + toState: state2 + path: $.path + id: id1 + type: https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError + BehaviorPolicyNotFoundError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The data policy id. + example: abc + required: + - id + example: + general: + status: 404 + title: Behavior Policy Not Found + detail: Behavior policy with ID 'abc' is not found. + id: abc + type: https://hivemq.com/edge/api/model/BehaviorPolicyNotFoundError + BehaviorPolicyRejectedError: + allOf: + - $ref: '#/components/schemas/ApiError' + example: + general: + status: 400 + title: Behavior Policy Rejected + detail: Behavior policy is rejected. + type: https://hivemq.com/edge/api/model/BehaviorPolicyRejectedError + BehaviorPolicyUpdateFailureError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The ID of the policy that failed to update. + example: abc + required: + - id + example: + general: + status: 400 + title: Behavior Policy Update Failed + detail: Behavior policy with ID 'abc' update failed. + id: abc + type: https://hivemq.com/edge/api/model/BehaviorPolicyUpdateFailureError + ClientDisconnectedError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The client id. + example: abc + required: + - id + example: + general: + status: 404 + title: Client Disconnected + detail: Client with ID 'abc' is disconnected. + id: abc + type: https://hivemq.com/edge/api/model/ClientDisconnectedError + ClientNotFoundError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The client id. + example: abc + required: + - id + example: + general: + status: 404 + title: Client Not Found + detail: Client with ID 'abc' is not found. + id: abc + type: https://hivemq.com/edge/api/model/ClientNotFoundError + DataPolicyAlreadyPresentError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The data policy id. + example: abc + required: + - id + example: + general: + status: 409 + title: Data Policy Already Present + detail: The given data policy 'abc' is already present. + id: abc + type: https://hivemq.com/edge/api/model/DataPolicyAlreadyPresentError + DataPolicyCreationFailureError: + allOf: + - $ref: '#/components/schemas/ApiError' + example: + general: + status: 400 + title: Data Policy Creation Failed + detail: 'Data policy creation failed: The policy was rejected.' + type: https://hivemq.com/edge/api/model/DataPolicyCreationFailureError + DataPolicyValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - oneOf: + - $ref: '#/components/schemas/AtMostOneFunctionValidationError' + - $ref: '#/components/schemas/FunctionMustBePairedValidationError' + - $ref: '#/components/schemas/InvalidFunctionOrderValidationError' + - $ref: '#/components/schemas/InvalidSchemaVersionValidationError' + - $ref: '#/components/schemas/UnknownVariableValidationError' + - $ref: '#/components/schemas/EmptyFieldValidationError' + - $ref: '#/components/schemas/InvalidFieldLengthValidationError' + - $ref: '#/components/schemas/InvalidFieldValueValidationError' + - $ref: '#/components/schemas/InvalidIdentifierValidationError' + - $ref: '#/components/schemas/MissingFieldValidationError' + - $ref: '#/components/schemas/UnsupportedFieldValidationError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError: '#/components/schemas/AtMostOneFunctionValidationError' + https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' + https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError: '#/components/schemas/FunctionMustBePairedValidationError' + https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' + https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' + https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError: '#/components/schemas/InvalidFunctionOrderValidationError' + https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' + https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError: '#/components/schemas/InvalidSchemaVersionValidationError' + https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' + https://hivemq.com/edge/api/model/UnknownVariableValidationError: '#/components/schemas/UnknownVariableValidationError' + https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' + DataPolicyInvalidErrors: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + childErrors: + type: array + description: List of child validation errors. + items: + $ref: '#/components/schemas/DataPolicyValidationError' + required: + - childErrors + example: + general: + status: 400 + title: Data Policy Invalid + detail: Data policy is invalid due to validation errors. + type: https://hivemq.com/edge/api/model/DataPolicyInvalidErrors + childErrors: + - detail: The pipeline must contain at most one 'function1' function, but 3 were found at ['$.path1', '$.path2', '$.path3']. + function: function1 + occurrences: 3 + paths: + - $.path1 + - $.path2 + - $.path3 + type: https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError + DataPolicyNotFoundError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The data policy id. + example: abc + required: + - id + example: + general: + status: 404 + title: Data Policy Not Found + detail: Data policy with ID 'abc' is not found. + id: abc + type: https://hivemq.com/edge/api/model/DataPolicyNotFoundError + DataPolicyRejectedError: + allOf: + - $ref: '#/components/schemas/ApiError' + example: + general: + status: 400 + title: Data Policy Rejected + detail: Data policy is rejected. + type: https://hivemq.com/edge/api/model/DataPolicyRejectedError + DataPolicyUpdateFailureError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The ID of the policy that failed to update. + example: abc + required: + - id + example: + general: + status: 400 + title: Data Policy Update Failed + detail: Data policy with ID 'abc' update failed. + id: abc + type: https://hivemq.com/edge/api/model/DataPolicyUpdateFailureError + PolicyIdMismatchError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + actualId: + type: string + description: The actual id. + example: id1 + expectedId: + type: string + description: The expected id. + example: id2 + required: + - actualId + - expectedId + example: + general: + status: 400 + title: Policy ID Mismatch + detail: The policy ID 'id1' in the request parameter does not match the policy ID 'id2' in the policy request body. + id: abc + type: https://hivemq.com/edge/api/model/PolicyIdMismatchError + PolicyInsufficientStorageError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The policy id. + example: abc + required: + - id + example: + general: + status: 507 + title: Policy Insufficient Storage + detail: Policy with ID '123' could not be added because of insufficient server storage. + id: abc + type: https://hivemq.com/edge/api/model/PolicyInsufficientStorageError + PolicyNotFoundError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The policy id. + example: abc + required: + - id + example: + general: + status: 404 + title: Policy Not Found + detail: Policy with ID 'abc' is not found. + id: abc + type: https://hivemq.com/edge/api/model/PolicyNotFoundError + SchemaAlreadyPresentError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The schema id. + example: abc + required: + - id + example: + general: + status: 409 + title: Schema Already Present + detail: The given schema is already present as the latest version for the schema id 'abc'. + id: abc + type: https://hivemq.com/edge/api/model/SchemaAlreadyPresentError + SchemaEtagMismatchError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The schema id. + example: abc + eTag: + type: string + description: The eTag. + example: 33a64df551425fcc55e4d42a148795d9f25f89d4 + required: + - id + example: + general: + status: 412 + title: Schema eTag Mismatch + detail: Schema with id 'abc' does not match the given etag '33a64df551425fcc55e4d42a148795d9f25f89d4'. + id: abc + eTag: 33a64df551425fcc55e4d42a148795d9f25f89d4 + type: https://hivemq.com/edge/api/model/SchemaEtagMismatchError + SchemaInsufficientStorageError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The policy id. + example: abc + required: + - id + example: + general: + status: 507 + title: Schema Insufficient Storage + detail: Schema with ID '123' could not be added because of insufficient server storage. + id: abc + type: https://hivemq.com/edge/api/model/SchemaInsufficientStorageError + SchemaValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - oneOf: + - $ref: '#/components/schemas/EmptyFieldValidationError' + - $ref: '#/components/schemas/InvalidFieldLengthValidationError' + - $ref: '#/components/schemas/InvalidFieldValueValidationError' + - $ref: '#/components/schemas/InvalidIdentifierValidationError' + - $ref: '#/components/schemas/MissingFieldValidationError' + - $ref: '#/components/schemas/UnsupportedFieldValidationError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' + https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' + https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' + https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' + https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' + https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' + SchemaInvalidErrors: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + childErrors: + type: array + description: List of child validation errors. + items: + $ref: '#/components/schemas/SchemaValidationError' + required: + - childErrors + example: + general: + status: 400 + title: Schema Invalid + detail: Schema is invalid due to validation errors. + type: https://hivemq.com/edge/api/model/SchemaInvalidErrors + childErrors: + - detail: The length of script field '$.id' 1025 must be between 0 and 1024. + paths: $.id + value: aaa...aaa + actualLength: 1025 + expectedMinimumLength: 0 + expectedMaximumLength: 1024 + type: https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError + SchemaNotFoundError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The schema ID. + example: abc + required: + - id + example: + general: + status: 404 + title: Schema Not Found + detail: Schema with ID 'abc' is not found. + id: abc + type: https://hivemq.com/edge/api/model/SchemaNotFoundError + SchemaParsingFailureError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + alias: + type: string + description: The schema alias. + example: abc + required: + - alias + example: + general: + status: 400 + title: Schema Parsing Failure + detail: The given schema 'abc' could not be parsed. + alias: abc + type: https://hivemq.com/edge/api/model/SchemaParsingFailureError + SchemaReferencedError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The schema ID. + example: abc + required: + - id + example: + general: + status: 400 + title: Schema Referenced + detail: Schema with ID 'abc' is referenced. + id: abc + type: https://hivemq.com/edge/api/model/SchemaReferencedError + ScriptAlreadyPresentError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The script id. + example: abc + required: + - id + example: + general: + status: 409 + title: Script Already Present + detail: The given script 'abc' is already present. + id: abc + type: https://hivemq.com/edge/api/model/ScriptAlreadyPresentError + ScriptCreationFailureError: + allOf: + - $ref: '#/components/schemas/ApiError' + example: + general: + status: 400 + title: Script Creation Failure + detail: The given script could not be created. + type: https://hivemq.com/edge/api/model/ScriptCreationFailureError + ScriptEtagMismatchError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The script id. + example: abc + eTag: + type: string + description: The eTag. + example: 33a64df551425fcc55e4d42a148795d9f25f89d4 + required: + - id + example: + general: + status: 412 + title: Script eTag Mismatch + detail: Script with id 'abc' does not match the given etag '33a64df551425fcc55e4d42a148795d9f25f89d4'. + id: abc + eTag: 33a64df551425fcc55e4d42a148795d9f25f89d4 + type: https://hivemq.com/edge/api/model/ScriptEtagMismatchError + ScriptInsufficientStorageError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The policy id. + example: abc + required: + - id + example: + general: + status: 507 + title: Script Insufficient Storage + detail: Script with ID '123' could not be added because of insufficient server storage. + id: abc + type: https://hivemq.com/edge/api/model/ScriptInsufficientStorageError + ScriptValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - oneOf: + - $ref: '#/components/schemas/InvalidFieldLengthValidationError' + - $ref: '#/components/schemas/InvalidFieldValueValidationError' + - $ref: '#/components/schemas/InvalidIdentifierValidationError' + - $ref: '#/components/schemas/MissingFieldValidationError' + - $ref: '#/components/schemas/UnsupportedFieldValidationError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' + https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' + https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' + https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' + https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' + ScriptInvalidErrors: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + childErrors: + type: array + description: List of child validation errors. + items: + $ref: '#/components/schemas/ScriptValidationError' + required: + - childErrors + example: + general: + status: 400 + title: Script Invalid + detail: Script is invalid due to validation errors. + type: https://hivemq.com/edge/api/model/ScriptInvalidErrors + childErrors: + - detail: The length of script field '$.id' 1025 must be between 0 and 1024. + paths: $.id + value: aaa...aaa + actualLength: 1025 + expectedMinimumLength: 0 + expectedMaximumLength: 1024 + type: https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError + ScriptNotFoundError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The script ID. + example: abc + required: + - id + example: + general: + status: 404 + title: Script Not Found + detail: Script with ID 'abc' is not found. + id: abc + type: https://hivemq.com/edge/api/model/ScriptNotFoundError + ScriptParsingFailureError: + allOf: + - $ref: '#/components/schemas/ApiError' + example: + general: + status: 400 + title: Script Parsing Failure + detail: The given script 'abc' could not be parsed. + type: https://hivemq.com/edge/api/model/ScriptParsingFailureError + ScriptReferencedError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + id: + type: string + description: The script ID. + example: abc + required: + - id + example: + general: + status: 400 + title: Script Referenced + detail: Script with ID 'abc' is referenced. + id: abc + type: https://hivemq.com/edge/api/model/ScriptReferencedError + ScriptSanitationFailureError: + allOf: + - $ref: '#/components/schemas/ApiError' + example: + general: + status: 400 + title: Script Sanitation Failure + detail: The given script could not be sanitized. + type: https://hivemq.com/edge/api/model/ScriptSanitationFailureError + TopicFilterMismatchError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + path: + type: string + description: The json path of the topic filter. + example: $.filter + required: + - path + example: + general: + status: 400 + title: Topic Filter Mismatch + detail: The topic filter '$.filter' mismatches. + type: https://hivemq.com/edge/api/model/TopicFilterMismatchError + InsufficientStorageError: + allOf: + - $ref: '#/components/schemas/ApiError' + example: + general: + status: 507 + title: Insufficient Storage + detail: Insufficient Storage. + type: https://hivemq.com/edge/api/model/InsufficientStorageError + InternalServerError: + allOf: + - $ref: '#/components/schemas/ApiError' + example: + general: + status: 500 + title: Internal Server Error + detail: An unexpected error occurred, check the logs. + type: https://hivemq.com/edge/api/model/InternalServerError + creation: + status: 500 + title: Internal Server Error + detail: 'An unexpected error occurred: Exception during creation of the Json Schema for functions.' + type: https://hivemq.com/edge/api/model/InternalServerError + InvalidQueryParameterError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + parameter: + type: string + description: The query parameter. + required: + - parameter + example: + general: + status: 400 + title: Query Parameter is Invalid + detail: 'Query parameter ''a'' is invalid: ''a'' could not be parsed.' + parameter: a + type: https://hivemq.com/edge/api/model/InvalidQueryParameterError + PreconditionFailedError: + allOf: + - $ref: '#/components/schemas/ApiError' + example: + general: + status: 412 + title: Precondition Failed + detail: 'A precondition required for fulfilling the request was not fulfilled: Policy does not match the given etag ''abc''.' + type: https://hivemq.com/edge/api/model/PreconditionFailedError + RequestBodyMissingError: + allOf: + - $ref: '#/components/schemas/ApiError' + example: + general: + status: 400 + title: Required Request Body Missing + detail: Required request body is missing. + type: https://hivemq.com/edge/api/model/RequestBodyMissingError + RequestBodyParameterMissingError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + parameter: + type: string + description: The the missing request body parameter. + required: + - parameter + example: + general: + status: 400 + title: Required Request Body Parameter Missing + detail: Required request body parameter 'a' is missing. + parameter: a + type: https://hivemq.com/edge/api/model/RequestBodyParameterMissingError + TemporaryNotAvailableError: + allOf: + - $ref: '#/components/schemas/ApiError' + example: + general: + status: 503 + title: Endpoint Temporarily not Available + detail: The endpoint is temporarily not available, please try again later. + type: https://hivemq.com/edge/api/model/TemporaryNotAvailableError + UrlParameterMissingError: + allOf: + - $ref: '#/components/schemas/ApiError' + - type: object + properties: + parameter: + type: string + description: The name of the missing parameter. + required: + - parameter + example: + general: + status: 400 + title: Required URL Parameter Missing + detail: Required URL parameter 'a' is missing. + parameter: a + type: https://hivemq.com/edge/api/model/UrlParameterMissingError JsonNode: type: object description: The arguments of the fsm derived from the behavior policy. @@ -4795,8 +6244,6 @@ components: description: List of result items that are returned by this endpoint items: $ref: '#/components/schemas/DataPolicy' - Errors: - type: object PolicyType: description: The type of policy in Data Hub type: string diff --git a/hivemq-edge-openapi/openapi/openapi.yaml b/hivemq-edge-openapi/openapi/openapi.yaml index 1c2b8f6eb4..f2e902c9f4 100644 --- a/hivemq-edge-openapi/openapi/openapi.yaml +++ b/hivemq-edge-openapi/openapi/openapi.yaml @@ -30,7 +30,7 @@ info: imported into popular API tooling (e.g. Postman) or can be used to generate client-code for multiple programming languages. title: HiveMQ Edge REST API - version: 2025.11-SNAPSHOT + version: 2025.12-SNAPSHOT x-logo: url: https://www.hivemq.com/img/svg/hivemq-bee.svg tags: From 47bf9534bc0abd6bfad3ea9c6dd7b29d6bfd47fa Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Tue, 1 Jul 2025 17:53:46 +0200 Subject: [PATCH 095/121] feat: Add problem+json to all DataHub REST API errors --- ext/hivemq-edge-openapi-2025.12.yaml | 170 +++++++++--------- ...data-hub_behavior-validation_policies.yaml | 14 +- ...havior-validation_policies_{policyId}.yaml | 30 ++-- ...behavior-validation_states_{clientId}.yaml | 6 +- ..._v1_data-hub_data-validation_policies.yaml | 14 +- ...b_data-validation_policies_{policyId}.yaml | 30 ++-- .../openapi/paths/api_v1_data-hub_fsm.yaml | 2 +- .../paths/api_v1_data-hub_function-specs.yaml | 2 +- .../paths/api_v1_data-hub_functions.yaml | 2 +- ...i_v1_data-hub_interpolation-variables.yaml | 2 +- .../paths/api_v1_data-hub_schemas.yaml | 16 +- .../api_v1_data-hub_schemas_{schemaId}.yaml | 18 +- .../paths/api_v1_data-hub_scripts.yaml | 16 +- .../api_v1_data-hub_scripts_{scriptId}.yaml | 18 +- .../hivemq/api/error/ApiExceptionMapper.java | 22 +-- .../com/hivemq/util/ErrorResponseUtil.java | 8 +- 16 files changed, 186 insertions(+), 184 deletions(-) diff --git a/ext/hivemq-edge-openapi-2025.12.yaml b/ext/hivemq-edge-openapi-2025.12.yaml index fcc4856987..5df1f0bc7c 100644 --- a/ext/hivemq-edge-openapi-2025.12.yaml +++ b/ext/hivemq-edge-openapi-2025.12.yaml @@ -356,7 +356,7 @@ paths: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: '#/components/schemas/InvalidQueryParameterError' @@ -367,7 +367,7 @@ paths: description: URL parameter missing '503': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable @@ -455,7 +455,7 @@ paths: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: '#/components/schemas/BehaviorPolicyCreationFailureError' @@ -472,25 +472,25 @@ paths: description: Policy creation failed '409': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/BehaviorPolicyAlreadyPresentError' description: Behavior policy already present '500': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable '507': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/PolicyInsufficientStorageError' description: Insufficient storage @@ -523,7 +523,7 @@ paths: description: Success, no response body '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: '#/components/schemas/UrlParameterMissingError' @@ -534,25 +534,25 @@ paths: description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/PolicyNotFoundError' description: Behavior policy not found '412': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/PreconditionFailedError' description: Precondition failed '500': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable @@ -623,7 +623,7 @@ paths: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: '#/components/schemas/UrlParameterMissingError' @@ -634,19 +634,19 @@ paths: description: Bad request '404': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/BehaviorPolicyNotFoundError' description: Policy not found '500': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable @@ -750,7 +750,7 @@ paths: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: '#/components/schemas/RequestBodyMissingError' @@ -771,31 +771,31 @@ paths: description: Behavior policy creation failed '404': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/BehaviorPolicyNotFoundError' description: Data policy not found '412': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/PreconditionFailedError' description: Precondition failed '500': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable '507': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/PolicyInsufficientStorageError' description: Insufficient storage @@ -843,7 +843,7 @@ paths: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: '#/components/schemas/UrlParameterMissingError' @@ -854,7 +854,7 @@ paths: description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: oneOf: - $ref: '#/components/schemas/ClientDisconnectedError' @@ -867,7 +867,7 @@ paths: description: Client error '500': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/InternalServerError' description: Internal server error @@ -1119,7 +1119,7 @@ paths: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: '#/components/schemas/InvalidQueryParameterError' @@ -1130,7 +1130,7 @@ paths: description: URL parameter missing '503': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable @@ -1216,7 +1216,7 @@ paths: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: '#/components/schemas/RequestBodyMissingError' @@ -1233,25 +1233,25 @@ paths: description: Data policy creation failed '409': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/DataPolicyAlreadyPresentError' description: Data policy already present '500': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable '507': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/PolicyInsufficientStorageError' description: Insufficient storage @@ -1284,7 +1284,7 @@ paths: description: Success, no response body '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: '#/components/schemas/UrlParameterMissingError' @@ -1295,25 +1295,25 @@ paths: description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/PolicyNotFoundError' description: Data policy not found '412': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/PreconditionFailedError' description: Precondition failed '500': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable @@ -1383,7 +1383,7 @@ paths: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: '#/components/schemas/UrlParameterMissingError' @@ -1394,19 +1394,19 @@ paths: description: Bad request '404': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/PolicyNotFoundError' description: Resource not found '500': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable @@ -1509,7 +1509,7 @@ paths: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: '#/components/schemas/RequestBodyMissingError' @@ -1532,31 +1532,31 @@ paths: description: Data policy creation failed '404': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/DataPolicyNotFoundError' description: Data policy not found '412': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/PreconditionFailedError' description: Precondition failed '500': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable '507': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/PolicyInsufficientStorageError' description: Insufficient storage @@ -1644,7 +1644,7 @@ paths: description: Success '500': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/InternalServerError' description: Internal server error @@ -1806,7 +1806,7 @@ paths: description: Success '500': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/InternalServerError' description: Internal server error @@ -1826,7 +1826,7 @@ paths: description: Success '500': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/InternalServerError' description: Internal server error @@ -1846,7 +1846,7 @@ paths: description: Success '500': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/InternalServerError' description: Internal server error @@ -1985,7 +1985,7 @@ paths: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: '#/components/schemas/InvalidQueryParameterError' @@ -1996,7 +1996,7 @@ paths: description: URL parameter missing '503': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable @@ -2045,7 +2045,7 @@ paths: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: '#/components/schemas/RequestBodyParameterMissingError' @@ -2060,31 +2060,31 @@ paths: description: Schema creation failed '409': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/SchemaAlreadyPresentError' description: Schema is already present '412': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/SchemaEtagMismatchError' description: Schema doesn't match etag '500': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable '507': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/SchemaInsufficientStorageError' description: Insufficient storage @@ -2117,7 +2117,7 @@ paths: description: Success, no response body '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: '#/components/schemas/UrlParameterMissingError' @@ -2130,25 +2130,25 @@ paths: description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/SchemaNotFoundError' description: Schema not found '412': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/SchemaEtagMismatchError' description: Schema doesn't match etag '500': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/InternalServerError' description: Internal Server error '503': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable @@ -2196,7 +2196,7 @@ paths: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: '#/components/schemas/UrlParameterMissingError' @@ -2207,19 +2207,19 @@ paths: description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/SchemaNotFoundError' description: Schema not found '500': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable @@ -2345,7 +2345,7 @@ paths: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: '#/components/schemas/InvalidQueryParameterError' @@ -2356,7 +2356,7 @@ paths: description: URL parameter missing '503': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable @@ -2405,7 +2405,7 @@ paths: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: '#/components/schemas/RequestBodyParameterMissingError' @@ -2424,31 +2424,31 @@ paths: description: Script creation failed '409': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/ScriptAlreadyPresentError' description: Script is already present '412': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/ScriptEtagMismatchError' description: Script doesn't match etag '500': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable '507': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/ScriptInsufficientStorageError' description: Insufficient storage @@ -2478,7 +2478,7 @@ paths: description: Success, no response body '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: '#/components/schemas/UrlParameterMissingError' @@ -2491,25 +2491,25 @@ paths: description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/ScriptNotFoundError' description: Script not found '412': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/ScriptEtagMismatchError' description: Script doesn't match etag '500': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/InternalServerError' description: Internal Server error '503': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable @@ -2553,7 +2553,7 @@ paths: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: '#/components/schemas/UrlParameterMissingError' @@ -2564,19 +2564,19 @@ paths: description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/ScriptNotFoundError' description: Script not found '500': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/InternalServerError' description: Internal Server error '503': content: - application/json: + application/problem+json: schema: $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies.yaml index df701832ba..64b77e9ac8 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies.yaml @@ -180,7 +180,7 @@ get: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: "../components/schemas/errors/http/InvalidQueryParameterError.yaml" @@ -191,7 +191,7 @@ get: description: URL parameter missing '503': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable @@ -279,7 +279,7 @@ post: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: "../components/schemas/errors/datahub/BehaviorPolicyCreationFailureError.yaml" @@ -296,25 +296,25 @@ post: description: Policy creation failed '409': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/datahub/BehaviorPolicyAlreadyPresentError.yaml" description: Behavior policy already present '500': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal server error '503': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable '507': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/datahub/PolicyInsufficientStorageError.yaml" description: Insufficient storage diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies_{policyId}.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies_{policyId}.yaml index d33f536d7d..55bcc7b8a4 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies_{policyId}.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_policies_{policyId}.yaml @@ -23,7 +23,7 @@ delete: description: Success, no response body '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: "../components/schemas/errors/http/UrlParameterMissingError.yaml" @@ -34,25 +34,25 @@ delete: description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/datahub/PolicyNotFoundError.yaml" description: Behavior policy not found '412': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/PreconditionFailedError.yaml" description: Precondition failed '500': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal server error '503': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable @@ -126,7 +126,7 @@ get: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: "../components/schemas/errors/http/UrlParameterMissingError.yaml" @@ -137,19 +137,19 @@ get: description: Bad request '404': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/datahub/BehaviorPolicyNotFoundError.yaml" description: Policy not found '500': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal server error '503': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable @@ -255,7 +255,7 @@ put: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: "../components/schemas/errors/http/RequestBodyMissingError.yaml" @@ -276,31 +276,31 @@ put: description: Behavior policy creation failed '404': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/datahub/BehaviorPolicyNotFoundError.yaml" description: Data policy not found '412': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/PreconditionFailedError.yaml" description: Precondition failed '500': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal server error '503': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable '507': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/datahub/PolicyInsufficientStorageError.yaml" description: Insufficient storage diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_states_{clientId}.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_states_{clientId}.yaml index 0f7691d711..1475e24f93 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_states_{clientId}.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_behavior-validation_states_{clientId}.yaml @@ -38,7 +38,7 @@ get: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: "../components/schemas/errors/http/UrlParameterMissingError.yaml" @@ -49,7 +49,7 @@ get: description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: oneOf: - $ref: "../components/schemas/errors/datahub/ClientDisconnectedError.yaml" @@ -62,7 +62,7 @@ get: description: Client error '500': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal server error diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml index 8278ffd3d0..6eeed06c24 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies.yaml @@ -285,7 +285,7 @@ get: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: "../components/schemas/errors/http/InvalidQueryParameterError.yaml" @@ -296,7 +296,7 @@ get: description: URL parameter missing '503': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable @@ -390,7 +390,7 @@ post: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: "../components/schemas/errors/http/RequestBodyMissingError.yaml" @@ -407,25 +407,25 @@ post: description: Data policy creation failed '409': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/datahub/DataPolicyAlreadyPresentError.yaml" description: Data policy already present '500': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal server error '503': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable '507': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/datahub/PolicyInsufficientStorageError.yaml" description: Insufficient storage diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml index 53c0c2160b..fa19ca4cc5 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml @@ -23,7 +23,7 @@ delete: description: Success, no response body '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: "../components/schemas/errors/http/UrlParameterMissingError.yaml" @@ -34,25 +34,25 @@ delete: description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/datahub/PolicyNotFoundError.yaml" description: Data policy not found '412': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/PreconditionFailedError.yaml" description: Precondition failed '500': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal server error '503': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable @@ -129,7 +129,7 @@ get: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: "../components/schemas/errors/http/UrlParameterMissingError.yaml" @@ -140,19 +140,19 @@ get: description: Bad request '404': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/datahub/PolicyNotFoundError.yaml" description: Resource not found '500': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal server error '503': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable @@ -265,7 +265,7 @@ put: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: "../components/schemas/errors/http/RequestBodyMissingError.yaml" @@ -288,31 +288,31 @@ put: description: Data policy creation failed '404': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/datahub/DataPolicyNotFoundError.yaml" description: Data policy not found '412': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/PreconditionFailedError.yaml" description: Precondition failed '500': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal server error '503': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable '507': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/datahub/PolicyInsufficientStorageError.yaml" description: Insufficient storage diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_fsm.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_fsm.yaml index c0a3ae08dd..5f2c3de41d 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_fsm.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_fsm.yaml @@ -90,7 +90,7 @@ get: description: Success '500': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal server error diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_function-specs.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_function-specs.yaml index 0b94ed4ee9..dfefb62682 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_function-specs.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_function-specs.yaml @@ -12,7 +12,7 @@ get: description: Success '500': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal server error diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_functions.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_functions.yaml index 1d2adc52bf..a7037eae9c 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_functions.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_functions.yaml @@ -185,7 +185,7 @@ get: description: Success '500': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal server error diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_interpolation-variables.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_interpolation-variables.yaml index 505d557738..fb42b5f4b0 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_interpolation-variables.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_interpolation-variables.yaml @@ -10,7 +10,7 @@ get: description: Success '500': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal server error diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas.yaml index ee6518a351..46a39cfb96 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas.yaml @@ -153,7 +153,7 @@ get: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: "../components/schemas/errors/http/InvalidQueryParameterError.yaml" @@ -164,7 +164,7 @@ get: description: URL parameter missing '503': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable @@ -215,7 +215,7 @@ post: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: "../components/schemas/errors/http/RequestBodyParameterMissingError.yaml" @@ -230,31 +230,31 @@ post: description: Schema creation failed '409': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/datahub/SchemaAlreadyPresentError.yaml" description: Schema is already present '412': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/datahub/SchemaEtagMismatchError.yaml" description: Schema doesn't match etag '500': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal server error '503': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable '507': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/datahub/SchemaInsufficientStorageError.yaml" description: Insufficient storage diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas_{schemaId}.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas_{schemaId}.yaml index a4eed7cff2..40b6529113 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas_{schemaId}.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_schemas_{schemaId}.yaml @@ -23,7 +23,7 @@ delete: description: Success, no response body '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: "../components/schemas/errors/http/UrlParameterMissingError.yaml" @@ -36,25 +36,25 @@ delete: description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/datahub/SchemaNotFoundError.yaml" description: Schema not found '412': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/datahub/SchemaEtagMismatchError.yaml" description: Schema doesn't match etag '500': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal Server error '503': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable @@ -105,7 +105,7 @@ get: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: "../components/schemas/errors/http/UrlParameterMissingError.yaml" @@ -116,19 +116,19 @@ get: description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/datahub/SchemaNotFoundError.yaml" description: Schema not found '500': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal server error '503': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts.yaml index 51cb6613de..6c85cefa65 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts.yaml @@ -140,7 +140,7 @@ get: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: "../components/schemas/errors/http/InvalidQueryParameterError.yaml" @@ -151,7 +151,7 @@ get: description: URL parameter missing '503': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable @@ -202,7 +202,7 @@ post: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: "../components/schemas/errors/http/RequestBodyParameterMissingError.yaml" @@ -221,31 +221,31 @@ post: description: Script creation failed '409': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/datahub/ScriptAlreadyPresentError.yaml" description: Script is already present '412': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/datahub/ScriptEtagMismatchError.yaml" description: Script doesn't match etag '500': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal server error '503': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable '507': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/datahub/ScriptInsufficientStorageError.yaml" description: Insufficient storage diff --git a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts_{scriptId}.yaml b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts_{scriptId}.yaml index 003980e1f2..d1e9ef1785 100644 --- a/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts_{scriptId}.yaml +++ b/hivemq-edge-openapi/openapi/paths/api_v1_data-hub_scripts_{scriptId}.yaml @@ -20,7 +20,7 @@ delete: description: Success, no response body '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: "../components/schemas/errors/http/UrlParameterMissingError.yaml" @@ -33,25 +33,25 @@ delete: description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/datahub/ScriptNotFoundError.yaml" description: Script not found '412': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/datahub/ScriptEtagMismatchError.yaml" description: Script doesn't match etag '500': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal Server error '503': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable @@ -98,7 +98,7 @@ get: description: Success '400': content: - application/json: + application/problem+json: schema: oneOf: - $ref: "../components/schemas/errors/http/UrlParameterMissingError.yaml" @@ -109,19 +109,19 @@ get: description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/datahub/ScriptNotFoundError.yaml" description: Script not found '500': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/InternalServerError.yaml" description: Internal Server error '503': content: - application/json: + application/problem+json: schema: $ref: "../components/schemas/errors/http/TemporaryNotAvailableError.yaml" description: Request resource temporary unavailable diff --git a/hivemq-edge/src/main/java/com/hivemq/api/error/ApiExceptionMapper.java b/hivemq-edge/src/main/java/com/hivemq/api/error/ApiExceptionMapper.java index ac45b821bd..245c567041 100644 --- a/hivemq-edge/src/main/java/com/hivemq/api/error/ApiExceptionMapper.java +++ b/hivemq-edge/src/main/java/com/hivemq/api/error/ApiExceptionMapper.java @@ -16,14 +16,13 @@ package com.hivemq.api.error; import com.hivemq.api.model.ApiErrorMessage; -import org.jetbrains.annotations.NotNull; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - import jakarta.ws.rs.core.MediaType; import jakarta.ws.rs.core.Response; import jakarta.ws.rs.ext.ExceptionMapper; import jakarta.ws.rs.ext.Provider; +import org.jetbrains.annotations.NotNull; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Mapper that handles StrongTyped ApiErrors and will respond with either the @@ -33,19 +32,22 @@ */ @Provider public class ApiExceptionMapper implements ExceptionMapper { - - private static final Logger logger = LoggerFactory.getLogger(ApiExceptionMapper.class); + public static final @NotNull String APPLICATION_PROBLEM_JSON_CHARSET_UTF_8 = + "application/problem+json;charset=utf-8"; + public static final @NotNull MediaType APPLICATION_PROBLEM_JSON_TYPE = + new MediaType("application", "problem+json", "utf-8"); + private static final @NotNull Logger logger = LoggerFactory.getLogger(ApiExceptionMapper.class); @Override - public Response toResponse(final @NotNull ApiException exception) { + public @NotNull Response toResponse(final @NotNull ApiException exception) { logger.warn("Api Error Handled Api Exception Mapper {}", exception.getMessage(), exception.getCause()); - String message = exception.getMessage(); - ApiErrorMessage apiError = new ApiErrorMessage(); + final String message = exception.getMessage(); + final ApiErrorMessage apiError = new ApiErrorMessage(); apiError.setTitle(message); apiError.setFieldName(exception.getFieldName()); return Response.status(exception.getHttpStatusCode()) .entity(apiError) - .type(MediaType.APPLICATION_JSON_TYPE) + .type(APPLICATION_PROBLEM_JSON_TYPE) .build(); } } diff --git a/hivemq-edge/src/main/java/com/hivemq/util/ErrorResponseUtil.java b/hivemq-edge/src/main/java/com/hivemq/util/ErrorResponseUtil.java index 347c452b72..e194d1cc72 100644 --- a/hivemq-edge/src/main/java/com/hivemq/util/ErrorResponseUtil.java +++ b/hivemq-edge/src/main/java/com/hivemq/util/ErrorResponseUtil.java @@ -15,11 +15,11 @@ */ package com.hivemq.util; +import com.hivemq.api.error.ApiExceptionMapper; import com.hivemq.edge.api.model.ApiError; import com.hivemq.http.error.ProblemDetails; -import org.jetbrains.annotations.NotNull; - import jakarta.ws.rs.core.Response; +import org.jetbrains.annotations.NotNull; /** * @author Christoph Schäbel @@ -28,14 +28,14 @@ public class ErrorResponseUtil { public static @NotNull Response errorResponse(final @NotNull ApiError error) { return Response.status(error.getStatus()) .entity(error) - .header("Content-Type", "application/json;charset=utf-8") + .type(ApiExceptionMapper.APPLICATION_PROBLEM_JSON_TYPE) .build(); } public static @NotNull Response errorResponse(final @NotNull ProblemDetails errors) { return Response.status(errors.getStatus()) .entity(errors) - .header("Content-Type", "application/json;charset=utf-8") + .type(ApiExceptionMapper.APPLICATION_PROBLEM_JSON_TYPE) .build(); } } From 5ceb5cd45a3bca7b2dc915e79e02ab51ddd2308b Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Wed, 2 Jul 2025 09:15:07 +0200 Subject: [PATCH 096/121] fix: Fix assertion for problem+json --- .../hivemq/api/auth/BearerTokenAuthTests.java | 21 +++++++++---------- .../com/hivemq/api/auth/ChainedAuthTests.java | 19 ++++++++--------- 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/hivemq-edge/src/test/java/com/hivemq/api/auth/BearerTokenAuthTests.java b/hivemq-edge/src/test/java/com/hivemq/api/auth/BearerTokenAuthTests.java index 0818e5f3a4..02c42e90f6 100644 --- a/hivemq-edge/src/test/java/com/hivemq/api/auth/BearerTokenAuthTests.java +++ b/hivemq-edge/src/test/java/com/hivemq/api/auth/BearerTokenAuthTests.java @@ -24,6 +24,7 @@ import com.hivemq.api.auth.handler.impl.BearerTokenAuthenticationHandler; import com.hivemq.api.auth.jwt.JwtAuthenticationProvider; import com.hivemq.api.config.ApiJwtConfiguration; +import com.hivemq.api.error.ApiExceptionMapper; import com.hivemq.api.resources.impl.AuthenticationResourceImpl; import com.hivemq.bootstrap.ioc.Injector; import com.hivemq.edge.api.model.ApiBearerToken; @@ -35,6 +36,7 @@ import com.hivemq.http.core.HttpUrlConnectionClient; import com.hivemq.http.core.HttpUtils; import com.hivemq.http.error.ProblemDetails; +import jakarta.ws.rs.core.MediaType; import org.glassfish.jersey.server.ResourceConfig; import org.junit.AfterClass; import org.junit.Assert; @@ -44,7 +46,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import jakarta.ws.rs.core.MediaType; import java.io.ByteArrayInputStream; import java.io.IOException; import java.util.HashSet; @@ -60,17 +61,14 @@ */ public class BearerTokenAuthTests { - protected final Logger logger = LoggerFactory.getLogger(BearerTokenAuthTests.class); - static final int TEST_HTTP_PORT = 8088; static final int CONNECT_TIMEOUT = 1000; static final int READ_TIMEOUT = 1000; static final String HTTP = "http"; - protected static JaxrsHttpServer server; - @Mock private static Injector injector; + protected final Logger logger = LoggerFactory.getLogger(BearerTokenAuthTests.class); @BeforeClass public static void setUp() throws Exception { @@ -86,7 +84,8 @@ public static void setUp() throws Exception { final ResourceConfig conf = new ResourceConfig() { { register(new ApiAuthenticationFeature(authenticationHandlers)); - }}; + } + }; conf.register(TestApiResource.class); conf.register(TestPermitAllApiResource.class); conf.register(TestResourceLevelRolesApiResource.class); @@ -132,17 +131,16 @@ public void testAuthenticateValidUser() throws IOException { @Test public void testAuthenticateInvalidUser() throws IOException { final ObjectMapper mapper = new ObjectMapper(); - final UsernamePasswordCredentials creds = + final UsernamePasswordCredentials credentials = new UsernamePasswordCredentials().userName("testuser").password("invalidpassword"); final HttpResponse response = HttpUrlConnectionClient.post(HttpUrlConnectionClient.JSON_HEADERS, getTestServerAddress(HTTP, TEST_HTTP_PORT, "api/v1/auth/authenticate"), - new ByteArrayInputStream(mapper.writeValueAsBytes(creds)), + new ByteArrayInputStream(mapper.writeValueAsBytes(credentials)), CONNECT_TIMEOUT, READ_TIMEOUT); - assertThat(response.getStatusCode()).as("Resource should NOT be accepted").isEqualTo(401); assertThat(response.getContentType()).as("API authenticate response should be json") - .startsWith(MediaType.APPLICATION_JSON); + .isEqualTo(ApiExceptionMapper.APPLICATION_PROBLEM_JSON_CHARSET_UTF_8); assertThat(mapper.readValue(response.getResponseBody(), ProblemDetails.class) .getErrors() .get(0) @@ -154,7 +152,8 @@ public void testAuthenticateInvalidUser() throws IOException { public void testAuthenticatedTokenAllowsApiAccess() throws IOException { final ObjectMapper mapper = new ObjectMapper(); - final UsernamePasswordCredentials creds = new UsernamePasswordCredentials().userName("testuser").password("test"); + final UsernamePasswordCredentials creds = + new UsernamePasswordCredentials().userName("testuser").password("test"); HttpResponse response = HttpUrlConnectionClient.post(HttpUrlConnectionClient.JSON_HEADERS, getTestServerAddress(HTTP, TEST_HTTP_PORT, "api/v1/auth/authenticate"), new ByteArrayInputStream(mapper.writeValueAsBytes(creds)), diff --git a/hivemq-edge/src/test/java/com/hivemq/api/auth/ChainedAuthTests.java b/hivemq-edge/src/test/java/com/hivemq/api/auth/ChainedAuthTests.java index ed35967bf6..f63b145a41 100644 --- a/hivemq-edge/src/test/java/com/hivemq/api/auth/ChainedAuthTests.java +++ b/hivemq-edge/src/test/java/com/hivemq/api/auth/ChainedAuthTests.java @@ -25,6 +25,7 @@ import com.hivemq.api.auth.jwt.JwtAuthenticationProvider; import com.hivemq.api.auth.provider.IUsernameRolesProvider; import com.hivemq.api.config.ApiJwtConfiguration; +import com.hivemq.api.error.ApiExceptionMapper; import com.hivemq.api.resources.impl.AuthenticationResourceImpl; import com.hivemq.edge.api.model.ApiBearerToken; import com.hivemq.edge.api.model.UsernamePasswordCredentials; @@ -60,14 +61,12 @@ */ public class ChainedAuthTests { - protected final Logger logger = LoggerFactory.getLogger(ChainedAuthTests.class); - static final int TEST_HTTP_PORT = 8088; static final int CONNECT_TIMEOUT = 1000; static final int READ_TIMEOUT = 1000; static final String HTTP = "http"; - protected static @NotNull JaxrsHttpServer server; + protected final Logger logger = LoggerFactory.getLogger(ChainedAuthTests.class); @BeforeClass public static void setUp() throws Exception { @@ -114,7 +113,8 @@ protected static String getTestServerAddress(final @NotNull String protocol, fin public void testAuthenticateValidUser() throws IOException { final ObjectMapper mapper = new ObjectMapper(); - final UsernamePasswordCredentials creds = new UsernamePasswordCredentials().userName("testuser").password("test"); + final UsernamePasswordCredentials creds = + new UsernamePasswordCredentials().userName("testuser").password("test"); final HttpResponse response = HttpUrlConnectionClient.post(HttpUrlConnectionClient.JSON_HEADERS, getTestServerAddress(HTTP, TEST_HTTP_PORT, "api/v1/auth/authenticate"), new ByteArrayInputStream(mapper.writeValueAsBytes(creds)), @@ -130,19 +130,17 @@ public void testAuthenticateValidUser() throws IOException { @Test public void testAuthenticateInvalidUser() throws IOException { - final ObjectMapper mapper = new ObjectMapper(); - final UsernamePasswordCredentials creds = + final UsernamePasswordCredentials credentials = new UsernamePasswordCredentials().userName("testuser").password("invalidpassword"); final HttpResponse response = HttpUrlConnectionClient.post(HttpUrlConnectionClient.JSON_HEADERS, getTestServerAddress(HTTP, TEST_HTTP_PORT, "api/v1/auth/authenticate"), - new ByteArrayInputStream(mapper.writeValueAsBytes(creds)), + new ByteArrayInputStream(mapper.writeValueAsBytes(credentials)), CONNECT_TIMEOUT, READ_TIMEOUT); - assertThat(response.getStatusCode()).as("Resource should NOT be accepted").isEqualTo(401); assertThat(response.getContentType()).as("API authenticate response should be json") - .startsWith(MediaType.APPLICATION_JSON); + .isEqualTo(ApiExceptionMapper.APPLICATION_PROBLEM_JSON_CHARSET_UTF_8); assertThat(mapper.readValue(response.getResponseBody(), ProblemDetails.class) .getErrors() .get(0) @@ -154,7 +152,8 @@ public void testAuthenticateInvalidUser() throws IOException { public void testAuthenticatedTokenAllowsApiAccess() throws IOException { final ObjectMapper mapper = new ObjectMapper(); - final UsernamePasswordCredentials creds = new UsernamePasswordCredentials().userName("testuser").password("test"); + final UsernamePasswordCredentials creds = + new UsernamePasswordCredentials().userName("testuser").password("test"); HttpResponse response = HttpUrlConnectionClient.post(HttpUrlConnectionClient.JSON_HEADERS, getTestServerAddress(HTTP, TEST_HTTP_PORT, "api/v1/auth/authenticate"), new ByteArrayInputStream(mapper.writeValueAsBytes(creds)), From 517e72982bc3adf77495c4e412ac6b4e41326b7c Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Wed, 2 Jul 2025 10:10:33 +0200 Subject: [PATCH 097/121] refactor: Move problem+json to HttpContants --- .../hivemq/api/error/ApiExceptionMapper.java | 7 +-- .../java/com/hivemq/http/HttpConstants.java | 48 ++++++++++--------- .../com/hivemq/util/ErrorResponseUtil.java | 5 +- .../hivemq/api/auth/BearerTokenAuthTests.java | 3 +- .../com/hivemq/api/auth/ChainedAuthTests.java | 3 +- 5 files changed, 33 insertions(+), 33 deletions(-) diff --git a/hivemq-edge/src/main/java/com/hivemq/api/error/ApiExceptionMapper.java b/hivemq-edge/src/main/java/com/hivemq/api/error/ApiExceptionMapper.java index 245c567041..732b31eb4a 100644 --- a/hivemq-edge/src/main/java/com/hivemq/api/error/ApiExceptionMapper.java +++ b/hivemq-edge/src/main/java/com/hivemq/api/error/ApiExceptionMapper.java @@ -16,6 +16,7 @@ package com.hivemq.api.error; import com.hivemq.api.model.ApiErrorMessage; +import com.hivemq.http.HttpConstants; import jakarta.ws.rs.core.MediaType; import jakarta.ws.rs.core.Response; import jakarta.ws.rs.ext.ExceptionMapper; @@ -32,10 +33,6 @@ */ @Provider public class ApiExceptionMapper implements ExceptionMapper { - public static final @NotNull String APPLICATION_PROBLEM_JSON_CHARSET_UTF_8 = - "application/problem+json;charset=utf-8"; - public static final @NotNull MediaType APPLICATION_PROBLEM_JSON_TYPE = - new MediaType("application", "problem+json", "utf-8"); private static final @NotNull Logger logger = LoggerFactory.getLogger(ApiExceptionMapper.class); @Override @@ -47,7 +44,7 @@ public class ApiExceptionMapper implements ExceptionMapper { apiError.setFieldName(exception.getFieldName()); return Response.status(exception.getHttpStatusCode()) .entity(apiError) - .type(APPLICATION_PROBLEM_JSON_TYPE) + .type(HttpConstants.APPLICATION_PROBLEM_JSON_TYPE) .build(); } } diff --git a/hivemq-edge/src/main/java/com/hivemq/http/HttpConstants.java b/hivemq-edge/src/main/java/com/hivemq/http/HttpConstants.java index 2d1d677b42..f6a87ea294 100644 --- a/hivemq-edge/src/main/java/com/hivemq/http/HttpConstants.java +++ b/hivemq-edge/src/main/java/com/hivemq/http/HttpConstants.java @@ -16,6 +16,8 @@ package com.hivemq.http; import com.hivemq.http.error.ErrorType; +import jakarta.ws.rs.core.MediaType; +import org.jetbrains.annotations.NotNull; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; @@ -28,27 +30,29 @@ enum METHOD { GET, POST, HEAD, PUT, DELETE, OPTIONS, CONNECT, TRACE, PATCH } - String SLASH = "/"; - String HTTP = "http"; - String HTTPS = "https"; - String PROTOCOL_SEP = "://"; - String DEFAULT_DATE_FORMAT = "yyyy-MM-dd HH:mm:ss"; - String HTTP_URL_REGEX = "https?:\\/\\/(?:w{1,3}\\.)?[^\\s.]+(?:\\.[a-z]+)*(?::\\d+)?((?:\\/\\w+)|(?:-\\w+))*\\/?(?![^<]*(?:<\\/\\w+>|\\/?>))"; - Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; - String CONTENT_TYPE_HEADER = "Content-Type"; - String USER_AGENT_HEADER = "User-Agent"; - String CONTENT_ENCODING_HEADER = "Content-Encoding"; - String LOCATION_HEADER = "Location"; - String AUTH_HEADER = "Authorization"; - String BASIC_AUTH_CHALLENGE_HEADER = "WWW-Authenticate"; - String BEARER_TOKEN_HEADER = "Bearer %s"; - String BASIC_AUTH_HEADER = "Basic %s"; - String BASIC_AUTH_REALM = "Basic realm=\"%s\""; - String HTML_MIME_TYPE = "text/html"; - String PLAIN_MIME_TYPE = "text/plain"; - String JSON_MIME_TYPE = "application/json"; - String BASE64_ENCODED_VALUE = "data:%s;base64,%s"; - String DEFAULT_MIME_TYPE = HTML_MIME_TYPE; + @NotNull String SLASH = "/"; + @NotNull String HTTP = "http"; + @NotNull String HTTPS = "https"; + @NotNull String PROTOCOL_SEP = "://"; + @NotNull String DEFAULT_DATE_FORMAT = "yyyy-MM-dd HH:mm:ss"; + @NotNull String HTTP_URL_REGEX = "https?:\\/\\/(?:w{1,3}\\.)?[^\\s.]+(?:\\.[a-z]+)*(?::\\d+)?((?:\\/\\w+)|(?:-\\w+))*\\/?(?![^<]*(?:<\\/\\w+>|\\/?>))"; + @NotNull Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; + @NotNull String CONTENT_TYPE_HEADER = "Content-Type"; + @NotNull String USER_AGENT_HEADER = "User-Agent"; + @NotNull String CONTENT_ENCODING_HEADER = "Content-Encoding"; + @NotNull String LOCATION_HEADER = "Location"; + @NotNull String AUTH_HEADER = "Authorization"; + @NotNull String BASIC_AUTH_CHALLENGE_HEADER = "WWW-Authenticate"; + @NotNull String BEARER_TOKEN_HEADER = "Bearer %s"; + @NotNull String BASIC_AUTH_HEADER = "Basic %s"; + @NotNull String BASIC_AUTH_REALM = "Basic realm=\"%s\""; + @NotNull String HTML_MIME_TYPE = "text/html"; + @NotNull String PLAIN_MIME_TYPE = "text/plain"; + @NotNull String JSON_MIME_TYPE = "application/json"; + @NotNull String BASE64_ENCODED_VALUE = "data:%s;base64,%s"; + @NotNull String DEFAULT_MIME_TYPE = HTML_MIME_TYPE; + @NotNull String APPLICATION_PROBLEM_JSON_CHARSET_UTF_8 = "application/problem+json;charset=utf-8"; + @NotNull MediaType APPLICATION_PROBLEM_JSON_TYPE = new MediaType("application", "problem+json", "utf-8"); int SC_CONTINUE = 100; int SC_SWITCHING_PROTOCOLS = 101; @@ -92,7 +96,7 @@ enum METHOD { int SC_GATEWAY_TIMEOUT = 504; int SC_HTTP_VERSION_NOT_SUPPORTED = 505; - Map MIME_MAP = new HashMap(){{ + @NotNull Map MIME_MAP = new HashMap<>(){{ put("appcache", "text/cache-manifest"); put("css", "text/css"); put("woff", "font/woff"); diff --git a/hivemq-edge/src/main/java/com/hivemq/util/ErrorResponseUtil.java b/hivemq-edge/src/main/java/com/hivemq/util/ErrorResponseUtil.java index e194d1cc72..6b3e86ed91 100644 --- a/hivemq-edge/src/main/java/com/hivemq/util/ErrorResponseUtil.java +++ b/hivemq-edge/src/main/java/com/hivemq/util/ErrorResponseUtil.java @@ -17,6 +17,7 @@ import com.hivemq.api.error.ApiExceptionMapper; import com.hivemq.edge.api.model.ApiError; +import com.hivemq.http.HttpConstants; import com.hivemq.http.error.ProblemDetails; import jakarta.ws.rs.core.Response; import org.jetbrains.annotations.NotNull; @@ -28,14 +29,14 @@ public class ErrorResponseUtil { public static @NotNull Response errorResponse(final @NotNull ApiError error) { return Response.status(error.getStatus()) .entity(error) - .type(ApiExceptionMapper.APPLICATION_PROBLEM_JSON_TYPE) + .type(HttpConstants.APPLICATION_PROBLEM_JSON_TYPE) .build(); } public static @NotNull Response errorResponse(final @NotNull ProblemDetails errors) { return Response.status(errors.getStatus()) .entity(errors) - .type(ApiExceptionMapper.APPLICATION_PROBLEM_JSON_TYPE) + .type(HttpConstants.APPLICATION_PROBLEM_JSON_TYPE) .build(); } } diff --git a/hivemq-edge/src/test/java/com/hivemq/api/auth/BearerTokenAuthTests.java b/hivemq-edge/src/test/java/com/hivemq/api/auth/BearerTokenAuthTests.java index 02c42e90f6..54bf63c049 100644 --- a/hivemq-edge/src/test/java/com/hivemq/api/auth/BearerTokenAuthTests.java +++ b/hivemq-edge/src/test/java/com/hivemq/api/auth/BearerTokenAuthTests.java @@ -24,7 +24,6 @@ import com.hivemq.api.auth.handler.impl.BearerTokenAuthenticationHandler; import com.hivemq.api.auth.jwt.JwtAuthenticationProvider; import com.hivemq.api.config.ApiJwtConfiguration; -import com.hivemq.api.error.ApiExceptionMapper; import com.hivemq.api.resources.impl.AuthenticationResourceImpl; import com.hivemq.bootstrap.ioc.Injector; import com.hivemq.edge.api.model.ApiBearerToken; @@ -140,7 +139,7 @@ public void testAuthenticateInvalidUser() throws IOException { READ_TIMEOUT); assertThat(response.getStatusCode()).as("Resource should NOT be accepted").isEqualTo(401); assertThat(response.getContentType()).as("API authenticate response should be json") - .isEqualTo(ApiExceptionMapper.APPLICATION_PROBLEM_JSON_CHARSET_UTF_8); + .isEqualTo(HttpConstants.APPLICATION_PROBLEM_JSON_CHARSET_UTF_8); assertThat(mapper.readValue(response.getResponseBody(), ProblemDetails.class) .getErrors() .get(0) diff --git a/hivemq-edge/src/test/java/com/hivemq/api/auth/ChainedAuthTests.java b/hivemq-edge/src/test/java/com/hivemq/api/auth/ChainedAuthTests.java index f63b145a41..52247bc76c 100644 --- a/hivemq-edge/src/test/java/com/hivemq/api/auth/ChainedAuthTests.java +++ b/hivemq-edge/src/test/java/com/hivemq/api/auth/ChainedAuthTests.java @@ -25,7 +25,6 @@ import com.hivemq.api.auth.jwt.JwtAuthenticationProvider; import com.hivemq.api.auth.provider.IUsernameRolesProvider; import com.hivemq.api.config.ApiJwtConfiguration; -import com.hivemq.api.error.ApiExceptionMapper; import com.hivemq.api.resources.impl.AuthenticationResourceImpl; import com.hivemq.edge.api.model.ApiBearerToken; import com.hivemq.edge.api.model.UsernamePasswordCredentials; @@ -140,7 +139,7 @@ public void testAuthenticateInvalidUser() throws IOException { READ_TIMEOUT); assertThat(response.getStatusCode()).as("Resource should NOT be accepted").isEqualTo(401); assertThat(response.getContentType()).as("API authenticate response should be json") - .isEqualTo(ApiExceptionMapper.APPLICATION_PROBLEM_JSON_CHARSET_UTF_8); + .isEqualTo(HttpConstants.APPLICATION_PROBLEM_JSON_CHARSET_UTF_8); assertThat(mapper.readValue(response.getResponseBody(), ProblemDetails.class) .getErrors() .get(0) From d347f37236f9d4701d8ac12f41a5e4c3a0c6cbf0 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Tue, 8 Jul 2025 16:03:56 +0200 Subject: [PATCH 098/121] refactor: Add http error 500 to resources --- gradle/libs.versions.toml | 2 + hivemq-edge/build.gradle.kts | 3 + .../hivemq/api/errors/HttpErrorFactory.java | 13 +- .../com/hivemq/common/i18n/I18nTemplate.java | 27 +++++ .../com/hivemq/common/i18n/LocaleContext.java | 36 ++++++ .../common/i18n/OpenAPIErrorTemplate.java | 111 ++++++++++++++++++ .../hivemq/common/i18n/OpenAPIHttpError.java | 59 ++++++++++ .../templates/openapi-errors-en_US.properties | 3 + .../common/i18n/OpenAPIErrorTemplateTest.java | 29 +++++ .../common/i18n/OpenAPIHttpErrorTest.java | 47 ++++++++ 10 files changed, 324 insertions(+), 6 deletions(-) create mode 100644 hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nTemplate.java create mode 100644 hivemq-edge/src/main/java/com/hivemq/common/i18n/LocaleContext.java create mode 100644 hivemq-edge/src/main/java/com/hivemq/common/i18n/OpenAPIErrorTemplate.java create mode 100644 hivemq-edge/src/main/java/com/hivemq/common/i18n/OpenAPIHttpError.java create mode 100644 hivemq-edge/src/main/resources/templates/openapi-errors-en_US.properties create mode 100644 hivemq-edge/src/test/java/com/hivemq/common/i18n/OpenAPIErrorTemplateTest.java create mode 100644 hivemq-edge/src/test/java/com/hivemq/common/i18n/OpenAPIHttpErrorTest.java diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 4b2521975c..2fbfee03cf 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -13,6 +13,7 @@ digitalpetri-modbus-tcp = "2.1.3" dropwizard-metrics = "4.2.37" equalsverifier = "3.17.5" errorprone = "2.38.0" +freemarker = "2.3.34" future-converter = "1.2.0" guava = "33.4.8-jre" hikari = "6.2.1" @@ -94,6 +95,7 @@ dropwizard-metrics-jvm = { module = "io.dropwizard.metrics:metrics-jvm", version dropwizard-metrics-logback = { module = "io.dropwizard.metrics:metrics-logback", version.ref = "dropwizard-metrics" } equalsverifier = { module = "nl.jqno.equalsverifier:equalsverifier", version.ref = "equalsverifier" } errorprone = { module = "com.google.errorprone:error_prone_core", version.ref = "errorprone" } +freemarker = { module = "org.freemarker:freemarker", version.ref = "freemarker" } guava = { module = "com.google.guava:guava", version.ref = "guava" } hikari = { module = "com.zaxxer:HikariCP", version.ref = "hikari" } hivemq-edge-adaptersdk = { module = "com.hivemq:hivemq-edge-adapter-sdk", version.ref = "hivemq-edge-adaptersdk" } diff --git a/hivemq-edge/build.gradle.kts b/hivemq-edge/build.gradle.kts index 2847d90813..79ca0eb7ce 100644 --- a/hivemq-edge/build.gradle.kts +++ b/hivemq-edge/build.gradle.kts @@ -200,6 +200,9 @@ dependencies { // json path implementation(libs.json.path) + // i18n + implementation(libs.freemarker) + // Edge modules compileOnly("com.hivemq:hivemq-edge-module-etherip") compileOnly("com.hivemq:hivemq-edge-module-plc4x") diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java index 07749091ef..195fcfacb4 100644 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java @@ -16,18 +16,19 @@ package com.hivemq.api.errors; +import com.hivemq.common.i18n.OpenAPIHttpError; +import com.hivemq.edge.api.model.*; import com.hivemq.edge.api.model.InsufficientStorageError; import com.hivemq.edge.api.model.InternalServerError; import com.hivemq.edge.api.model.InvalidQueryParameterError; -import com.hivemq.edge.api.model.PreconditionFailedError; -import com.hivemq.edge.api.model.RequestBodyMissingError; -import com.hivemq.edge.api.model.RequestBodyParameterMissingError; import com.hivemq.edge.api.model.TemporaryNotAvailableError; import com.hivemq.edge.api.model.UrlParameterMissingError; import com.hivemq.http.HttpStatus; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import java.util.Map; + public final class HttpErrorFactory extends ErrorFactory { private HttpErrorFactory() { super(); @@ -53,10 +54,10 @@ private HttpErrorFactory() { public static @NotNull InternalServerError internalServerError(final @Nullable String reason) { return InternalServerError.builder() .type(type(InternalServerError.class)) - .title("Internal Server Error") + .title(OpenAPIHttpError.HTTP_ERROR_500_TITLE.get()) .detail(reason == null ? - "An unexpected error occurred, check the logs." : - "An unexpected error occurred: " + reason) + OpenAPIHttpError.HTTP_ERROR_500_DETAIL_DEFAULT.get() : + OpenAPIHttpError.HTTP_ERROR_500_DETAIL_WITH_REASON.get(Map.of("reason", reason))) .status(HttpStatus.INTERNAL_SERVER_ERROR_500) .build(); } diff --git a/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nTemplate.java b/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nTemplate.java new file mode 100644 index 0000000000..b5b268099a --- /dev/null +++ b/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nTemplate.java @@ -0,0 +1,27 @@ +/* + * Copyright 2019-present HiveMQ GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.hivemq.common.i18n; + +import org.jetbrains.annotations.NotNull; + +public interface I18nTemplate { + @NotNull String getKey(); + + @NotNull String getName(); + + @NotNull String getResourceName(); +} diff --git a/hivemq-edge/src/main/java/com/hivemq/common/i18n/LocaleContext.java b/hivemq-edge/src/main/java/com/hivemq/common/i18n/LocaleContext.java new file mode 100644 index 0000000000..7650db9506 --- /dev/null +++ b/hivemq-edge/src/main/java/com/hivemq/common/i18n/LocaleContext.java @@ -0,0 +1,36 @@ +/* + * Copyright 2019-present HiveMQ GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.hivemq.common.i18n; + +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.Locale; + +public final class LocaleContext { + public static @NotNull Locale DEFAULT_LOCALE = Locale.US; + + private static final ThreadLocal THREAD_LOCAL_LOCALE = ThreadLocal.withInitial(() -> DEFAULT_LOCALE); + + public static @NotNull Locale getCurrentLocale() { + return THREAD_LOCAL_LOCALE.get(); + } + + public static void setCurrentLocale(final @Nullable Locale locale) { + THREAD_LOCAL_LOCALE.set(locale == null ? DEFAULT_LOCALE : locale); + } +} diff --git a/hivemq-edge/src/main/java/com/hivemq/common/i18n/OpenAPIErrorTemplate.java b/hivemq-edge/src/main/java/com/hivemq/common/i18n/OpenAPIErrorTemplate.java new file mode 100644 index 0000000000..8e1f54b58d --- /dev/null +++ b/hivemq-edge/src/main/java/com/hivemq/common/i18n/OpenAPIErrorTemplate.java @@ -0,0 +1,111 @@ +/* + * Copyright 2019-present HiveMQ GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.hivemq.common.i18n; + +import freemarker.cache.StringTemplateLoader; +import freemarker.template.Configuration; +import freemarker.template.Template; +import freemarker.template.TemplateException; +import org.apache.commons.io.IOUtils; +import org.jetbrains.annotations.NotNull; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.IOException; +import java.io.StringReader; +import java.io.StringWriter; +import java.nio.charset.StandardCharsets; +import java.util.Locale; +import java.util.Map; +import java.util.Properties; +import java.util.concurrent.ConcurrentHashMap; + +/** + * Singleton class to manage OpenAPI error templates using FreeMarker. + * It provides methods to retrieve error messages based on the current locale and template keys. + *

+ * This class is thread-safe and uses a cache to store configurations for different locales. + */ +public final class OpenAPIErrorTemplate { + + private static final OpenAPIErrorTemplate INSTANCE = new OpenAPIErrorTemplate(); + + private final @NotNull Map configurationMap; + private final @NotNull Logger logger; + + private OpenAPIErrorTemplate() { + configurationMap = new ConcurrentHashMap<>(); + logger = LoggerFactory.getLogger(getClass()); + } + + public static @NotNull OpenAPIErrorTemplate getInstance() { + return INSTANCE; + } + + private Configuration createConfiguration(final @NotNull Locale locale) { + final Configuration configuration = new Configuration(Configuration.VERSION_2_3_34); + configuration.setDefaultEncoding(StandardCharsets.UTF_8.name()); + final StringTemplateLoader stringTemplateLoader = new StringTemplateLoader(); + configuration.setTemplateLoader(stringTemplateLoader); + configuration.setLocale(locale); + return configuration; + } + + public @NotNull String get(final @NotNull I18nTemplate i18nTemplate) { + return get(i18nTemplate, Map.of()); + } + + public @NotNull String get(final @NotNull I18nTemplate i18nTemplate, final @NotNull Map map) { + final Locale locale = LocaleContext.getCurrentLocale(); + Configuration configuration = configurationMap.get(locale.toString()); + if (configuration == null) { + configuration = createConfiguration(locale); + configurationMap.put(locale.toString(), configuration); + } + try { + final StringTemplateLoader stringTemplateLoader = (StringTemplateLoader) configuration.getTemplateLoader(); + if (stringTemplateLoader.findTemplateSource(i18nTemplate.getKey()) == null) { + final Properties properties = new Properties(); + try (final StringReader stringReader = new StringReader(IOUtils.resourceToString(i18nTemplate.getResourceName(), + StandardCharsets.UTF_8))) { + properties.load(stringReader); + } + synchronized (configuration) { + for (final Map.Entry entry : properties.entrySet()) { + stringTemplateLoader.putTemplate(String.valueOf(entry.getKey()), + String.valueOf(entry.getValue())); + } + } + } + final Template template = configuration.getTemplate(i18nTemplate.getKey()); + try (final StringWriter stringWriter = new StringWriter()) { + template.process(map, stringWriter); + return stringWriter.toString(); + } + } catch (final TemplateException e) { + final String errorMessage = + "Error: Template " + i18nTemplate.getKey() + " for " + locale + " could not be processed."; + logger.error(errorMessage); + return errorMessage; + } catch (final IOException e) { + final String errorMessage = + "Error: Template " + i18nTemplate.getKey() + " for " + locale + " could not be loaded."; + logger.error(errorMessage); + return errorMessage; + } + } +} diff --git a/hivemq-edge/src/main/java/com/hivemq/common/i18n/OpenAPIHttpError.java b/hivemq-edge/src/main/java/com/hivemq/common/i18n/OpenAPIHttpError.java new file mode 100644 index 0000000000..62e6a42a02 --- /dev/null +++ b/hivemq-edge/src/main/java/com/hivemq/common/i18n/OpenAPIHttpError.java @@ -0,0 +1,59 @@ +/* + * Copyright 2019-present HiveMQ GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.hivemq.common.i18n; + +import org.jetbrains.annotations.NotNull; + +import java.util.Map; + +public enum OpenAPIHttpError implements I18nTemplate { + HTTP_ERROR_500_TITLE("http.error.500.title"), + HTTP_ERROR_500_DETAIL_DEFAULT("http.error.500.detail.default"), + HTTP_ERROR_500_DETAIL_WITH_REASON("http.error.500.detail.with.reason"), + ; + + private static final String RESOURCE_NAME_PREFIX = "/templates/openapi-errors-"; + private static final String RESOURCE_NAME_SUFFIX = ".properties"; + private final @NotNull String key; + + OpenAPIHttpError(final @NotNull String key) { + this.key = key; + } + + public @NotNull String get() { + return get(Map.of()); + } + + public @NotNull String get(final @NotNull Map map) { + return OpenAPIErrorTemplate.getInstance().get(this, map); + } + + @Override + public @NotNull String getKey() { + return key; + } + + @Override + public @NotNull String getName() { + return name(); + } + + @Override + public @NotNull String getResourceName() { + return RESOURCE_NAME_PREFIX + LocaleContext.getCurrentLocale() + RESOURCE_NAME_SUFFIX; + } +} diff --git a/hivemq-edge/src/main/resources/templates/openapi-errors-en_US.properties b/hivemq-edge/src/main/resources/templates/openapi-errors-en_US.properties new file mode 100644 index 0000000000..75ab7f5afa --- /dev/null +++ b/hivemq-edge/src/main/resources/templates/openapi-errors-en_US.properties @@ -0,0 +1,3 @@ +http.error.500.title=Internal Server Error +http.error.500.detail.default=An unexpected error occurred, check the logs. +http.error.500.detail.with.reason=An unexpected error occurred: ${reason} diff --git a/hivemq-edge/src/test/java/com/hivemq/common/i18n/OpenAPIErrorTemplateTest.java b/hivemq-edge/src/test/java/com/hivemq/common/i18n/OpenAPIErrorTemplateTest.java new file mode 100644 index 0000000000..8b8f752127 --- /dev/null +++ b/hivemq-edge/src/test/java/com/hivemq/common/i18n/OpenAPIErrorTemplateTest.java @@ -0,0 +1,29 @@ +/* + * Copyright 2019-present HiveMQ GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.hivemq.common.i18n; + +import org.junit.Test; + +import static org.assertj.core.api.Assertions.assertThat; + +public class OpenAPIErrorTemplateTest { + @Test + public void whenLocaleIsNull_thenUseDefaultLocale() { + LocaleContext.setCurrentLocale(null); + assertThat(LocaleContext.getCurrentLocale()).isEqualTo(LocaleContext.DEFAULT_LOCALE); + } +} diff --git a/hivemq-edge/src/test/java/com/hivemq/common/i18n/OpenAPIHttpErrorTest.java b/hivemq-edge/src/test/java/com/hivemq/common/i18n/OpenAPIHttpErrorTest.java new file mode 100644 index 0000000000..7f5c722cc9 --- /dev/null +++ b/hivemq-edge/src/test/java/com/hivemq/common/i18n/OpenAPIHttpErrorTest.java @@ -0,0 +1,47 @@ +/* + * Copyright 2019-present HiveMQ GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.hivemq.common.i18n; + +import org.junit.Test; + +import java.util.Locale; +import java.util.Map; + +import static org.assertj.core.api.Assertions.assertThat; + +public class OpenAPIHttpErrorTest { + @Test + public void whenLocaleIsEnUS_thenHttpError500ShouldWork() { + LocaleContext.setCurrentLocale(Locale.US); + assertThat(OpenAPIHttpError.HTTP_ERROR_500_TITLE.get()).isEqualTo("Internal Server Error"); + assertThat(OpenAPIHttpError.HTTP_ERROR_500_DETAIL_DEFAULT.get()).isEqualTo( + "An unexpected error occurred, check the logs."); + assertThat(OpenAPIHttpError.HTTP_ERROR_500_DETAIL_WITH_REASON.get(Map.of("reason", "test."))).isEqualTo( + "An unexpected error occurred: test."); + } + + @Test + public void whenLocaleIsEnGB_thenHttpError500ShouldFail() { + LocaleContext.setCurrentLocale(Locale.UK); + assertThat(OpenAPIHttpError.HTTP_ERROR_500_TITLE.get()).isEqualTo( + "Error: Template http.error.500.title for en_GB could not be loaded."); + assertThat(OpenAPIHttpError.HTTP_ERROR_500_DETAIL_DEFAULT.get()).isEqualTo( + "Error: Template http.error.500.detail.default for en_GB could not be loaded."); + assertThat(OpenAPIHttpError.HTTP_ERROR_500_DETAIL_WITH_REASON.get(Map.of("reason", "test."))).isEqualTo( + "Error: Template http.error.500.detail.with.reason for en_GB could not be loaded."); + } +} From 6dd5e7fd28092ee63bcf61fa31ed79d23fefe534 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Tue, 8 Jul 2025 17:13:29 +0200 Subject: [PATCH 099/121] refactor: Add all http errors to resources --- .../hivemq/api/errors/HttpErrorFactory.java | 32 +++++----- .../com/hivemq/common/i18n/LocaleContext.java | 4 +- .../common/i18n/OpenAPIErrorTemplate.java | 2 +- .../hivemq/common/i18n/OpenAPIHttpError.java | 29 ++++++--- .../templates/openapi-errors-en_US.properties | 17 +++++- .../common/i18n/OpenAPIErrorTemplateTest.java | 7 ++- .../common/i18n/OpenAPIHttpErrorTest.java | 61 ++++++++++++++++++- 7 files changed, 120 insertions(+), 32 deletions(-) diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java index 195fcfacb4..f2c3fb7ccf 100644 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java @@ -41,8 +41,10 @@ private HttpErrorFactory() { public static @NotNull InsufficientStorageError insufficientStorageError(final @Nullable String reason) { return InsufficientStorageError.builder() .type(type(InsufficientStorageError.class)) - .title("Insufficient Storage") - .detail(reason == null ? "Insufficient Storage." : "Insufficient Storage: " + reason) + .title(OpenAPIHttpError.HTTP_ERROR_507_TITLE.get()) + .detail(reason == null ? + OpenAPIHttpError.HTTP_ERROR_507_DETAIL_DEFAULT.get() : + OpenAPIHttpError.HTTP_ERROR_507_DETAIL_WITH_REASON.get(Map.of("reason", reason))) .status(HttpStatus.INSUFFICIENT_STORAGE_507) .build(); } @@ -67,8 +69,10 @@ private HttpErrorFactory() { final @NotNull String reason) { return InvalidQueryParameterError.builder() .type(type(InvalidQueryParameterError.class)) - .title("Query Parameter is Invalid") - .detail("Query parameter '" + parameter + "' is invalid: " + reason) + .title(OpenAPIHttpError.HTTP_ERROR_400_INVALID_QUERY_PARAMETER_TITLE.get()) + .detail(OpenAPIHttpError.HTTP_ERROR_400_INVALID_QUERY_PARAMETER_DETAIL.get(Map.of( + "parameter", parameter, + "reason", reason))) .parameter(parameter) .status(HttpStatus.BAD_REQUEST_400) .build(); @@ -78,8 +82,8 @@ private HttpErrorFactory() { final @NotNull String reason) { return PreconditionFailedError.builder() .type(type(PreconditionFailedError.class)) - .title("Precondition Failed") - .detail("A precondition required for fulfilling the request was not fulfilled: " + reason) + .title(OpenAPIHttpError.HTTP_ERROR_412_TITLE.get()) + .detail(OpenAPIHttpError.HTTP_ERROR_412_DETAIL.get(Map.of("reason", reason))) .status(HttpStatus.PRECONDITION_FAILED_412) .build(); } @@ -87,8 +91,8 @@ private HttpErrorFactory() { public static @NotNull RequestBodyMissingError requestBodyMissingError() { return RequestBodyMissingError.builder() .type(type(RequestBodyMissingError.class)) - .title("Required Request Body Missing") - .detail("Required request body is missing.") + .title(OpenAPIHttpError.HTTP_ERROR_400_REQUEST_BODY_MISSING_TITLE.get()) + .detail(OpenAPIHttpError.HTTP_ERROR_400_REQUEST_BODY_MISSING_DETAIL.get()) .status(HttpStatus.BAD_REQUEST_400) .build(); } @@ -96,8 +100,8 @@ private HttpErrorFactory() { public static @NotNull RequestBodyParameterMissingError requestBodyParameterMissingError(final @NotNull String parameter) { return RequestBodyParameterMissingError.builder() .type(type(RequestBodyParameterMissingError.class)) - .title("Required Request Body Parameter Missing") - .detail("Required request body parameter '" + parameter + "' is missing.") + .title(OpenAPIHttpError.HTTP_ERROR_400_REQUEST_BODY_PARAMETER_MISSING_TITLE.getKey()) + .detail(OpenAPIHttpError.HTTP_ERROR_400_REQUEST_BODY_PARAMETER_MISSING_DETAIL.get(Map.of("parameter", parameter))) .parameter(parameter) .status(HttpStatus.BAD_REQUEST_400) .build(); @@ -106,8 +110,8 @@ private HttpErrorFactory() { public static @NotNull TemporaryNotAvailableError temporaryNotAvailableError() { return TemporaryNotAvailableError.builder() .type(type(TemporaryNotAvailableError.class)) - .title("Endpoint Temporarily not Available") - .detail("The endpoint is temporarily not available, please try again later.") + .title(OpenAPIHttpError.HTTP_ERROR_503_TITLE.get()) + .detail(OpenAPIHttpError.HTTP_ERROR_503_DETAIL.get()) .status(HttpStatus.SERVICE_UNAVAILABLE_503) .build(); } @@ -115,8 +119,8 @@ private HttpErrorFactory() { public static @NotNull UrlParameterMissingError urlParameterMissingError(final @NotNull String parameter) { return UrlParameterMissingError.builder() .type(type(UrlParameterMissingError.class)) - .title("Required URL Parameter Missing") - .detail("Required URL parameter '" + parameter + "' is missing.") + .title(OpenAPIHttpError.HTTP_ERROR_400_URL_PARAMETER_MISSING_TITLE.get()) + .detail(OpenAPIHttpError.HTTP_ERROR_400_URL_PARAMETER_MISSING_DETAIL.get(Map.of("parameter", parameter))) .parameter(parameter) .status(HttpStatus.BAD_REQUEST_400) .build(); diff --git a/hivemq-edge/src/main/java/com/hivemq/common/i18n/LocaleContext.java b/hivemq-edge/src/main/java/com/hivemq/common/i18n/LocaleContext.java index 7650db9506..3e03e07776 100644 --- a/hivemq-edge/src/main/java/com/hivemq/common/i18n/LocaleContext.java +++ b/hivemq-edge/src/main/java/com/hivemq/common/i18n/LocaleContext.java @@ -26,11 +26,11 @@ public final class LocaleContext { private static final ThreadLocal THREAD_LOCAL_LOCALE = ThreadLocal.withInitial(() -> DEFAULT_LOCALE); - public static @NotNull Locale getCurrentLocale() { + public static @NotNull Locale getLocale() { return THREAD_LOCAL_LOCALE.get(); } - public static void setCurrentLocale(final @Nullable Locale locale) { + public static void setLocale(final @Nullable Locale locale) { THREAD_LOCAL_LOCALE.set(locale == null ? DEFAULT_LOCALE : locale); } } diff --git a/hivemq-edge/src/main/java/com/hivemq/common/i18n/OpenAPIErrorTemplate.java b/hivemq-edge/src/main/java/com/hivemq/common/i18n/OpenAPIErrorTemplate.java index 8e1f54b58d..67a0b681f4 100644 --- a/hivemq-edge/src/main/java/com/hivemq/common/i18n/OpenAPIErrorTemplate.java +++ b/hivemq-edge/src/main/java/com/hivemq/common/i18n/OpenAPIErrorTemplate.java @@ -70,7 +70,7 @@ private Configuration createConfiguration(final @NotNull Locale locale) { } public @NotNull String get(final @NotNull I18nTemplate i18nTemplate, final @NotNull Map map) { - final Locale locale = LocaleContext.getCurrentLocale(); + final Locale locale = LocaleContext.getLocale(); Configuration configuration = configurationMap.get(locale.toString()); if (configuration == null) { configuration = createConfiguration(locale); diff --git a/hivemq-edge/src/main/java/com/hivemq/common/i18n/OpenAPIHttpError.java b/hivemq-edge/src/main/java/com/hivemq/common/i18n/OpenAPIHttpError.java index 62e6a42a02..afc098d329 100644 --- a/hivemq-edge/src/main/java/com/hivemq/common/i18n/OpenAPIHttpError.java +++ b/hivemq-edge/src/main/java/com/hivemq/common/i18n/OpenAPIHttpError.java @@ -21,17 +21,30 @@ import java.util.Map; public enum OpenAPIHttpError implements I18nTemplate { - HTTP_ERROR_500_TITLE("http.error.500.title"), - HTTP_ERROR_500_DETAIL_DEFAULT("http.error.500.detail.default"), - HTTP_ERROR_500_DETAIL_WITH_REASON("http.error.500.detail.with.reason"), + HTTP_ERROR_400_INVALID_QUERY_PARAMETER_DETAIL, + HTTP_ERROR_400_INVALID_QUERY_PARAMETER_TITLE, + HTTP_ERROR_400_REQUEST_BODY_MISSING_DETAIL, + HTTP_ERROR_400_REQUEST_BODY_MISSING_TITLE, + HTTP_ERROR_400_REQUEST_BODY_PARAMETER_MISSING_DETAIL, + HTTP_ERROR_400_REQUEST_BODY_PARAMETER_MISSING_TITLE, + HTTP_ERROR_400_URL_PARAMETER_MISSING_DETAIL, + HTTP_ERROR_400_URL_PARAMETER_MISSING_TITLE, + HTTP_ERROR_412_DETAIL, + HTTP_ERROR_412_TITLE, + HTTP_ERROR_500_DETAIL_DEFAULT, + HTTP_ERROR_500_DETAIL_WITH_REASON, + HTTP_ERROR_500_TITLE, + HTTP_ERROR_503_DETAIL, + HTTP_ERROR_503_TITLE, + HTTP_ERROR_507_DETAIL_DEFAULT, + HTTP_ERROR_507_DETAIL_WITH_REASON, + HTTP_ERROR_507_TITLE, ; private static final String RESOURCE_NAME_PREFIX = "/templates/openapi-errors-"; private static final String RESOURCE_NAME_SUFFIX = ".properties"; - private final @NotNull String key; - OpenAPIHttpError(final @NotNull String key) { - this.key = key; + OpenAPIHttpError() { } public @NotNull String get() { @@ -44,7 +57,7 @@ public enum OpenAPIHttpError implements I18nTemplate { @Override public @NotNull String getKey() { - return key; + return name().toLowerCase().replace("_", "."); } @Override @@ -54,6 +67,6 @@ public enum OpenAPIHttpError implements I18nTemplate { @Override public @NotNull String getResourceName() { - return RESOURCE_NAME_PREFIX + LocaleContext.getCurrentLocale() + RESOURCE_NAME_SUFFIX; + return RESOURCE_NAME_PREFIX + LocaleContext.getLocale() + RESOURCE_NAME_SUFFIX; } } diff --git a/hivemq-edge/src/main/resources/templates/openapi-errors-en_US.properties b/hivemq-edge/src/main/resources/templates/openapi-errors-en_US.properties index 75ab7f5afa..ecc7712c16 100644 --- a/hivemq-edge/src/main/resources/templates/openapi-errors-en_US.properties +++ b/hivemq-edge/src/main/resources/templates/openapi-errors-en_US.properties @@ -1,3 +1,18 @@ -http.error.500.title=Internal Server Error +http.error.400.invalid.query.parameter.detail=Query parameter '${parameter}' is invalid: ${reason} +http.error.400.invalid.query.parameter.title=Query Parameter is Invalid +http.error.400.request.body.missing.detail=Required request body is missing. +http.error.400.request.body.missing.title=Required Request Body Missing +http.error.400.request.body.parameter.missing.detail=Required request body parameter '${parameter}' is missing. +http.error.400.request.body.parameter.missing.title=Required Request Body Parameter Missing +http.error.400.url.parameter.missing.detail=Required URL parameter '${parameter}' is missing. +http.error.400.url.parameter.missing.title=Required URL Parameter Missing +http.error.412.detail=A precondition required for fulfilling the request was not fulfilled: ${reason} +http.error.412.title=Precondition Failed http.error.500.detail.default=An unexpected error occurred, check the logs. http.error.500.detail.with.reason=An unexpected error occurred: ${reason} +http.error.500.title=Internal Server Error +http.error.503.detail=The endpoint is temporarily not available, please try again later. +http.error.503.title=Endpoint Temporarily not Available +http.error.507.detail.default=Insufficient Storage. +http.error.507.detail.with.reason=Insufficient Storage: ${reason} +http.error.507.title=Insufficient Storage diff --git a/hivemq-edge/src/test/java/com/hivemq/common/i18n/OpenAPIErrorTemplateTest.java b/hivemq-edge/src/test/java/com/hivemq/common/i18n/OpenAPIErrorTemplateTest.java index 8b8f752127..049cb3b0b5 100644 --- a/hivemq-edge/src/test/java/com/hivemq/common/i18n/OpenAPIErrorTemplateTest.java +++ b/hivemq-edge/src/test/java/com/hivemq/common/i18n/OpenAPIErrorTemplateTest.java @@ -16,14 +16,15 @@ package com.hivemq.common.i18n; -import org.junit.Test; + +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; public class OpenAPIErrorTemplateTest { @Test public void whenLocaleIsNull_thenUseDefaultLocale() { - LocaleContext.setCurrentLocale(null); - assertThat(LocaleContext.getCurrentLocale()).isEqualTo(LocaleContext.DEFAULT_LOCALE); + LocaleContext.setLocale(null); + assertThat(LocaleContext.getLocale()).isEqualTo(LocaleContext.DEFAULT_LOCALE); } } diff --git a/hivemq-edge/src/test/java/com/hivemq/common/i18n/OpenAPIHttpErrorTest.java b/hivemq-edge/src/test/java/com/hivemq/common/i18n/OpenAPIHttpErrorTest.java index 7f5c722cc9..dd26e46360 100644 --- a/hivemq-edge/src/test/java/com/hivemq/common/i18n/OpenAPIHttpErrorTest.java +++ b/hivemq-edge/src/test/java/com/hivemq/common/i18n/OpenAPIHttpErrorTest.java @@ -16,7 +16,9 @@ package com.hivemq.common.i18n; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.util.Locale; import java.util.Map; @@ -24,9 +26,47 @@ import static org.assertj.core.api.Assertions.assertThat; public class OpenAPIHttpErrorTest { + @BeforeEach + public void setUp() { + LocaleContext.setLocale(Locale.US); + } + + @AfterEach + public void tearDown() { + LocaleContext.setLocale(LocaleContext.DEFAULT_LOCALE); + } + + @Test + public void whenLocaleIsEnUS_thenHttpError400ShouldWork() { + assertThat(OpenAPIHttpError.HTTP_ERROR_400_INVALID_QUERY_PARAMETER_TITLE.get()).isEqualTo( + "Query Parameter is Invalid"); + assertThat(OpenAPIHttpError.HTTP_ERROR_400_INVALID_QUERY_PARAMETER_DETAIL.get(Map.of("parameter", + "p1", + "reason", + "test."))).isEqualTo("Query parameter 'p1' is invalid: test."); + assertThat(OpenAPIHttpError.HTTP_ERROR_400_REQUEST_BODY_MISSING_TITLE.get()).isEqualTo( + "Required Request Body Missing"); + assertThat(OpenAPIHttpError.HTTP_ERROR_400_REQUEST_BODY_MISSING_DETAIL.get()).isEqualTo( + "Required request body is missing."); + assertThat(OpenAPIHttpError.HTTP_ERROR_400_REQUEST_BODY_PARAMETER_MISSING_TITLE.get()).isEqualTo( + "Required Request Body Parameter Missing"); + assertThat(OpenAPIHttpError.HTTP_ERROR_400_REQUEST_BODY_PARAMETER_MISSING_DETAIL.get(Map.of("parameter", + "p1"))).isEqualTo("Required request body parameter 'p1' is missing."); + assertThat(OpenAPIHttpError.HTTP_ERROR_400_URL_PARAMETER_MISSING_TITLE.get()).isEqualTo( + "Required URL Parameter Missing"); + assertThat(OpenAPIHttpError.HTTP_ERROR_400_URL_PARAMETER_MISSING_DETAIL.get(Map.of("parameter", + "p1"))).isEqualTo("Required URL parameter 'p1' is missing."); + } + + @Test + public void whenLocaleIsEnUS_thenHttpError412ShouldWork() { + assertThat(OpenAPIHttpError.HTTP_ERROR_412_TITLE.get()).isEqualTo("Precondition Failed"); + assertThat(OpenAPIHttpError.HTTP_ERROR_412_DETAIL.get(Map.of("reason", "test."))).isEqualTo( + "A precondition required for fulfilling the request was not fulfilled: test."); + } + @Test public void whenLocaleIsEnUS_thenHttpError500ShouldWork() { - LocaleContext.setCurrentLocale(Locale.US); assertThat(OpenAPIHttpError.HTTP_ERROR_500_TITLE.get()).isEqualTo("Internal Server Error"); assertThat(OpenAPIHttpError.HTTP_ERROR_500_DETAIL_DEFAULT.get()).isEqualTo( "An unexpected error occurred, check the logs."); @@ -34,9 +74,24 @@ public void whenLocaleIsEnUS_thenHttpError500ShouldWork() { "An unexpected error occurred: test."); } + @Test + public void whenLocaleIsEnUS_thenHttpError503ShouldWork() { + assertThat(OpenAPIHttpError.HTTP_ERROR_503_TITLE.get()).isEqualTo("Endpoint Temporarily not Available"); + assertThat(OpenAPIHttpError.HTTP_ERROR_503_DETAIL.get()).isEqualTo( + "The endpoint is temporarily not available, please try again later."); + } + + @Test + public void whenLocaleIsEnUS_thenHttpError507ShouldWork() { + assertThat(OpenAPIHttpError.HTTP_ERROR_507_TITLE.get()).isEqualTo("Insufficient Storage"); + assertThat(OpenAPIHttpError.HTTP_ERROR_507_DETAIL_DEFAULT.get()).isEqualTo("Insufficient Storage."); + assertThat(OpenAPIHttpError.HTTP_ERROR_507_DETAIL_WITH_REASON.get(Map.of("reason", "test."))).isEqualTo( + "Insufficient Storage: test."); + } + @Test public void whenLocaleIsEnGB_thenHttpError500ShouldFail() { - LocaleContext.setCurrentLocale(Locale.UK); + LocaleContext.setLocale(Locale.UK); assertThat(OpenAPIHttpError.HTTP_ERROR_500_TITLE.get()).isEqualTo( "Error: Template http.error.500.title for en_GB could not be loaded."); assertThat(OpenAPIHttpError.HTTP_ERROR_500_DETAIL_DEFAULT.get()).isEqualTo( From 0c64cea58b5c4a9bab76b9c88e9dc86b78b12bc1 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Tue, 8 Jul 2025 17:44:15 +0200 Subject: [PATCH 100/121] fix: Fix typo --- .../src/main/java/com/hivemq/api/errors/HttpErrorFactory.java | 2 +- .../main/java/com/hivemq/common/i18n/OpenAPIHttpError.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java index f2c3fb7ccf..2f5c39d2f8 100644 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java @@ -100,7 +100,7 @@ private HttpErrorFactory() { public static @NotNull RequestBodyParameterMissingError requestBodyParameterMissingError(final @NotNull String parameter) { return RequestBodyParameterMissingError.builder() .type(type(RequestBodyParameterMissingError.class)) - .title(OpenAPIHttpError.HTTP_ERROR_400_REQUEST_BODY_PARAMETER_MISSING_TITLE.getKey()) + .title(OpenAPIHttpError.HTTP_ERROR_400_REQUEST_BODY_PARAMETER_MISSING_TITLE.get()) .detail(OpenAPIHttpError.HTTP_ERROR_400_REQUEST_BODY_PARAMETER_MISSING_DETAIL.get(Map.of("parameter", parameter))) .parameter(parameter) .status(HttpStatus.BAD_REQUEST_400) diff --git a/hivemq-edge/src/main/java/com/hivemq/common/i18n/OpenAPIHttpError.java b/hivemq-edge/src/main/java/com/hivemq/common/i18n/OpenAPIHttpError.java index afc098d329..03a50a8034 100644 --- a/hivemq-edge/src/main/java/com/hivemq/common/i18n/OpenAPIHttpError.java +++ b/hivemq-edge/src/main/java/com/hivemq/common/i18n/OpenAPIHttpError.java @@ -41,8 +41,8 @@ public enum OpenAPIHttpError implements I18nTemplate { HTTP_ERROR_507_TITLE, ; - private static final String RESOURCE_NAME_PREFIX = "/templates/openapi-errors-"; - private static final String RESOURCE_NAME_SUFFIX = ".properties"; + private static final @NotNull String RESOURCE_NAME_PREFIX = "/templates/openapi-errors-"; + private static final @NotNull String RESOURCE_NAME_SUFFIX = ".properties"; OpenAPIHttpError() { } From 91beb5fa369015d99a7a643e5f78847ad3bb5b74 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Wed, 9 Jul 2025 08:48:34 +0200 Subject: [PATCH 101/121] test: Add whenLocaleIsEnUS_thenErrorCountShouldMatch() --- .../common/i18n/OpenAPIHttpErrorTest.java | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/hivemq-edge/src/test/java/com/hivemq/common/i18n/OpenAPIHttpErrorTest.java b/hivemq-edge/src/test/java/com/hivemq/common/i18n/OpenAPIHttpErrorTest.java index dd26e46360..54e6c59bde 100644 --- a/hivemq-edge/src/test/java/com/hivemq/common/i18n/OpenAPIHttpErrorTest.java +++ b/hivemq-edge/src/test/java/com/hivemq/common/i18n/OpenAPIHttpErrorTest.java @@ -16,12 +16,20 @@ package com.hivemq.common.i18n; +import org.apache.commons.io.IOUtils; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.io.IOException; +import java.io.StringReader; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; import java.util.Locale; import java.util.Map; +import java.util.Properties; +import java.util.Set; import static org.assertj.core.api.Assertions.assertThat; @@ -36,6 +44,25 @@ public void tearDown() { LocaleContext.setLocale(LocaleContext.DEFAULT_LOCALE); } + @Test + public void whenLocaleIsEnUS_thenErrorCountShouldMatch() throws IOException { + final List errors = Arrays.asList(OpenAPIHttpError.values()); + assertThat(errors.size()).isGreaterThan(0); + final Properties properties = new Properties(); + try (final StringReader stringReader = new StringReader(IOUtils.resourceToString(errors.get(0) + .getResourceName(), StandardCharsets.UTF_8))) { + properties.load(stringReader); + } + assertThat(properties.size()).isEqualTo(errors.size()); + final Set keySet = properties.keySet(); + errors.forEach(error -> assertThat(keySet.contains(error.getKey())).as(error.getKey() + " is not found.") + .isTrue()); + properties.values().forEach(template -> { + assertThat(template).isInstanceOf(String.class); + assertThat((String) template).isNotBlank(); + }); + } + @Test public void whenLocaleIsEnUS_thenHttpError400ShouldWork() { assertThat(OpenAPIHttpError.HTTP_ERROR_400_INVALID_QUERY_PARAMETER_TITLE.get()).isEqualTo( From 4c485292b73b7c339d2e49bb961aa0625113b41a Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Wed, 9 Jul 2025 09:02:57 +0200 Subject: [PATCH 102/121] refactor: Rename all related classes to I18n --- .../hivemq/api/errors/HttpErrorFactory.java | 38 ++++++------- .../{I18nTemplate.java => I18nError.java} | 2 +- ...orTemplate.java => I18nErrorTemplate.java} | 28 +++++----- ...enAPIHttpError.java => I18nHttpError.java} | 8 +-- ...aleContext.java => I18nLocaleContext.java} | 2 +- ...teTest.java => I18nErrorTemplateTest.java} | 6 +- ...pErrorTest.java => I18nHttpErrorTest.java} | 56 ++++++++++--------- 7 files changed, 71 insertions(+), 69 deletions(-) rename hivemq-edge/src/main/java/com/hivemq/common/i18n/{I18nTemplate.java => I18nError.java} (96%) rename hivemq-edge/src/main/java/com/hivemq/common/i18n/{OpenAPIErrorTemplate.java => I18nErrorTemplate.java} (78%) rename hivemq-edge/src/main/java/com/hivemq/common/i18n/{OpenAPIHttpError.java => I18nHttpError.java} (89%) rename hivemq-edge/src/main/java/com/hivemq/common/i18n/{LocaleContext.java => I18nLocaleContext.java} (96%) rename hivemq-edge/src/test/java/com/hivemq/common/i18n/{OpenAPIErrorTemplateTest.java => I18nErrorTemplateTest.java} (82%) rename hivemq-edge/src/test/java/com/hivemq/common/i18n/{OpenAPIHttpErrorTest.java => I18nHttpErrorTest.java} (59%) diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java index 2f5c39d2f8..8be2d7ef1f 100644 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java @@ -16,7 +16,7 @@ package com.hivemq.api.errors; -import com.hivemq.common.i18n.OpenAPIHttpError; +import com.hivemq.common.i18n.I18nHttpError; import com.hivemq.edge.api.model.*; import com.hivemq.edge.api.model.InsufficientStorageError; import com.hivemq.edge.api.model.InternalServerError; @@ -41,10 +41,10 @@ private HttpErrorFactory() { public static @NotNull InsufficientStorageError insufficientStorageError(final @Nullable String reason) { return InsufficientStorageError.builder() .type(type(InsufficientStorageError.class)) - .title(OpenAPIHttpError.HTTP_ERROR_507_TITLE.get()) + .title(I18nHttpError.HTTP_ERROR_507_TITLE.get()) .detail(reason == null ? - OpenAPIHttpError.HTTP_ERROR_507_DETAIL_DEFAULT.get() : - OpenAPIHttpError.HTTP_ERROR_507_DETAIL_WITH_REASON.get(Map.of("reason", reason))) + I18nHttpError.HTTP_ERROR_507_DETAIL_DEFAULT.get() : + I18nHttpError.HTTP_ERROR_507_DETAIL_WITH_REASON.get(Map.of("reason", reason))) .status(HttpStatus.INSUFFICIENT_STORAGE_507) .build(); } @@ -56,10 +56,10 @@ private HttpErrorFactory() { public static @NotNull InternalServerError internalServerError(final @Nullable String reason) { return InternalServerError.builder() .type(type(InternalServerError.class)) - .title(OpenAPIHttpError.HTTP_ERROR_500_TITLE.get()) + .title(I18nHttpError.HTTP_ERROR_500_TITLE.get()) .detail(reason == null ? - OpenAPIHttpError.HTTP_ERROR_500_DETAIL_DEFAULT.get() : - OpenAPIHttpError.HTTP_ERROR_500_DETAIL_WITH_REASON.get(Map.of("reason", reason))) + I18nHttpError.HTTP_ERROR_500_DETAIL_DEFAULT.get() : + I18nHttpError.HTTP_ERROR_500_DETAIL_WITH_REASON.get(Map.of("reason", reason))) .status(HttpStatus.INTERNAL_SERVER_ERROR_500) .build(); } @@ -69,8 +69,8 @@ private HttpErrorFactory() { final @NotNull String reason) { return InvalidQueryParameterError.builder() .type(type(InvalidQueryParameterError.class)) - .title(OpenAPIHttpError.HTTP_ERROR_400_INVALID_QUERY_PARAMETER_TITLE.get()) - .detail(OpenAPIHttpError.HTTP_ERROR_400_INVALID_QUERY_PARAMETER_DETAIL.get(Map.of( + .title(I18nHttpError.HTTP_ERROR_400_INVALID_QUERY_PARAMETER_TITLE.get()) + .detail(I18nHttpError.HTTP_ERROR_400_INVALID_QUERY_PARAMETER_DETAIL.get(Map.of( "parameter", parameter, "reason", reason))) .parameter(parameter) @@ -82,8 +82,8 @@ private HttpErrorFactory() { final @NotNull String reason) { return PreconditionFailedError.builder() .type(type(PreconditionFailedError.class)) - .title(OpenAPIHttpError.HTTP_ERROR_412_TITLE.get()) - .detail(OpenAPIHttpError.HTTP_ERROR_412_DETAIL.get(Map.of("reason", reason))) + .title(I18nHttpError.HTTP_ERROR_412_TITLE.get()) + .detail(I18nHttpError.HTTP_ERROR_412_DETAIL.get(Map.of("reason", reason))) .status(HttpStatus.PRECONDITION_FAILED_412) .build(); } @@ -91,8 +91,8 @@ private HttpErrorFactory() { public static @NotNull RequestBodyMissingError requestBodyMissingError() { return RequestBodyMissingError.builder() .type(type(RequestBodyMissingError.class)) - .title(OpenAPIHttpError.HTTP_ERROR_400_REQUEST_BODY_MISSING_TITLE.get()) - .detail(OpenAPIHttpError.HTTP_ERROR_400_REQUEST_BODY_MISSING_DETAIL.get()) + .title(I18nHttpError.HTTP_ERROR_400_REQUEST_BODY_MISSING_TITLE.get()) + .detail(I18nHttpError.HTTP_ERROR_400_REQUEST_BODY_MISSING_DETAIL.get()) .status(HttpStatus.BAD_REQUEST_400) .build(); } @@ -100,8 +100,8 @@ private HttpErrorFactory() { public static @NotNull RequestBodyParameterMissingError requestBodyParameterMissingError(final @NotNull String parameter) { return RequestBodyParameterMissingError.builder() .type(type(RequestBodyParameterMissingError.class)) - .title(OpenAPIHttpError.HTTP_ERROR_400_REQUEST_BODY_PARAMETER_MISSING_TITLE.get()) - .detail(OpenAPIHttpError.HTTP_ERROR_400_REQUEST_BODY_PARAMETER_MISSING_DETAIL.get(Map.of("parameter", parameter))) + .title(I18nHttpError.HTTP_ERROR_400_REQUEST_BODY_PARAMETER_MISSING_TITLE.get()) + .detail(I18nHttpError.HTTP_ERROR_400_REQUEST_BODY_PARAMETER_MISSING_DETAIL.get(Map.of("parameter", parameter))) .parameter(parameter) .status(HttpStatus.BAD_REQUEST_400) .build(); @@ -110,8 +110,8 @@ private HttpErrorFactory() { public static @NotNull TemporaryNotAvailableError temporaryNotAvailableError() { return TemporaryNotAvailableError.builder() .type(type(TemporaryNotAvailableError.class)) - .title(OpenAPIHttpError.HTTP_ERROR_503_TITLE.get()) - .detail(OpenAPIHttpError.HTTP_ERROR_503_DETAIL.get()) + .title(I18nHttpError.HTTP_ERROR_503_TITLE.get()) + .detail(I18nHttpError.HTTP_ERROR_503_DETAIL.get()) .status(HttpStatus.SERVICE_UNAVAILABLE_503) .build(); } @@ -119,8 +119,8 @@ private HttpErrorFactory() { public static @NotNull UrlParameterMissingError urlParameterMissingError(final @NotNull String parameter) { return UrlParameterMissingError.builder() .type(type(UrlParameterMissingError.class)) - .title(OpenAPIHttpError.HTTP_ERROR_400_URL_PARAMETER_MISSING_TITLE.get()) - .detail(OpenAPIHttpError.HTTP_ERROR_400_URL_PARAMETER_MISSING_DETAIL.get(Map.of("parameter", parameter))) + .title(I18nHttpError.HTTP_ERROR_400_URL_PARAMETER_MISSING_TITLE.get()) + .detail(I18nHttpError.HTTP_ERROR_400_URL_PARAMETER_MISSING_DETAIL.get(Map.of("parameter", parameter))) .parameter(parameter) .status(HttpStatus.BAD_REQUEST_400) .build(); diff --git a/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nTemplate.java b/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nError.java similarity index 96% rename from hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nTemplate.java rename to hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nError.java index b5b268099a..33e5f6ffc6 100644 --- a/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nTemplate.java +++ b/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nError.java @@ -18,7 +18,7 @@ import org.jetbrains.annotations.NotNull; -public interface I18nTemplate { +public interface I18nError { @NotNull String getKey(); @NotNull String getName(); diff --git a/hivemq-edge/src/main/java/com/hivemq/common/i18n/OpenAPIErrorTemplate.java b/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nErrorTemplate.java similarity index 78% rename from hivemq-edge/src/main/java/com/hivemq/common/i18n/OpenAPIErrorTemplate.java rename to hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nErrorTemplate.java index 67a0b681f4..b51d458a6d 100644 --- a/hivemq-edge/src/main/java/com/hivemq/common/i18n/OpenAPIErrorTemplate.java +++ b/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nErrorTemplate.java @@ -35,24 +35,24 @@ import java.util.concurrent.ConcurrentHashMap; /** - * Singleton class to manage OpenAPI error templates using FreeMarker. + * Singleton class to manage OpenAPI i18n error templates using FreeMarker. * It provides methods to retrieve error messages based on the current locale and template keys. *

* This class is thread-safe and uses a cache to store configurations for different locales. */ -public final class OpenAPIErrorTemplate { +public final class I18nErrorTemplate { - private static final OpenAPIErrorTemplate INSTANCE = new OpenAPIErrorTemplate(); + private static final I18nErrorTemplate INSTANCE = new I18nErrorTemplate(); private final @NotNull Map configurationMap; private final @NotNull Logger logger; - private OpenAPIErrorTemplate() { + private I18nErrorTemplate() { configurationMap = new ConcurrentHashMap<>(); logger = LoggerFactory.getLogger(getClass()); } - public static @NotNull OpenAPIErrorTemplate getInstance() { + public static @NotNull I18nErrorTemplate getInstance() { return INSTANCE; } @@ -65,12 +65,12 @@ private Configuration createConfiguration(final @NotNull Locale locale) { return configuration; } - public @NotNull String get(final @NotNull I18nTemplate i18nTemplate) { - return get(i18nTemplate, Map.of()); + public @NotNull String get(final @NotNull I18nError i18NError) { + return get(i18NError, Map.of()); } - public @NotNull String get(final @NotNull I18nTemplate i18nTemplate, final @NotNull Map map) { - final Locale locale = LocaleContext.getLocale(); + public @NotNull String get(final @NotNull I18nError i18NError, final @NotNull Map map) { + final Locale locale = I18nLocaleContext.getLocale(); Configuration configuration = configurationMap.get(locale.toString()); if (configuration == null) { configuration = createConfiguration(locale); @@ -78,9 +78,9 @@ private Configuration createConfiguration(final @NotNull Locale locale) { } try { final StringTemplateLoader stringTemplateLoader = (StringTemplateLoader) configuration.getTemplateLoader(); - if (stringTemplateLoader.findTemplateSource(i18nTemplate.getKey()) == null) { + if (stringTemplateLoader.findTemplateSource(i18NError.getKey()) == null) { final Properties properties = new Properties(); - try (final StringReader stringReader = new StringReader(IOUtils.resourceToString(i18nTemplate.getResourceName(), + try (final StringReader stringReader = new StringReader(IOUtils.resourceToString(i18NError.getResourceName(), StandardCharsets.UTF_8))) { properties.load(stringReader); } @@ -91,19 +91,19 @@ private Configuration createConfiguration(final @NotNull Locale locale) { } } } - final Template template = configuration.getTemplate(i18nTemplate.getKey()); + final Template template = configuration.getTemplate(i18NError.getKey()); try (final StringWriter stringWriter = new StringWriter()) { template.process(map, stringWriter); return stringWriter.toString(); } } catch (final TemplateException e) { final String errorMessage = - "Error: Template " + i18nTemplate.getKey() + " for " + locale + " could not be processed."; + "Error: Template " + i18NError.getKey() + " for " + locale + " could not be processed."; logger.error(errorMessage); return errorMessage; } catch (final IOException e) { final String errorMessage = - "Error: Template " + i18nTemplate.getKey() + " for " + locale + " could not be loaded."; + "Error: Template " + i18NError.getKey() + " for " + locale + " could not be loaded."; logger.error(errorMessage); return errorMessage; } diff --git a/hivemq-edge/src/main/java/com/hivemq/common/i18n/OpenAPIHttpError.java b/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nHttpError.java similarity index 89% rename from hivemq-edge/src/main/java/com/hivemq/common/i18n/OpenAPIHttpError.java rename to hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nHttpError.java index 03a50a8034..273d478458 100644 --- a/hivemq-edge/src/main/java/com/hivemq/common/i18n/OpenAPIHttpError.java +++ b/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nHttpError.java @@ -20,7 +20,7 @@ import java.util.Map; -public enum OpenAPIHttpError implements I18nTemplate { +public enum I18nHttpError implements I18nError { HTTP_ERROR_400_INVALID_QUERY_PARAMETER_DETAIL, HTTP_ERROR_400_INVALID_QUERY_PARAMETER_TITLE, HTTP_ERROR_400_REQUEST_BODY_MISSING_DETAIL, @@ -44,7 +44,7 @@ public enum OpenAPIHttpError implements I18nTemplate { private static final @NotNull String RESOURCE_NAME_PREFIX = "/templates/openapi-errors-"; private static final @NotNull String RESOURCE_NAME_SUFFIX = ".properties"; - OpenAPIHttpError() { + I18nHttpError() { } public @NotNull String get() { @@ -52,7 +52,7 @@ public enum OpenAPIHttpError implements I18nTemplate { } public @NotNull String get(final @NotNull Map map) { - return OpenAPIErrorTemplate.getInstance().get(this, map); + return I18nErrorTemplate.getInstance().get(this, map); } @Override @@ -67,6 +67,6 @@ public enum OpenAPIHttpError implements I18nTemplate { @Override public @NotNull String getResourceName() { - return RESOURCE_NAME_PREFIX + LocaleContext.getLocale() + RESOURCE_NAME_SUFFIX; + return RESOURCE_NAME_PREFIX + I18nLocaleContext.getLocale() + RESOURCE_NAME_SUFFIX; } } diff --git a/hivemq-edge/src/main/java/com/hivemq/common/i18n/LocaleContext.java b/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nLocaleContext.java similarity index 96% rename from hivemq-edge/src/main/java/com/hivemq/common/i18n/LocaleContext.java rename to hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nLocaleContext.java index 3e03e07776..f52258e378 100644 --- a/hivemq-edge/src/main/java/com/hivemq/common/i18n/LocaleContext.java +++ b/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nLocaleContext.java @@ -21,7 +21,7 @@ import java.util.Locale; -public final class LocaleContext { +public final class I18nLocaleContext { public static @NotNull Locale DEFAULT_LOCALE = Locale.US; private static final ThreadLocal THREAD_LOCAL_LOCALE = ThreadLocal.withInitial(() -> DEFAULT_LOCALE); diff --git a/hivemq-edge/src/test/java/com/hivemq/common/i18n/OpenAPIErrorTemplateTest.java b/hivemq-edge/src/test/java/com/hivemq/common/i18n/I18nErrorTemplateTest.java similarity index 82% rename from hivemq-edge/src/test/java/com/hivemq/common/i18n/OpenAPIErrorTemplateTest.java rename to hivemq-edge/src/test/java/com/hivemq/common/i18n/I18nErrorTemplateTest.java index 049cb3b0b5..fcd5f3ac4b 100644 --- a/hivemq-edge/src/test/java/com/hivemq/common/i18n/OpenAPIErrorTemplateTest.java +++ b/hivemq-edge/src/test/java/com/hivemq/common/i18n/I18nErrorTemplateTest.java @@ -21,10 +21,10 @@ import static org.assertj.core.api.Assertions.assertThat; -public class OpenAPIErrorTemplateTest { +public class I18nErrorTemplateTest { @Test public void whenLocaleIsNull_thenUseDefaultLocale() { - LocaleContext.setLocale(null); - assertThat(LocaleContext.getLocale()).isEqualTo(LocaleContext.DEFAULT_LOCALE); + I18nLocaleContext.setLocale(null); + assertThat(I18nLocaleContext.getLocale()).isEqualTo(I18nLocaleContext.DEFAULT_LOCALE); } } diff --git a/hivemq-edge/src/test/java/com/hivemq/common/i18n/OpenAPIHttpErrorTest.java b/hivemq-edge/src/test/java/com/hivemq/common/i18n/I18nHttpErrorTest.java similarity index 59% rename from hivemq-edge/src/test/java/com/hivemq/common/i18n/OpenAPIHttpErrorTest.java rename to hivemq-edge/src/test/java/com/hivemq/common/i18n/I18nHttpErrorTest.java index 54e6c59bde..5683808937 100644 --- a/hivemq-edge/src/test/java/com/hivemq/common/i18n/OpenAPIHttpErrorTest.java +++ b/hivemq-edge/src/test/java/com/hivemq/common/i18n/I18nHttpErrorTest.java @@ -30,24 +30,26 @@ import java.util.Map; import java.util.Properties; import java.util.Set; +import java.util.stream.Collectors; import static org.assertj.core.api.Assertions.assertThat; -public class OpenAPIHttpErrorTest { +public class I18nHttpErrorTest { @BeforeEach public void setUp() { - LocaleContext.setLocale(Locale.US); + I18nLocaleContext.setLocale(Locale.US); } @AfterEach public void tearDown() { - LocaleContext.setLocale(LocaleContext.DEFAULT_LOCALE); + I18nLocaleContext.setLocale(I18nLocaleContext.DEFAULT_LOCALE); } @Test public void whenLocaleIsEnUS_thenErrorCountShouldMatch() throws IOException { - final List errors = Arrays.asList(OpenAPIHttpError.values()); + final List errors = Arrays.asList(I18nHttpError.values()); assertThat(errors.size()).isGreaterThan(0); + assertThat(errors.stream().map(I18nHttpError::getResourceName).collect(Collectors.toSet())).hasSize(1); final Properties properties = new Properties(); try (final StringReader stringReader = new StringReader(IOUtils.resourceToString(errors.get(0) .getResourceName(), StandardCharsets.UTF_8))) { @@ -65,65 +67,65 @@ public void whenLocaleIsEnUS_thenErrorCountShouldMatch() throws IOException { @Test public void whenLocaleIsEnUS_thenHttpError400ShouldWork() { - assertThat(OpenAPIHttpError.HTTP_ERROR_400_INVALID_QUERY_PARAMETER_TITLE.get()).isEqualTo( + assertThat(I18nHttpError.HTTP_ERROR_400_INVALID_QUERY_PARAMETER_TITLE.get()).isEqualTo( "Query Parameter is Invalid"); - assertThat(OpenAPIHttpError.HTTP_ERROR_400_INVALID_QUERY_PARAMETER_DETAIL.get(Map.of("parameter", + assertThat(I18nHttpError.HTTP_ERROR_400_INVALID_QUERY_PARAMETER_DETAIL.get(Map.of("parameter", "p1", "reason", "test."))).isEqualTo("Query parameter 'p1' is invalid: test."); - assertThat(OpenAPIHttpError.HTTP_ERROR_400_REQUEST_BODY_MISSING_TITLE.get()).isEqualTo( + assertThat(I18nHttpError.HTTP_ERROR_400_REQUEST_BODY_MISSING_TITLE.get()).isEqualTo( "Required Request Body Missing"); - assertThat(OpenAPIHttpError.HTTP_ERROR_400_REQUEST_BODY_MISSING_DETAIL.get()).isEqualTo( + assertThat(I18nHttpError.HTTP_ERROR_400_REQUEST_BODY_MISSING_DETAIL.get()).isEqualTo( "Required request body is missing."); - assertThat(OpenAPIHttpError.HTTP_ERROR_400_REQUEST_BODY_PARAMETER_MISSING_TITLE.get()).isEqualTo( + assertThat(I18nHttpError.HTTP_ERROR_400_REQUEST_BODY_PARAMETER_MISSING_TITLE.get()).isEqualTo( "Required Request Body Parameter Missing"); - assertThat(OpenAPIHttpError.HTTP_ERROR_400_REQUEST_BODY_PARAMETER_MISSING_DETAIL.get(Map.of("parameter", + assertThat(I18nHttpError.HTTP_ERROR_400_REQUEST_BODY_PARAMETER_MISSING_DETAIL.get(Map.of("parameter", "p1"))).isEqualTo("Required request body parameter 'p1' is missing."); - assertThat(OpenAPIHttpError.HTTP_ERROR_400_URL_PARAMETER_MISSING_TITLE.get()).isEqualTo( + assertThat(I18nHttpError.HTTP_ERROR_400_URL_PARAMETER_MISSING_TITLE.get()).isEqualTo( "Required URL Parameter Missing"); - assertThat(OpenAPIHttpError.HTTP_ERROR_400_URL_PARAMETER_MISSING_DETAIL.get(Map.of("parameter", - "p1"))).isEqualTo("Required URL parameter 'p1' is missing."); + assertThat(I18nHttpError.HTTP_ERROR_400_URL_PARAMETER_MISSING_DETAIL.get(Map.of("parameter", "p1"))).isEqualTo( + "Required URL parameter 'p1' is missing."); } @Test public void whenLocaleIsEnUS_thenHttpError412ShouldWork() { - assertThat(OpenAPIHttpError.HTTP_ERROR_412_TITLE.get()).isEqualTo("Precondition Failed"); - assertThat(OpenAPIHttpError.HTTP_ERROR_412_DETAIL.get(Map.of("reason", "test."))).isEqualTo( + assertThat(I18nHttpError.HTTP_ERROR_412_TITLE.get()).isEqualTo("Precondition Failed"); + assertThat(I18nHttpError.HTTP_ERROR_412_DETAIL.get(Map.of("reason", "test."))).isEqualTo( "A precondition required for fulfilling the request was not fulfilled: test."); } @Test public void whenLocaleIsEnUS_thenHttpError500ShouldWork() { - assertThat(OpenAPIHttpError.HTTP_ERROR_500_TITLE.get()).isEqualTo("Internal Server Error"); - assertThat(OpenAPIHttpError.HTTP_ERROR_500_DETAIL_DEFAULT.get()).isEqualTo( + assertThat(I18nHttpError.HTTP_ERROR_500_TITLE.get()).isEqualTo("Internal Server Error"); + assertThat(I18nHttpError.HTTP_ERROR_500_DETAIL_DEFAULT.get()).isEqualTo( "An unexpected error occurred, check the logs."); - assertThat(OpenAPIHttpError.HTTP_ERROR_500_DETAIL_WITH_REASON.get(Map.of("reason", "test."))).isEqualTo( + assertThat(I18nHttpError.HTTP_ERROR_500_DETAIL_WITH_REASON.get(Map.of("reason", "test."))).isEqualTo( "An unexpected error occurred: test."); } @Test public void whenLocaleIsEnUS_thenHttpError503ShouldWork() { - assertThat(OpenAPIHttpError.HTTP_ERROR_503_TITLE.get()).isEqualTo("Endpoint Temporarily not Available"); - assertThat(OpenAPIHttpError.HTTP_ERROR_503_DETAIL.get()).isEqualTo( + assertThat(I18nHttpError.HTTP_ERROR_503_TITLE.get()).isEqualTo("Endpoint Temporarily not Available"); + assertThat(I18nHttpError.HTTP_ERROR_503_DETAIL.get()).isEqualTo( "The endpoint is temporarily not available, please try again later."); } @Test public void whenLocaleIsEnUS_thenHttpError507ShouldWork() { - assertThat(OpenAPIHttpError.HTTP_ERROR_507_TITLE.get()).isEqualTo("Insufficient Storage"); - assertThat(OpenAPIHttpError.HTTP_ERROR_507_DETAIL_DEFAULT.get()).isEqualTo("Insufficient Storage."); - assertThat(OpenAPIHttpError.HTTP_ERROR_507_DETAIL_WITH_REASON.get(Map.of("reason", "test."))).isEqualTo( + assertThat(I18nHttpError.HTTP_ERROR_507_TITLE.get()).isEqualTo("Insufficient Storage"); + assertThat(I18nHttpError.HTTP_ERROR_507_DETAIL_DEFAULT.get()).isEqualTo("Insufficient Storage."); + assertThat(I18nHttpError.HTTP_ERROR_507_DETAIL_WITH_REASON.get(Map.of("reason", "test."))).isEqualTo( "Insufficient Storage: test."); } @Test public void whenLocaleIsEnGB_thenHttpError500ShouldFail() { - LocaleContext.setLocale(Locale.UK); - assertThat(OpenAPIHttpError.HTTP_ERROR_500_TITLE.get()).isEqualTo( + I18nLocaleContext.setLocale(Locale.UK); + assertThat(I18nHttpError.HTTP_ERROR_500_TITLE.get()).isEqualTo( "Error: Template http.error.500.title for en_GB could not be loaded."); - assertThat(OpenAPIHttpError.HTTP_ERROR_500_DETAIL_DEFAULT.get()).isEqualTo( + assertThat(I18nHttpError.HTTP_ERROR_500_DETAIL_DEFAULT.get()).isEqualTo( "Error: Template http.error.500.detail.default for en_GB could not be loaded."); - assertThat(OpenAPIHttpError.HTTP_ERROR_500_DETAIL_WITH_REASON.get(Map.of("reason", "test."))).isEqualTo( + assertThat(I18nHttpError.HTTP_ERROR_500_DETAIL_WITH_REASON.get(Map.of("reason", "test."))).isEqualTo( "Error: Template http.error.500.detail.with.reason for en_GB could not be loaded."); } } From 75c6e4094b79a75da31a980b35075f4dcbb19d8b Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Wed, 9 Jul 2025 09:29:56 +0200 Subject: [PATCH 103/121] fix: Exclude .properties from license check --- hivemq-edge/build.gradle.kts | 1 + .../com/hivemq/common/i18n/I18nHttpErrorTest.java | 14 +++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/hivemq-edge/build.gradle.kts b/hivemq-edge/build.gradle.kts index 79ca0eb7ce..1d85c68473 100644 --- a/hivemq-edge/build.gradle.kts +++ b/hivemq-edge/build.gradle.kts @@ -440,6 +440,7 @@ license { header = file("HEADER") mapping("java", "SLASHSTAR_STYLE") exclude("*.json") + exclude("**/*.properties") exclude("**/*.xml") exclude("**/RollingList.java") exclude("**/api/**/*.java") diff --git a/hivemq-edge/src/test/java/com/hivemq/common/i18n/I18nHttpErrorTest.java b/hivemq-edge/src/test/java/com/hivemq/common/i18n/I18nHttpErrorTest.java index 5683808937..a81fb0a1d1 100644 --- a/hivemq-edge/src/test/java/com/hivemq/common/i18n/I18nHttpErrorTest.java +++ b/hivemq-edge/src/test/java/com/hivemq/common/i18n/I18nHttpErrorTest.java @@ -55,14 +55,14 @@ public void whenLocaleIsEnUS_thenErrorCountShouldMatch() throws IOException { .getResourceName(), StandardCharsets.UTF_8))) { properties.load(stringReader); } - assertThat(properties.size()).isEqualTo(errors.size()); - final Set keySet = properties.keySet(); - errors.forEach(error -> assertThat(keySet.contains(error.getKey())).as(error.getKey() + " is not found.") - .isTrue()); - properties.values().forEach(template -> { - assertThat(template).isInstanceOf(String.class); - assertThat((String) template).isNotBlank(); + final Set propertyKeySet = properties.keySet(); + final Set errorKeySet = errors.stream().map(I18nHttpError::getKey).collect(Collectors.toSet()); + propertyKeySet.forEach(key -> { + assertThat(key).isInstanceOf(String.class); + assertThat(errorKeySet.contains((String) key)).as(key + " is not found in the enum.").isTrue(); }); + errorKeySet.forEach(key -> assertThat(propertyKeySet.contains(key)).as(key + " is not found in the properties.") + .isTrue()); } @Test From 526f4cac707594d90fd77ba4fbf498b43855998f Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Wed, 9 Jul 2025 13:55:04 +0200 Subject: [PATCH 104/121] refactor: Rename to http-errors-en_US.properties --- .../src/main/java/com/hivemq/common/i18n/I18nHttpError.java | 2 +- ...api-errors-en_US.properties => http-errors-en_US.properties} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename hivemq-edge/src/main/resources/templates/{openapi-errors-en_US.properties => http-errors-en_US.properties} (100%) diff --git a/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nHttpError.java b/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nHttpError.java index 273d478458..18077ecae9 100644 --- a/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nHttpError.java +++ b/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nHttpError.java @@ -41,7 +41,7 @@ public enum I18nHttpError implements I18nError { HTTP_ERROR_507_TITLE, ; - private static final @NotNull String RESOURCE_NAME_PREFIX = "/templates/openapi-errors-"; + private static final @NotNull String RESOURCE_NAME_PREFIX = "/templates/http-errors-"; private static final @NotNull String RESOURCE_NAME_SUFFIX = ".properties"; I18nHttpError() { diff --git a/hivemq-edge/src/main/resources/templates/openapi-errors-en_US.properties b/hivemq-edge/src/main/resources/templates/http-errors-en_US.properties similarity index 100% rename from hivemq-edge/src/main/resources/templates/openapi-errors-en_US.properties rename to hivemq-edge/src/main/resources/templates/http-errors-en_US.properties From 43942868dd51c678976748dd91677a6031f7478b Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Wed, 9 Jul 2025 14:41:17 +0200 Subject: [PATCH 105/121] refactor: Log stack trace in the error log --- .../main/java/com/hivemq/common/i18n/I18nErrorTemplate.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nErrorTemplate.java b/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nErrorTemplate.java index b51d458a6d..81c3917159 100644 --- a/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nErrorTemplate.java +++ b/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nErrorTemplate.java @@ -99,12 +99,12 @@ private Configuration createConfiguration(final @NotNull Locale locale) { } catch (final TemplateException e) { final String errorMessage = "Error: Template " + i18NError.getKey() + " for " + locale + " could not be processed."; - logger.error(errorMessage); + logger.error(errorMessage, e); return errorMessage; } catch (final IOException e) { final String errorMessage = "Error: Template " + i18NError.getKey() + " for " + locale + " could not be loaded."; - logger.error(errorMessage); + logger.error(errorMessage, e); return errorMessage; } } From 6289d58eaa83657d9b284866385bff3c825f7d87 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Wed, 9 Jul 2025 15:17:06 +0200 Subject: [PATCH 106/121] refactor: Revise the i18n error template to be thread-safe --- .../com/hivemq/common/i18n/I18nError.java | 2 - .../hivemq/common/i18n/I18nErrorTemplate.java | 57 ++++++++----------- .../com/hivemq/common/i18n/I18nHttpError.java | 9 +-- .../hivemq/common/i18n/I18nHttpErrorTest.java | 6 +- 4 files changed, 31 insertions(+), 43 deletions(-) diff --git a/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nError.java b/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nError.java index 33e5f6ffc6..129f8f03d6 100644 --- a/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nError.java +++ b/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nError.java @@ -22,6 +22,4 @@ public interface I18nError { @NotNull String getKey(); @NotNull String getName(); - - @NotNull String getResourceName(); } diff --git a/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nErrorTemplate.java b/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nErrorTemplate.java index 81c3917159..16b53da417 100644 --- a/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nErrorTemplate.java +++ b/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nErrorTemplate.java @@ -33,6 +33,7 @@ import java.util.Map; import java.util.Properties; import java.util.concurrent.ConcurrentHashMap; +import java.util.function.Function; /** * Singleton class to manage OpenAPI i18n error templates using FreeMarker. @@ -41,27 +42,30 @@ * This class is thread-safe and uses a cache to store configurations for different locales. */ public final class I18nErrorTemplate { - - private static final I18nErrorTemplate INSTANCE = new I18nErrorTemplate(); - + private static final @NotNull Logger LOGGER = LoggerFactory.getLogger(I18nErrorTemplate.class); private final @NotNull Map configurationMap; - private final @NotNull Logger logger; + private final @NotNull Function resourceNameFunction; - private I18nErrorTemplate() { + public I18nErrorTemplate(final @NotNull Function resourceNameFunction) { configurationMap = new ConcurrentHashMap<>(); - logger = LoggerFactory.getLogger(getClass()); + this.resourceNameFunction = resourceNameFunction; } - public static @NotNull I18nErrorTemplate getInstance() { - return INSTANCE; - } - - private Configuration createConfiguration(final @NotNull Locale locale) { + private Configuration createConfiguration(final @NotNull Locale locale) throws IOException { final Configuration configuration = new Configuration(Configuration.VERSION_2_3_34); - configuration.setDefaultEncoding(StandardCharsets.UTF_8.name()); final StringTemplateLoader stringTemplateLoader = new StringTemplateLoader(); + configuration.setDefaultEncoding(StandardCharsets.UTF_8.name()); configuration.setTemplateLoader(stringTemplateLoader); configuration.setLocale(locale); + final Properties properties = new Properties(); + final String resourceName = resourceNameFunction.apply(locale); + try (final StringReader stringReader = new StringReader(IOUtils.resourceToString(resourceName, + StandardCharsets.UTF_8))) { + properties.load(stringReader); + } + for (final Map.Entry entry : properties.entrySet()) { + stringTemplateLoader.putTemplate(String.valueOf(entry.getKey()), String.valueOf(entry.getValue())); + } return configuration; } @@ -71,25 +75,14 @@ private Configuration createConfiguration(final @NotNull Locale locale) { public @NotNull String get(final @NotNull I18nError i18NError, final @NotNull Map map) { final Locale locale = I18nLocaleContext.getLocale(); - Configuration configuration = configurationMap.get(locale.toString()); - if (configuration == null) { - configuration = createConfiguration(locale); - configurationMap.put(locale.toString(), configuration); - } try { - final StringTemplateLoader stringTemplateLoader = (StringTemplateLoader) configuration.getTemplateLoader(); - if (stringTemplateLoader.findTemplateSource(i18NError.getKey()) == null) { - final Properties properties = new Properties(); - try (final StringReader stringReader = new StringReader(IOUtils.resourceToString(i18NError.getResourceName(), - StandardCharsets.UTF_8))) { - properties.load(stringReader); - } - synchronized (configuration) { - for (final Map.Entry entry : properties.entrySet()) { - stringTemplateLoader.putTemplate(String.valueOf(entry.getKey()), - String.valueOf(entry.getValue())); - } - } + Configuration configuration = configurationMap.get(locale.toString()); + if (configuration == null) { + // The whole configuration creation process is not thread-safe, but creating a new configuration + // multiple times among concurrent threads brings no harm. + // So, we don't use a lock here to improve the overall performance. + configuration = createConfiguration(locale); + configurationMap.put(locale.toString(), configuration); } final Template template = configuration.getTemplate(i18NError.getKey()); try (final StringWriter stringWriter = new StringWriter()) { @@ -99,12 +92,12 @@ private Configuration createConfiguration(final @NotNull Locale locale) { } catch (final TemplateException e) { final String errorMessage = "Error: Template " + i18NError.getKey() + " for " + locale + " could not be processed."; - logger.error(errorMessage, e); + LOGGER.error(errorMessage, e); return errorMessage; } catch (final IOException e) { final String errorMessage = "Error: Template " + i18NError.getKey() + " for " + locale + " could not be loaded."; - logger.error(errorMessage, e); + LOGGER.error(errorMessage, e); return errorMessage; } } diff --git a/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nHttpError.java b/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nHttpError.java index 18077ecae9..cebd2c0b7e 100644 --- a/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nHttpError.java +++ b/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nHttpError.java @@ -43,6 +43,8 @@ public enum I18nHttpError implements I18nError { private static final @NotNull String RESOURCE_NAME_PREFIX = "/templates/http-errors-"; private static final @NotNull String RESOURCE_NAME_SUFFIX = ".properties"; + private static final I18nErrorTemplate TEMPLATE = + new I18nErrorTemplate(locale -> RESOURCE_NAME_PREFIX + locale + RESOURCE_NAME_SUFFIX); I18nHttpError() { } @@ -52,7 +54,7 @@ public enum I18nHttpError implements I18nError { } public @NotNull String get(final @NotNull Map map) { - return I18nErrorTemplate.getInstance().get(this, map); + return TEMPLATE.get(this, map); } @Override @@ -64,9 +66,4 @@ public enum I18nHttpError implements I18nError { public @NotNull String getName() { return name(); } - - @Override - public @NotNull String getResourceName() { - return RESOURCE_NAME_PREFIX + I18nLocaleContext.getLocale() + RESOURCE_NAME_SUFFIX; - } } diff --git a/hivemq-edge/src/test/java/com/hivemq/common/i18n/I18nHttpErrorTest.java b/hivemq-edge/src/test/java/com/hivemq/common/i18n/I18nHttpErrorTest.java index a81fb0a1d1..973459fa3b 100644 --- a/hivemq-edge/src/test/java/com/hivemq/common/i18n/I18nHttpErrorTest.java +++ b/hivemq-edge/src/test/java/com/hivemq/common/i18n/I18nHttpErrorTest.java @@ -49,10 +49,10 @@ public void tearDown() { public void whenLocaleIsEnUS_thenErrorCountShouldMatch() throws IOException { final List errors = Arrays.asList(I18nHttpError.values()); assertThat(errors.size()).isGreaterThan(0); - assertThat(errors.stream().map(I18nHttpError::getResourceName).collect(Collectors.toSet())).hasSize(1); final Properties properties = new Properties(); - try (final StringReader stringReader = new StringReader(IOUtils.resourceToString(errors.get(0) - .getResourceName(), StandardCharsets.UTF_8))) { + try (final StringReader stringReader = new StringReader(IOUtils.resourceToString( + "/templates/http-errors-en_US.properties", + StandardCharsets.UTF_8))) { properties.load(stringReader); } final Set propertyKeySet = properties.keySet(); From 43522e2a1033a53ae4574c585e403271adfdfceb Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Wed, 9 Jul 2025 15:20:39 +0200 Subject: [PATCH 107/121] refactor: Revise error enum key generation --- .../src/main/java/com/hivemq/common/i18n/I18nError.java | 6 ++++++ .../main/java/com/hivemq/common/i18n/I18nHttpError.java | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nError.java b/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nError.java index 129f8f03d6..3f859a61b9 100644 --- a/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nError.java +++ b/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nError.java @@ -18,7 +18,13 @@ import org.jetbrains.annotations.NotNull; +import java.util.Map; + public interface I18nError { + @NotNull String get(); + + @NotNull String get(final @NotNull Map map); + @NotNull String getKey(); @NotNull String getName(); diff --git a/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nHttpError.java b/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nHttpError.java index cebd2c0b7e..c663f02283 100644 --- a/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nHttpError.java +++ b/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nHttpError.java @@ -45,21 +45,26 @@ public enum I18nHttpError implements I18nError { private static final @NotNull String RESOURCE_NAME_SUFFIX = ".properties"; private static final I18nErrorTemplate TEMPLATE = new I18nErrorTemplate(locale -> RESOURCE_NAME_PREFIX + locale + RESOURCE_NAME_SUFFIX); + + private final @NotNull String key; I18nHttpError() { + key = name().toLowerCase().replace("_", "."); } + @Override public @NotNull String get() { return get(Map.of()); } + @Override public @NotNull String get(final @NotNull Map map) { return TEMPLATE.get(this, map); } @Override public @NotNull String getKey() { - return name().toLowerCase().replace("_", "."); + return key; } @Override From c12bdebf150ca15ad47453ef126bfe90eb1af795 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Wed, 9 Jul 2025 17:15:08 +0200 Subject: [PATCH 108/121] refactor: Move get() to I18nError --- .../src/main/java/com/hivemq/common/i18n/I18nError.java | 4 +++- .../main/java/com/hivemq/common/i18n/I18nHttpError.java | 7 +------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nError.java b/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nError.java index 3f859a61b9..a3f755a175 100644 --- a/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nError.java +++ b/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nError.java @@ -21,7 +21,9 @@ import java.util.Map; public interface I18nError { - @NotNull String get(); + default @NotNull String get() { + return get(Map.of()); + } @NotNull String get(final @NotNull Map map); diff --git a/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nHttpError.java b/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nHttpError.java index c663f02283..485e124b34 100644 --- a/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nHttpError.java +++ b/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nHttpError.java @@ -45,18 +45,13 @@ public enum I18nHttpError implements I18nError { private static final @NotNull String RESOURCE_NAME_SUFFIX = ".properties"; private static final I18nErrorTemplate TEMPLATE = new I18nErrorTemplate(locale -> RESOURCE_NAME_PREFIX + locale + RESOURCE_NAME_SUFFIX); - + private final @NotNull String key; I18nHttpError() { key = name().toLowerCase().replace("_", "."); } - @Override - public @NotNull String get() { - return get(Map.of()); - } - @Override public @NotNull String get(final @NotNull Map map) { return TEMPLATE.get(this, map); From bea11bb964cf3b8a2c8befdd6a3368ab4b17df5e Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Fri, 11 Jul 2025 08:55:46 +0200 Subject: [PATCH 109/121] refactor: Rename some errors to be more specific --- .../hivemq/api/errors/HttpErrorFactory.java | 12 +++++------ .../com/hivemq/common/i18n/I18nHttpError.java | 12 +++++------ .../templates/http-errors-en_US.properties | 12 +++++------ .../hivemq/common/i18n/I18nHttpErrorTest.java | 21 ++++++++++--------- 4 files changed, 29 insertions(+), 28 deletions(-) diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java index 8be2d7ef1f..81bee57491 100644 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/HttpErrorFactory.java @@ -43,7 +43,7 @@ private HttpErrorFactory() { .type(type(InsufficientStorageError.class)) .title(I18nHttpError.HTTP_ERROR_507_TITLE.get()) .detail(reason == null ? - I18nHttpError.HTTP_ERROR_507_DETAIL_DEFAULT.get() : + I18nHttpError.HTTP_ERROR_507_DETAIL.get() : I18nHttpError.HTTP_ERROR_507_DETAIL_WITH_REASON.get(Map.of("reason", reason))) .status(HttpStatus.INSUFFICIENT_STORAGE_507) .build(); @@ -58,7 +58,7 @@ private HttpErrorFactory() { .type(type(InternalServerError.class)) .title(I18nHttpError.HTTP_ERROR_500_TITLE.get()) .detail(reason == null ? - I18nHttpError.HTTP_ERROR_500_DETAIL_DEFAULT.get() : + I18nHttpError.HTTP_ERROR_500_DETAIL.get() : I18nHttpError.HTTP_ERROR_500_DETAIL_WITH_REASON.get(Map.of("reason", reason))) .status(HttpStatus.INTERNAL_SERVER_ERROR_500) .build(); @@ -70,7 +70,7 @@ private HttpErrorFactory() { return InvalidQueryParameterError.builder() .type(type(InvalidQueryParameterError.class)) .title(I18nHttpError.HTTP_ERROR_400_INVALID_QUERY_PARAMETER_TITLE.get()) - .detail(I18nHttpError.HTTP_ERROR_400_INVALID_QUERY_PARAMETER_DETAIL.get(Map.of( + .detail(I18nHttpError.HTTP_ERROR_400_INVALID_QUERY_PARAMETER_DETAIL_WITH_PARAMETER_AND_REASON.get(Map.of( "parameter", parameter, "reason", reason))) .parameter(parameter) @@ -83,7 +83,7 @@ private HttpErrorFactory() { return PreconditionFailedError.builder() .type(type(PreconditionFailedError.class)) .title(I18nHttpError.HTTP_ERROR_412_TITLE.get()) - .detail(I18nHttpError.HTTP_ERROR_412_DETAIL.get(Map.of("reason", reason))) + .detail(I18nHttpError.HTTP_ERROR_412_DETAIL_WITH_REASON.get(Map.of("reason", reason))) .status(HttpStatus.PRECONDITION_FAILED_412) .build(); } @@ -101,7 +101,7 @@ private HttpErrorFactory() { return RequestBodyParameterMissingError.builder() .type(type(RequestBodyParameterMissingError.class)) .title(I18nHttpError.HTTP_ERROR_400_REQUEST_BODY_PARAMETER_MISSING_TITLE.get()) - .detail(I18nHttpError.HTTP_ERROR_400_REQUEST_BODY_PARAMETER_MISSING_DETAIL.get(Map.of("parameter", parameter))) + .detail(I18nHttpError.HTTP_ERROR_400_REQUEST_BODY_PARAMETER_MISSING_DETAIL_WITH_PARAMETER.get(Map.of("parameter", parameter))) .parameter(parameter) .status(HttpStatus.BAD_REQUEST_400) .build(); @@ -120,7 +120,7 @@ private HttpErrorFactory() { return UrlParameterMissingError.builder() .type(type(UrlParameterMissingError.class)) .title(I18nHttpError.HTTP_ERROR_400_URL_PARAMETER_MISSING_TITLE.get()) - .detail(I18nHttpError.HTTP_ERROR_400_URL_PARAMETER_MISSING_DETAIL.get(Map.of("parameter", parameter))) + .detail(I18nHttpError.HTTP_ERROR_400_URL_PARAMETER_MISSING_DETAIL_WITH_PARAMETER.get(Map.of("parameter", parameter))) .parameter(parameter) .status(HttpStatus.BAD_REQUEST_400) .build(); diff --git a/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nHttpError.java b/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nHttpError.java index 485e124b34..e46360dc86 100644 --- a/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nHttpError.java +++ b/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nHttpError.java @@ -21,22 +21,22 @@ import java.util.Map; public enum I18nHttpError implements I18nError { - HTTP_ERROR_400_INVALID_QUERY_PARAMETER_DETAIL, + HTTP_ERROR_400_INVALID_QUERY_PARAMETER_DETAIL_WITH_PARAMETER_AND_REASON, HTTP_ERROR_400_INVALID_QUERY_PARAMETER_TITLE, HTTP_ERROR_400_REQUEST_BODY_MISSING_DETAIL, HTTP_ERROR_400_REQUEST_BODY_MISSING_TITLE, - HTTP_ERROR_400_REQUEST_BODY_PARAMETER_MISSING_DETAIL, + HTTP_ERROR_400_REQUEST_BODY_PARAMETER_MISSING_DETAIL_WITH_PARAMETER, HTTP_ERROR_400_REQUEST_BODY_PARAMETER_MISSING_TITLE, - HTTP_ERROR_400_URL_PARAMETER_MISSING_DETAIL, + HTTP_ERROR_400_URL_PARAMETER_MISSING_DETAIL_WITH_PARAMETER, HTTP_ERROR_400_URL_PARAMETER_MISSING_TITLE, - HTTP_ERROR_412_DETAIL, + HTTP_ERROR_412_DETAIL_WITH_REASON, HTTP_ERROR_412_TITLE, - HTTP_ERROR_500_DETAIL_DEFAULT, + HTTP_ERROR_500_DETAIL, HTTP_ERROR_500_DETAIL_WITH_REASON, HTTP_ERROR_500_TITLE, HTTP_ERROR_503_DETAIL, HTTP_ERROR_503_TITLE, - HTTP_ERROR_507_DETAIL_DEFAULT, + HTTP_ERROR_507_DETAIL, HTTP_ERROR_507_DETAIL_WITH_REASON, HTTP_ERROR_507_TITLE, ; diff --git a/hivemq-edge/src/main/resources/templates/http-errors-en_US.properties b/hivemq-edge/src/main/resources/templates/http-errors-en_US.properties index ecc7712c16..b5ec3c5a00 100644 --- a/hivemq-edge/src/main/resources/templates/http-errors-en_US.properties +++ b/hivemq-edge/src/main/resources/templates/http-errors-en_US.properties @@ -1,18 +1,18 @@ -http.error.400.invalid.query.parameter.detail=Query parameter '${parameter}' is invalid: ${reason} +http.error.400.invalid.query.parameter.detail.with.parameter.and.reason=Query parameter '${parameter}' is invalid: ${reason} http.error.400.invalid.query.parameter.title=Query Parameter is Invalid http.error.400.request.body.missing.detail=Required request body is missing. http.error.400.request.body.missing.title=Required Request Body Missing -http.error.400.request.body.parameter.missing.detail=Required request body parameter '${parameter}' is missing. +http.error.400.request.body.parameter.missing.detail.with.parameter=Required request body parameter '${parameter}' is missing. http.error.400.request.body.parameter.missing.title=Required Request Body Parameter Missing -http.error.400.url.parameter.missing.detail=Required URL parameter '${parameter}' is missing. +http.error.400.url.parameter.missing.detail.with.parameter=Required URL parameter '${parameter}' is missing. http.error.400.url.parameter.missing.title=Required URL Parameter Missing -http.error.412.detail=A precondition required for fulfilling the request was not fulfilled: ${reason} +http.error.412.detail.with.reason=A precondition required for fulfilling the request was not fulfilled: ${reason} http.error.412.title=Precondition Failed -http.error.500.detail.default=An unexpected error occurred, check the logs. +http.error.500.detail=An unexpected error occurred, check the logs. http.error.500.detail.with.reason=An unexpected error occurred: ${reason} http.error.500.title=Internal Server Error http.error.503.detail=The endpoint is temporarily not available, please try again later. http.error.503.title=Endpoint Temporarily not Available -http.error.507.detail.default=Insufficient Storage. +http.error.507.detail=Insufficient Storage. http.error.507.detail.with.reason=Insufficient Storage: ${reason} http.error.507.title=Insufficient Storage diff --git a/hivemq-edge/src/test/java/com/hivemq/common/i18n/I18nHttpErrorTest.java b/hivemq-edge/src/test/java/com/hivemq/common/i18n/I18nHttpErrorTest.java index 973459fa3b..821f815a87 100644 --- a/hivemq-edge/src/test/java/com/hivemq/common/i18n/I18nHttpErrorTest.java +++ b/hivemq-edge/src/test/java/com/hivemq/common/i18n/I18nHttpErrorTest.java @@ -69,7 +69,8 @@ public void whenLocaleIsEnUS_thenErrorCountShouldMatch() throws IOException { public void whenLocaleIsEnUS_thenHttpError400ShouldWork() { assertThat(I18nHttpError.HTTP_ERROR_400_INVALID_QUERY_PARAMETER_TITLE.get()).isEqualTo( "Query Parameter is Invalid"); - assertThat(I18nHttpError.HTTP_ERROR_400_INVALID_QUERY_PARAMETER_DETAIL.get(Map.of("parameter", + assertThat(I18nHttpError.HTTP_ERROR_400_INVALID_QUERY_PARAMETER_DETAIL_WITH_PARAMETER_AND_REASON.get(Map.of( + "parameter", "p1", "reason", "test."))).isEqualTo("Query parameter 'p1' is invalid: test."); @@ -79,26 +80,26 @@ public void whenLocaleIsEnUS_thenHttpError400ShouldWork() { "Required request body is missing."); assertThat(I18nHttpError.HTTP_ERROR_400_REQUEST_BODY_PARAMETER_MISSING_TITLE.get()).isEqualTo( "Required Request Body Parameter Missing"); - assertThat(I18nHttpError.HTTP_ERROR_400_REQUEST_BODY_PARAMETER_MISSING_DETAIL.get(Map.of("parameter", + assertThat(I18nHttpError.HTTP_ERROR_400_REQUEST_BODY_PARAMETER_MISSING_DETAIL_WITH_PARAMETER.get(Map.of( + "parameter", "p1"))).isEqualTo("Required request body parameter 'p1' is missing."); assertThat(I18nHttpError.HTTP_ERROR_400_URL_PARAMETER_MISSING_TITLE.get()).isEqualTo( "Required URL Parameter Missing"); - assertThat(I18nHttpError.HTTP_ERROR_400_URL_PARAMETER_MISSING_DETAIL.get(Map.of("parameter", "p1"))).isEqualTo( - "Required URL parameter 'p1' is missing."); + assertThat(I18nHttpError.HTTP_ERROR_400_URL_PARAMETER_MISSING_DETAIL_WITH_PARAMETER.get(Map.of("parameter", + "p1"))).isEqualTo("Required URL parameter 'p1' is missing."); } @Test public void whenLocaleIsEnUS_thenHttpError412ShouldWork() { assertThat(I18nHttpError.HTTP_ERROR_412_TITLE.get()).isEqualTo("Precondition Failed"); - assertThat(I18nHttpError.HTTP_ERROR_412_DETAIL.get(Map.of("reason", "test."))).isEqualTo( + assertThat(I18nHttpError.HTTP_ERROR_412_DETAIL_WITH_REASON.get(Map.of("reason", "test."))).isEqualTo( "A precondition required for fulfilling the request was not fulfilled: test."); } @Test public void whenLocaleIsEnUS_thenHttpError500ShouldWork() { assertThat(I18nHttpError.HTTP_ERROR_500_TITLE.get()).isEqualTo("Internal Server Error"); - assertThat(I18nHttpError.HTTP_ERROR_500_DETAIL_DEFAULT.get()).isEqualTo( - "An unexpected error occurred, check the logs."); + assertThat(I18nHttpError.HTTP_ERROR_500_DETAIL.get()).isEqualTo("An unexpected error occurred, check the logs."); assertThat(I18nHttpError.HTTP_ERROR_500_DETAIL_WITH_REASON.get(Map.of("reason", "test."))).isEqualTo( "An unexpected error occurred: test."); } @@ -113,7 +114,7 @@ public void whenLocaleIsEnUS_thenHttpError503ShouldWork() { @Test public void whenLocaleIsEnUS_thenHttpError507ShouldWork() { assertThat(I18nHttpError.HTTP_ERROR_507_TITLE.get()).isEqualTo("Insufficient Storage"); - assertThat(I18nHttpError.HTTP_ERROR_507_DETAIL_DEFAULT.get()).isEqualTo("Insufficient Storage."); + assertThat(I18nHttpError.HTTP_ERROR_507_DETAIL.get()).isEqualTo("Insufficient Storage."); assertThat(I18nHttpError.HTTP_ERROR_507_DETAIL_WITH_REASON.get(Map.of("reason", "test."))).isEqualTo( "Insufficient Storage: test."); } @@ -123,8 +124,8 @@ public void whenLocaleIsEnGB_thenHttpError500ShouldFail() { I18nLocaleContext.setLocale(Locale.UK); assertThat(I18nHttpError.HTTP_ERROR_500_TITLE.get()).isEqualTo( "Error: Template http.error.500.title for en_GB could not be loaded."); - assertThat(I18nHttpError.HTTP_ERROR_500_DETAIL_DEFAULT.get()).isEqualTo( - "Error: Template http.error.500.detail.default for en_GB could not be loaded."); + assertThat(I18nHttpError.HTTP_ERROR_500_DETAIL.get()).isEqualTo( + "Error: Template http.error.500.detail for en_GB could not be loaded."); assertThat(I18nHttpError.HTTP_ERROR_500_DETAIL_WITH_REASON.get(Map.of("reason", "test."))).isEqualTo( "Error: Template http.error.500.detail.with.reason for en_GB could not be loaded."); } From 1f6ee4407a7e88940eca95585c87714b1c2451b3 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Mon, 21 Jul 2025 13:55:00 +0200 Subject: [PATCH 110/121] fix: Add classloader to i18n --- .../com/hivemq/common/i18n/I18nErrorTemplate.java | 8 ++++++-- .../java/com/hivemq/common/i18n/I18nHttpError.java | 7 ++++--- .../com/hivemq/common/i18n/I18nHttpErrorTest.java | 12 ++++-------- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nErrorTemplate.java b/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nErrorTemplate.java index 16b53da417..b9c69187ff 100644 --- a/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nErrorTemplate.java +++ b/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nErrorTemplate.java @@ -45,9 +45,13 @@ public final class I18nErrorTemplate { private static final @NotNull Logger LOGGER = LoggerFactory.getLogger(I18nErrorTemplate.class); private final @NotNull Map configurationMap; private final @NotNull Function resourceNameFunction; + private final @NotNull ClassLoader classLoader; - public I18nErrorTemplate(final @NotNull Function resourceNameFunction) { + public I18nErrorTemplate( + final @NotNull Function resourceNameFunction, + final @NotNull ClassLoader classLoader) { configurationMap = new ConcurrentHashMap<>(); + this.classLoader = classLoader; this.resourceNameFunction = resourceNameFunction; } @@ -60,7 +64,7 @@ private Configuration createConfiguration(final @NotNull Locale locale) throws I final Properties properties = new Properties(); final String resourceName = resourceNameFunction.apply(locale); try (final StringReader stringReader = new StringReader(IOUtils.resourceToString(resourceName, - StandardCharsets.UTF_8))) { + StandardCharsets.UTF_8, classLoader))) { properties.load(stringReader); } for (final Map.Entry entry : properties.entrySet()) { diff --git a/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nHttpError.java b/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nHttpError.java index e46360dc86..d65f71749c 100644 --- a/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nHttpError.java +++ b/hivemq-edge/src/main/java/com/hivemq/common/i18n/I18nHttpError.java @@ -41,10 +41,11 @@ public enum I18nHttpError implements I18nError { HTTP_ERROR_507_TITLE, ; - private static final @NotNull String RESOURCE_NAME_PREFIX = "/templates/http-errors-"; + private static final @NotNull String RESOURCE_NAME_PREFIX = "templates/http-errors-"; private static final @NotNull String RESOURCE_NAME_SUFFIX = ".properties"; - private static final I18nErrorTemplate TEMPLATE = - new I18nErrorTemplate(locale -> RESOURCE_NAME_PREFIX + locale + RESOURCE_NAME_SUFFIX); + private static final @NotNull I18nErrorTemplate TEMPLATE = + new I18nErrorTemplate(locale -> RESOURCE_NAME_PREFIX + locale + RESOURCE_NAME_SUFFIX, + I18nHttpError.class.getClassLoader()); private final @NotNull String key; diff --git a/hivemq-edge/src/test/java/com/hivemq/common/i18n/I18nHttpErrorTest.java b/hivemq-edge/src/test/java/com/hivemq/common/i18n/I18nHttpErrorTest.java index 821f815a87..41cd9378c1 100644 --- a/hivemq-edge/src/test/java/com/hivemq/common/i18n/I18nHttpErrorTest.java +++ b/hivemq-edge/src/test/java/com/hivemq/common/i18n/I18nHttpErrorTest.java @@ -24,12 +24,7 @@ import java.io.IOException; import java.io.StringReader; import java.nio.charset.StandardCharsets; -import java.util.Arrays; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Properties; -import java.util.Set; +import java.util.*; import java.util.stream.Collectors; import static org.assertj.core.api.Assertions.assertThat; @@ -51,8 +46,9 @@ public void whenLocaleIsEnUS_thenErrorCountShouldMatch() throws IOException { assertThat(errors.size()).isGreaterThan(0); final Properties properties = new Properties(); try (final StringReader stringReader = new StringReader(IOUtils.resourceToString( - "/templates/http-errors-en_US.properties", - StandardCharsets.UTF_8))) { + "templates/http-errors-en_US.properties", + StandardCharsets.UTF_8, + I18nHttpError.class.getClassLoader()))) { properties.load(stringReader); } final Set propertyKeySet = properties.keySet(); From 4be1985c8b36b13737a3cfcc5659a7dee5f5f52f Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Tue, 29 Jul 2025 09:03:03 +0200 Subject: [PATCH 111/121] refactor: Rename ApiError to ApiProblemDetails --- ext/hivemq-edge-openapi-2025.13.yaml | 1258 +++++++++++++++++ .../{ApiError.yaml => ApiProblemDetails.yaml} | 0 .../BehaviorPolicyAlreadyPresentError.yaml | 2 +- .../BehaviorPolicyCreationFailureError.yaml | 2 +- .../datahub/BehaviorPolicyInvalidErrors.yaml | 2 +- .../datahub/BehaviorPolicyNotFoundError.yaml | 2 +- .../datahub/BehaviorPolicyRejectedError.yaml | 2 +- .../BehaviorPolicyUpdateFailureError.yaml | 2 +- .../datahub/ClientDisconnectedError.yaml | 2 +- .../errors/datahub/ClientNotFoundError.yaml | 2 +- .../DataPolicyAlreadyPresentError.yaml | 2 +- .../DataPolicyCreationFailureError.yaml | 2 +- .../datahub/DataPolicyInvalidErrors.yaml | 2 +- .../datahub/DataPolicyNotFoundError.yaml | 2 +- .../datahub/DataPolicyRejectedError.yaml | 2 +- .../datahub/DataPolicyUpdateFailureError.yaml | 2 +- .../errors/datahub/PolicyIdMismatchError.yaml | 2 +- .../PolicyInsufficientStorageError.yaml | 2 +- .../errors/datahub/PolicyNotFoundError.yaml | 2 +- .../datahub/SchemaAlreadyPresentError.yaml | 2 +- .../datahub/SchemaEtagMismatchError.yaml | 2 +- .../SchemaInsufficientStorageError.yaml | 2 +- .../errors/datahub/SchemaInvalidErrors.yaml | 2 +- .../errors/datahub/SchemaNotFoundError.yaml | 2 +- .../datahub/SchemaParsingFailureError.yaml | 2 +- .../errors/datahub/SchemaReferencedError.yaml | 2 +- .../datahub/ScriptAlreadyPresentError.yaml | 2 +- .../datahub/ScriptCreationFailureError.yaml | 2 +- .../datahub/ScriptEtagMismatchError.yaml | 2 +- .../ScriptInsufficientStorageError.yaml | 2 +- .../errors/datahub/ScriptInvalidErrors.yaml | 2 +- .../errors/datahub/ScriptNotFoundError.yaml | 2 +- .../datahub/ScriptParsingFailureError.yaml | 2 +- .../errors/datahub/ScriptReferencedError.yaml | 2 +- .../datahub/ScriptSanitationFailureError.yaml | 2 +- .../datahub/TopicFilterMismatchError.yaml | 2 +- .../errors/http/InsufficientStorageError.yaml | 2 +- .../errors/http/InternalServerError.yaml | 2 +- .../http/InvalidQueryParameterError.yaml | 2 +- .../errors/http/PreconditionFailedError.yaml | 2 +- .../errors/http/RequestBodyMissingError.yaml | 2 +- .../RequestBodyParameterMissingError.yaml | 2 +- .../http/TemporaryNotAvailableError.yaml | 2 +- .../errors/http/UrlParameterMissingError.yaml | 2 +- .../com/hivemq/util/ErrorResponseUtil.java | 3 +- 45 files changed, 1302 insertions(+), 43 deletions(-) rename ext/openAPI/components/schemas/errors/{ApiError.yaml => ApiProblemDetails.yaml} (100%) diff --git a/ext/hivemq-edge-openapi-2025.13.yaml b/ext/hivemq-edge-openapi-2025.13.yaml index 15ded3481b..eca1d57d35 100644 --- a/ext/hivemq-edge-openapi-2025.13.yaml +++ b/ext/hivemq-edge-openapi-2025.13.yaml @@ -4674,6 +4674,1264 @@ components: description: List of result items that are returned by this endpoint items: $ref: '#/components/schemas/BehaviorPolicy' + ApiProblemDetails: + allOf: + - $ref: '#/components/schemas/ProblemDetails' + - type: object + required: + - detail + - status + - type + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/BehaviorPolicyAlreadyPresentError: '#/components/schemas/BehaviorPolicyAlreadyPresentError' + https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError: '#/components/schemas/BehaviorPolicyCreationFailureError' + https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors: '#/components/schemas/BehaviorPolicyInvalidErrors' + https://hivemq.com/edge/api/model/BehaviorPolicyNotFoundError: '#/components/schemas/BehaviorPolicyNotFoundError' + https://hivemq.com/edge/api/model/BehaviorPolicyRejectedError: '#/components/schemas/BehaviorPolicyRejectedError' + https://hivemq.com/edge/api/model/BehaviorPolicyUpdateFailureError: '#/components/schemas/BehaviorPolicyUpdateFailureError' + https://hivemq.com/edge/api/model/ClientDisconnectedError: '#/components/schemas/ClientDisconnectedError' + https://hivemq.com/edge/api/model/ClientNotFoundError: '#/components/schemas/ClientNotFoundError' + https://hivemq.com/edge/api/model/DataPolicyAlreadyPresentError: '#/components/schemas/DataPolicyAlreadyPresentError' + https://hivemq.com/edge/api/model/DataPolicyCreationFailureError: '#/components/schemas/DataPolicyCreationFailureError' + https://hivemq.com/edge/api/model/DataPolicyInvalidErrors: '#/components/schemas/DataPolicyInvalidErrors' + https://hivemq.com/edge/api/model/DataPolicyNotFoundError: '#/components/schemas/DataPolicyNotFoundError' + https://hivemq.com/edge/api/model/DataPolicyRejectedError: '#/components/schemas/DataPolicyRejectedError' + https://hivemq.com/edge/api/model/DataPolicyUpdateFailureError: '#/components/schemas/DataPolicyUpdateFailureError' + https://hivemq.com/edge/api/model/PolicyIdMismatchError: '#/components/schemas/PolicyIdMismatchError' + https://hivemq.com/edge/api/model/PolicyInsufficientStorageError: '#/components/schemas/PolicyInsufficientStorageError' + https://hivemq.com/edge/api/model/PolicyNotFoundError: '#/components/schemas/PolicyNotFoundError' + https://hivemq.com/edge/api/model/SchemaAlreadyPresentError: '#/components/schemas/SchemaAlreadyPresentError' + https://hivemq.com/edge/api/model/SchemaEtagMismatchError: '#/components/schemas/SchemaEtagMismatchError' + https://hivemq.com/edge/api/model/SchemaInsufficientStorageError: '#/components/schemas/SchemaInsufficientStorageError' + https://hivemq.com/edge/api/model/SchemaInvalidErrors: '#/components/schemas/SchemaInvalidErrors' + https://hivemq.com/edge/api/model/SchemaNotFoundError: '#/components/schemas/SchemaNotFoundError' + https://hivemq.com/edge/api/model/SchemaParsingFailureError: '#/components/schemas/SchemaParsingFailureError' + https://hivemq.com/edge/api/model/SchemaReferencedError: '#/components/schemas/SchemaReferencedError' + https://hivemq.com/edge/api/model/ScriptAlreadyPresentError: '#/components/schemas/ScriptAlreadyPresentError' + https://hivemq.com/edge/api/model/ScriptCreationFailureError: '#/components/schemas/ScriptCreationFailureError' + https://hivemq.com/edge/api/model/ScriptEtagMismatchError: '#/components/schemas/ScriptEtagMismatchError' + https://hivemq.com/edge/api/model/ScriptInsufficientStorageError: '#/components/schemas/ScriptInsufficientStorageError' + https://hivemq.com/edge/api/model/ScriptInvalidErrors: '#/components/schemas/ScriptInvalidErrors' + https://hivemq.com/edge/api/model/ScriptNotFoundError: '#/components/schemas/ScriptNotFoundError' + https://hivemq.com/edge/api/model/ScriptParsingFailureError: '#/components/schemas/ScriptParsingFailureError' + https://hivemq.com/edge/api/model/ScriptReferencedError: '#/components/schemas/ScriptReferencedError' + https://hivemq.com/edge/api/model/ScriptSanitationFailureError: '#/components/schemas/ScriptSanitationFailureError' + https://hivemq.com/edge/api/model/TopicFilterMismatchError: '#/components/schemas/TopicFilterMismatchError' + https://hivemq.com/edge/api/model/InsufficientStorageError: '#/components/schemas/InsufficientStorageError' + https://hivemq.com/edge/api/model/InternalServerError: '#/components/schemas/InternalServerError' + https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' + https://hivemq.com/edge/api/model/PreconditionFailedError: '#/components/schemas/PreconditionFailedError' + https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' + https://hivemq.com/edge/api/model/RequestBodyParameterMissingError: '#/components/schemas/RequestBodyParameterMissingError' + https://hivemq.com/edge/api/model/TemporaryNotAvailableError: '#/components/schemas/TemporaryNotAvailableError' + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + BehaviorPolicyAlreadyPresentError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The behavior policy id. + example: abc + required: + - id + example: + general: + status: 409 + title: Behavior Policy Already Present + detail: The given behavior policy 'abc' is already present. + id: abc + type: https://hivemq.com/edge/api/model/BehaviorPolicyAlreadyPresentError + BehaviorPolicyCreationFailureError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 400 + title: Behavior Policy Creation Failed + detail: 'Behavior policy creation failed: The policy was rejected.' + type: https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError + AtLeastOneFieldMissingValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + paths: + type: array + description: The missing json paths. + items: + type: string + format: json-path + description: The json path. + example: + - $.field1 + - $.field2 + required: + - paths + example: + general: + detail: 'At least one of the fields must be present: ''$.field1'', ''$.field2''.' + paths: + - $.field1 + - $.field2 + type: https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError + ValidationError: + type: object + properties: + detail: + type: string + description: Detailed contextual description of the validation error. + type: + type: string + format: uri + description: Type of the validation error. + required: + - detail + - type + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError: '#/components/schemas/AtLeastOneFieldMissingValidationError' + https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError: '#/components/schemas/AtMostOneFunctionValidationError' + https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' + https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError: '#/components/schemas/FunctionMustBePairedValidationError' + https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError: '#/components/schemas/IllegalEventTransitionValidationError' + https://hivemq.com/edge/api/model/IllegalFunctionValidationError: '#/components/schemas/IllegalFunctionValidationError' + https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' + https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' + https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError: '#/components/schemas/InvalidFunctionOrderValidationError' + https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' + https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError: '#/components/schemas/InvalidSchemaVersionValidationError' + https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' + https://hivemq.com/edge/api/model/UnknownVariableValidationError: '#/components/schemas/UnknownVariableValidationError' + https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' + AtMostOneFunctionValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + function: + type: string + description: The function. + example: function1 + occurrences: + type: integer + format: int32 + description: The occurrences of the function. + minimum: 0 + example: 3 + paths: + type: array + items: + type: string + format: json-path + description: The json paths where the function occurs. + example: + - $.path1 + - $.path2 + - $.path3 + required: + - function + - occurrences + - paths + example: + general: + detail: The pipeline must contain at most one 'function1' function, but 3 were found at ['$.path1', '$.path2', '$.path3']. + function: function1 + occurrences: 3 + paths: + - $.path1 + - $.path2 + - $.path3 + type: https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError + EmptyFieldValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + path: + type: string + format: json-path + description: The missing field. + example: $.field + required: + - path + example: + general: + detail: Required field '$.field' is empty. + path: $.field + type: https://hivemq.com/edge/api/model/EmptyFieldValidationError + FunctionMustBePairedValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + existingFunction: + type: string + description: The existing function. + example: function1 + missingFunction: + type: string + description: The missing function. + example: function2 + required: + - existingFunction + - missingFunction + example: + general: + detail: If 'function1' function is present in the pipeline, 'function2' function must be present as well. + existingFunction: function1 + missingFunction: function2 + type: https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError + IllegalEventTransitionValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + event: + type: string + description: The event name. + example: event1 + fromState: + type: string + description: The event from state. + example: state1 + id: + type: string + description: The event id. + example: abc + path: + type: string + description: The path. + example: $.event + toState: + type: string + description: The event to state. + example: state2 + required: + - event + - fromState + - id + - path + - toState + example: + general: + detail: The transition from state 'state1' to state 'state2' on event 'event1' in '$.event' is not defined for behavior 'abc'. + event: event1 + fromState: state1 + toState: state2 + id: abc + path: $.event + type: https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError + IllegalFunctionValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + event: + type: string + description: The event name. + example: event1 + id: + type: string + description: The function id. + example: abc + path: + type: string + format: json-path + description: The json path. + example: $.event + required: + - event + - id + - path + example: + general: + detail: The function 'abc' is not allowed for event 'event1' in '$.event'. + event: event1 + id: abc + path: $.event + type: https://hivemq.com/edge/api/model/IllegalFunctionValidationError + InvalidFieldLengthValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + actualLength: + type: integer + format: int32 + description: The actual length of the field value. + example: 10 + expectedMinimumLength: + type: integer + format: int32 + description: The minimum length expected for the field value. + minimum: 0 + example: 5 + expectedMaximumLength: + type: integer + format: int32 + description: The maximum length expected for the field value. + minimum: 0 + example: 20 + path: + type: string + format: json-path + description: The invalid json path. + example: $.field + value: + type: string + description: The invalid value. + example: function transform() { return 'Hello, World!'; } + required: + - actualLength + - expectedMinimumLength + - expectedMaximumLength + - path + - value + example: + general: + detail: The length of script field '$.transform' 48 must be between 0 and 20. + actualLength: 48 + minimumLength: 0 + maximumLength: 20 + path: $.transform + value: function transform() { return 'Hello, World!'; } + type: https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError + InvalidFieldValueValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + path: + type: string + format: json-path + description: The invalid json path. + example: $.action.pipeline[1].field + value: + type: string + description: The invalid value. + example: functionDoesNotExist + required: + - path + example: + general: + detail: Referenced function does not exist. + path: $.action.pipeline[1].field + value: functionDoesNotExist + type: https://hivemq.com/edge/api/model/InvalidFieldValueValidationError + InvalidFunctionOrderValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + function: + type: string + description: The function. + example: transform + path: + type: string + format: json-path + description: The json path. + example: $.path + previousFunction: + type: string + description: The previous function. + example: init + required: + - function + - path + - previousFunction + example: + general: + detail: The operation at '$.path' with the functionId 'transform' must be after a 'init' operation. + function: transform + path: $.path + previousFunction: init + type: https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError + InvalidIdentifierValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + path: + type: string + format: json-path + description: The invalid identifier path. + example: $.id + value: + type: string + description: The invalid identifier value. + example: invalidId + required: + - path + - value + example: + general: + detail: Identifier script 'id' must begin with a letter and may only consist of lowercase letters, uppercase letters, numbers, periods, hyphens, and underscores. + path: $.id + value: invalidId + type: https://hivemq.com/edge/api/model/InvalidIdentifierValidationError + InvalidSchemaVersionValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + id: + type: string + description: The schema id. + example: abc + version: + type: string + description: The schema version. + example: '2' + required: + - id + - version + example: + general: + detail: The referenced schema with id 'abc' and version '2' was not found. + id: abc + version: '2' + type: https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError + MissingFieldValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + path: + type: string + format: json-path + description: The missing path. + example: $.id + required: + - path + example: + general: + detail: Required field '$.id' is missing. + path: $.id + type: https://hivemq.com/edge/api/model/MissingFieldValidationError + UnknownVariableValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + path: + type: string + description: The json path of the field. + example: $.path + variables: + type: array + items: + type: string + description: The unknown variables. + example: + - a + - b + - c + required: + - path + - variables + example: + general: + detail: 'Field ''$.path'' contains unknown variables: [a, b, c].' + path: $.path + variables: + - a + - b + - c + type: https://hivemq.com/edge/api/model/UnknownVariableValidationError + UnsupportedFieldValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + actualValue: + type: string + description: The actual value. + expectedValue: + type: string + description: The expected value. + path: + type: string + format: json-path + description: The json path. + example: $.id + required: + - actualValue + - expectedValue + - path + example: + general: + detail: Unsupported type 'String' for field '$.id'. Expected type is 'Object'. + actualValue: String + expectedValue: Object + path: $.id + type: https://hivemq.com/edge/api/model/UnsupportedFieldValidationError + BehaviorPolicyValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - oneOf: + - $ref: '#/components/schemas/IllegalEventTransitionValidationError' + - $ref: '#/components/schemas/IllegalFunctionValidationError' + - $ref: '#/components/schemas/InvalidSchemaVersionValidationError' + - $ref: '#/components/schemas/AtLeastOneFieldMissingValidationError' + - $ref: '#/components/schemas/EmptyFieldValidationError' + - $ref: '#/components/schemas/InvalidFieldLengthValidationError' + - $ref: '#/components/schemas/InvalidFieldValueValidationError' + - $ref: '#/components/schemas/InvalidIdentifierValidationError' + - $ref: '#/components/schemas/MissingFieldValidationError' + - $ref: '#/components/schemas/UnsupportedFieldValidationError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError: '#/components/schemas/AtLeastOneFieldMissingValidationError' + https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' + https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError: '#/components/schemas/IllegalEventTransitionValidationError' + https://hivemq.com/edge/api/model/IllegalFunctionValidationError: '#/components/schemas/IllegalFunctionValidationError' + https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' + https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' + https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' + https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError: '#/components/schemas/InvalidSchemaVersionValidationError' + https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' + https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' + BehaviorPolicyInvalidErrors: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + childErrors: + type: array + description: List of child validation errors. + items: + $ref: '#/components/schemas/BehaviorPolicyValidationError' + required: + - childErrors + example: + general: + status: 400 + title: Behavior Policy Invalid + detail: Behavior policy is invalid due to validation errors. + type: https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors + childErrors: + - detail: The transition from state 'state1' to state 'state2' on event 'event1' in '$.path' is not defined for behavior 'id1'. + fromState: state1 + toState: state2 + path: $.path + id: id1 + type: https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError + BehaviorPolicyNotFoundError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The data policy id. + example: abc + required: + - id + example: + general: + status: 404 + title: Behavior Policy Not Found + detail: Behavior policy with ID 'abc' is not found. + id: abc + type: https://hivemq.com/edge/api/model/BehaviorPolicyNotFoundError + BehaviorPolicyRejectedError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 400 + title: Behavior Policy Rejected + detail: Behavior policy is rejected. + type: https://hivemq.com/edge/api/model/BehaviorPolicyRejectedError + BehaviorPolicyUpdateFailureError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The ID of the policy that failed to update. + example: abc + required: + - id + example: + general: + status: 400 + title: Behavior Policy Update Failed + detail: Behavior policy with ID 'abc' update failed. + id: abc + type: https://hivemq.com/edge/api/model/BehaviorPolicyUpdateFailureError + ClientDisconnectedError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The client id. + example: abc + required: + - id + example: + general: + status: 404 + title: Client Disconnected + detail: Client with ID 'abc' is disconnected. + id: abc + type: https://hivemq.com/edge/api/model/ClientDisconnectedError + ClientNotFoundError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The client id. + example: abc + required: + - id + example: + general: + status: 404 + title: Client Not Found + detail: Client with ID 'abc' is not found. + id: abc + type: https://hivemq.com/edge/api/model/ClientNotFoundError + DataPolicyAlreadyPresentError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The data policy id. + example: abc + required: + - id + example: + general: + status: 409 + title: Data Policy Already Present + detail: The given data policy 'abc' is already present. + id: abc + type: https://hivemq.com/edge/api/model/DataPolicyAlreadyPresentError + DataPolicyCreationFailureError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 400 + title: Data Policy Creation Failed + detail: 'Data policy creation failed: The policy was rejected.' + type: https://hivemq.com/edge/api/model/DataPolicyCreationFailureError + DataPolicyValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - oneOf: + - $ref: '#/components/schemas/AtMostOneFunctionValidationError' + - $ref: '#/components/schemas/FunctionMustBePairedValidationError' + - $ref: '#/components/schemas/InvalidFunctionOrderValidationError' + - $ref: '#/components/schemas/InvalidSchemaVersionValidationError' + - $ref: '#/components/schemas/UnknownVariableValidationError' + - $ref: '#/components/schemas/EmptyFieldValidationError' + - $ref: '#/components/schemas/InvalidFieldLengthValidationError' + - $ref: '#/components/schemas/InvalidFieldValueValidationError' + - $ref: '#/components/schemas/InvalidIdentifierValidationError' + - $ref: '#/components/schemas/MissingFieldValidationError' + - $ref: '#/components/schemas/UnsupportedFieldValidationError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError: '#/components/schemas/AtMostOneFunctionValidationError' + https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' + https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError: '#/components/schemas/FunctionMustBePairedValidationError' + https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' + https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' + https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError: '#/components/schemas/InvalidFunctionOrderValidationError' + https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' + https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError: '#/components/schemas/InvalidSchemaVersionValidationError' + https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' + https://hivemq.com/edge/api/model/UnknownVariableValidationError: '#/components/schemas/UnknownVariableValidationError' + https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' + DataPolicyInvalidErrors: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + childErrors: + type: array + description: List of child validation errors. + items: + $ref: '#/components/schemas/DataPolicyValidationError' + required: + - childErrors + example: + general: + status: 400 + title: Data Policy Invalid + detail: Data policy is invalid due to validation errors. + type: https://hivemq.com/edge/api/model/DataPolicyInvalidErrors + childErrors: + - detail: The pipeline must contain at most one 'function1' function, but 3 were found at ['$.path1', '$.path2', '$.path3']. + function: function1 + occurrences: 3 + paths: + - $.path1 + - $.path2 + - $.path3 + type: https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError + DataPolicyNotFoundError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The data policy id. + example: abc + required: + - id + example: + general: + status: 404 + title: Data Policy Not Found + detail: Data policy with ID 'abc' is not found. + id: abc + type: https://hivemq.com/edge/api/model/DataPolicyNotFoundError + DataPolicyRejectedError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 400 + title: Data Policy Rejected + detail: Data policy is rejected. + type: https://hivemq.com/edge/api/model/DataPolicyRejectedError + DataPolicyUpdateFailureError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The ID of the policy that failed to update. + example: abc + required: + - id + example: + general: + status: 400 + title: Data Policy Update Failed + detail: Data policy with ID 'abc' update failed. + id: abc + type: https://hivemq.com/edge/api/model/DataPolicyUpdateFailureError + PolicyIdMismatchError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + actualId: + type: string + description: The actual id. + example: id1 + expectedId: + type: string + description: The expected id. + example: id2 + required: + - actualId + - expectedId + example: + general: + status: 400 + title: Policy ID Mismatch + detail: The policy ID 'id1' in the request parameter does not match the policy ID 'id2' in the policy request body. + id: abc + type: https://hivemq.com/edge/api/model/PolicyIdMismatchError + PolicyInsufficientStorageError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The policy id. + example: abc + required: + - id + example: + general: + status: 507 + title: Policy Insufficient Storage + detail: Policy with ID '123' could not be added because of insufficient server storage. + id: abc + type: https://hivemq.com/edge/api/model/PolicyInsufficientStorageError + PolicyNotFoundError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The policy id. + example: abc + required: + - id + example: + general: + status: 404 + title: Policy Not Found + detail: Policy with ID 'abc' is not found. + id: abc + type: https://hivemq.com/edge/api/model/PolicyNotFoundError + SchemaAlreadyPresentError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The schema id. + example: abc + required: + - id + example: + general: + status: 409 + title: Schema Already Present + detail: The given schema is already present as the latest version for the schema id 'abc'. + id: abc + type: https://hivemq.com/edge/api/model/SchemaAlreadyPresentError + SchemaEtagMismatchError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The schema id. + example: abc + eTag: + type: string + description: The eTag. + example: 33a64df551425fcc55e4d42a148795d9f25f89d4 + required: + - id + example: + general: + status: 412 + title: Schema eTag Mismatch + detail: Schema with id 'abc' does not match the given etag '33a64df551425fcc55e4d42a148795d9f25f89d4'. + id: abc + eTag: 33a64df551425fcc55e4d42a148795d9f25f89d4 + type: https://hivemq.com/edge/api/model/SchemaEtagMismatchError + SchemaInsufficientStorageError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The policy id. + example: abc + required: + - id + example: + general: + status: 507 + title: Schema Insufficient Storage + detail: Schema with ID '123' could not be added because of insufficient server storage. + id: abc + type: https://hivemq.com/edge/api/model/SchemaInsufficientStorageError + SchemaValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - oneOf: + - $ref: '#/components/schemas/EmptyFieldValidationError' + - $ref: '#/components/schemas/InvalidFieldLengthValidationError' + - $ref: '#/components/schemas/InvalidFieldValueValidationError' + - $ref: '#/components/schemas/InvalidIdentifierValidationError' + - $ref: '#/components/schemas/MissingFieldValidationError' + - $ref: '#/components/schemas/UnsupportedFieldValidationError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' + https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' + https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' + https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' + https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' + https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' + SchemaInvalidErrors: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + childErrors: + type: array + description: List of child validation errors. + items: + $ref: '#/components/schemas/SchemaValidationError' + required: + - childErrors + example: + general: + status: 400 + title: Schema Invalid + detail: Schema is invalid due to validation errors. + type: https://hivemq.com/edge/api/model/SchemaInvalidErrors + childErrors: + - detail: The length of script field '$.id' 1025 must be between 0 and 1024. + paths: $.id + value: aaa...aaa + actualLength: 1025 + expectedMinimumLength: 0 + expectedMaximumLength: 1024 + type: https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError + SchemaNotFoundError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The schema ID. + example: abc + required: + - id + example: + general: + status: 404 + title: Schema Not Found + detail: Schema with ID 'abc' is not found. + id: abc + type: https://hivemq.com/edge/api/model/SchemaNotFoundError + SchemaParsingFailureError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + alias: + type: string + description: The schema alias. + example: abc + required: + - alias + example: + general: + status: 400 + title: Schema Parsing Failure + detail: The given schema 'abc' could not be parsed. + alias: abc + type: https://hivemq.com/edge/api/model/SchemaParsingFailureError + SchemaReferencedError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The schema ID. + example: abc + required: + - id + example: + general: + status: 400 + title: Schema Referenced + detail: Schema with ID 'abc' is referenced. + id: abc + type: https://hivemq.com/edge/api/model/SchemaReferencedError + ScriptAlreadyPresentError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The script id. + example: abc + required: + - id + example: + general: + status: 409 + title: Script Already Present + detail: The given script 'abc' is already present. + id: abc + type: https://hivemq.com/edge/api/model/ScriptAlreadyPresentError + ScriptCreationFailureError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 400 + title: Script Creation Failure + detail: The given script could not be created. + type: https://hivemq.com/edge/api/model/ScriptCreationFailureError + ScriptEtagMismatchError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The script id. + example: abc + eTag: + type: string + description: The eTag. + example: 33a64df551425fcc55e4d42a148795d9f25f89d4 + required: + - id + example: + general: + status: 412 + title: Script eTag Mismatch + detail: Script with id 'abc' does not match the given etag '33a64df551425fcc55e4d42a148795d9f25f89d4'. + id: abc + eTag: 33a64df551425fcc55e4d42a148795d9f25f89d4 + type: https://hivemq.com/edge/api/model/ScriptEtagMismatchError + ScriptInsufficientStorageError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The policy id. + example: abc + required: + - id + example: + general: + status: 507 + title: Script Insufficient Storage + detail: Script with ID '123' could not be added because of insufficient server storage. + id: abc + type: https://hivemq.com/edge/api/model/ScriptInsufficientStorageError + ScriptValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - oneOf: + - $ref: '#/components/schemas/InvalidFieldLengthValidationError' + - $ref: '#/components/schemas/InvalidFieldValueValidationError' + - $ref: '#/components/schemas/InvalidIdentifierValidationError' + - $ref: '#/components/schemas/MissingFieldValidationError' + - $ref: '#/components/schemas/UnsupportedFieldValidationError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' + https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' + https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' + https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' + https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' + ScriptInvalidErrors: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + childErrors: + type: array + description: List of child validation errors. + items: + $ref: '#/components/schemas/ScriptValidationError' + required: + - childErrors + example: + general: + status: 400 + title: Script Invalid + detail: Script is invalid due to validation errors. + type: https://hivemq.com/edge/api/model/ScriptInvalidErrors + childErrors: + - detail: The length of script field '$.id' 1025 must be between 0 and 1024. + paths: $.id + value: aaa...aaa + actualLength: 1025 + expectedMinimumLength: 0 + expectedMaximumLength: 1024 + type: https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError + ScriptNotFoundError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The script ID. + example: abc + required: + - id + example: + general: + status: 404 + title: Script Not Found + detail: Script with ID 'abc' is not found. + id: abc + type: https://hivemq.com/edge/api/model/ScriptNotFoundError + ScriptParsingFailureError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 400 + title: Script Parsing Failure + detail: The given script 'abc' could not be parsed. + type: https://hivemq.com/edge/api/model/ScriptParsingFailureError + ScriptReferencedError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The script ID. + example: abc + required: + - id + example: + general: + status: 400 + title: Script Referenced + detail: Script with ID 'abc' is referenced. + id: abc + type: https://hivemq.com/edge/api/model/ScriptReferencedError + ScriptSanitationFailureError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 400 + title: Script Sanitation Failure + detail: The given script could not be sanitized. + type: https://hivemq.com/edge/api/model/ScriptSanitationFailureError + TopicFilterMismatchError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + path: + type: string + description: The json path of the topic filter. + example: $.filter + required: + - path + example: + general: + status: 400 + title: Topic Filter Mismatch + detail: The topic filter '$.filter' mismatches. + type: https://hivemq.com/edge/api/model/TopicFilterMismatchError + InsufficientStorageError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 507 + title: Insufficient Storage + detail: Insufficient Storage. + type: https://hivemq.com/edge/api/model/InsufficientStorageError + InternalServerError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 500 + title: Internal Server Error + detail: An unexpected error occurred, check the logs. + type: https://hivemq.com/edge/api/model/InternalServerError + creation: + status: 500 + title: Internal Server Error + detail: 'An unexpected error occurred: Exception during creation of the Json Schema for functions.' + type: https://hivemq.com/edge/api/model/InternalServerError + InvalidQueryParameterError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + parameter: + type: string + description: The query parameter. + required: + - parameter + example: + general: + status: 400 + title: Query Parameter is Invalid + detail: 'Query parameter ''a'' is invalid: ''a'' could not be parsed.' + parameter: a + type: https://hivemq.com/edge/api/model/InvalidQueryParameterError + PreconditionFailedError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 412 + title: Precondition Failed + detail: 'A precondition required for fulfilling the request was not fulfilled: Policy does not match the given etag ''abc''.' + type: https://hivemq.com/edge/api/model/PreconditionFailedError + RequestBodyMissingError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 400 + title: Required Request Body Missing + detail: Required request body is missing. + type: https://hivemq.com/edge/api/model/RequestBodyMissingError + RequestBodyParameterMissingError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + parameter: + type: string + description: The the missing request body parameter. + required: + - parameter + example: + general: + status: 400 + title: Required Request Body Parameter Missing + detail: Required request body parameter 'a' is missing. + parameter: a + type: https://hivemq.com/edge/api/model/RequestBodyParameterMissingError + TemporaryNotAvailableError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 503 + title: Endpoint Temporarily not Available + detail: The endpoint is temporarily not available, please try again later. + type: https://hivemq.com/edge/api/model/TemporaryNotAvailableError + UrlParameterMissingError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + parameter: + type: string + description: The name of the missing parameter. + required: + - parameter + example: + general: + status: 400 + title: Required URL Parameter Missing + detail: Required URL parameter 'a' is missing. + parameter: a + type: https://hivemq.com/edge/api/model/UrlParameterMissingError JsonNode: type: object description: The arguments of the fsm derived from the behavior policy. diff --git a/ext/openAPI/components/schemas/errors/ApiError.yaml b/ext/openAPI/components/schemas/errors/ApiProblemDetails.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/ApiError.yaml rename to ext/openAPI/components/schemas/errors/ApiProblemDetails.yaml diff --git a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyAlreadyPresentError.yaml b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyAlreadyPresentError.yaml index 0b1225c9bf..cf85a81c5b 100644 --- a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyAlreadyPresentError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyAlreadyPresentError.yaml @@ -1,5 +1,5 @@ allOf: - - $ref: "../ApiError.yaml" + - $ref: "../ApiProblemDetails.yaml" - type: object properties: id: diff --git a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyCreationFailureError.yaml b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyCreationFailureError.yaml index 6414c485e6..ce4e167035 100644 --- a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyCreationFailureError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyCreationFailureError.yaml @@ -1,5 +1,5 @@ allOf: - - $ref: "../ApiError.yaml" + - $ref: "../ApiProblemDetails.yaml" example: general: status: 400 diff --git a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyInvalidErrors.yaml b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyInvalidErrors.yaml index 4b385f874a..6d71f63f4a 100644 --- a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyInvalidErrors.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyInvalidErrors.yaml @@ -1,5 +1,5 @@ allOf: - - $ref: "../ApiError.yaml" + - $ref: "../ApiProblemDetails.yaml" - type: object properties: childErrors: diff --git a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyNotFoundError.yaml b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyNotFoundError.yaml index 3351493f1a..4c022e0279 100644 --- a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyNotFoundError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyNotFoundError.yaml @@ -1,5 +1,5 @@ allOf: - - $ref: "../ApiError.yaml" + - $ref: "../ApiProblemDetails.yaml" - type: object properties: id: diff --git a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyRejectedError.yaml b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyRejectedError.yaml index ae7987bb8a..f5a6f08f61 100644 --- a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyRejectedError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyRejectedError.yaml @@ -1,5 +1,5 @@ allOf: - - $ref: "../ApiError.yaml" + - $ref: "../ApiProblemDetails.yaml" example: general: status: 400 diff --git a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyUpdateFailureError.yaml b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyUpdateFailureError.yaml index d9d95bd99f..d0cfaafe69 100644 --- a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyUpdateFailureError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyUpdateFailureError.yaml @@ -1,5 +1,5 @@ allOf: - - $ref: "../ApiError.yaml" + - $ref: "../ApiProblemDetails.yaml" - type: object properties: id: diff --git a/ext/openAPI/components/schemas/errors/datahub/ClientDisconnectedError.yaml b/ext/openAPI/components/schemas/errors/datahub/ClientDisconnectedError.yaml index 07ef630c53..89d7e92e3c 100644 --- a/ext/openAPI/components/schemas/errors/datahub/ClientDisconnectedError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/ClientDisconnectedError.yaml @@ -1,5 +1,5 @@ allOf: - - $ref: "../ApiError.yaml" + - $ref: "../ApiProblemDetails.yaml" - type: object properties: id: diff --git a/ext/openAPI/components/schemas/errors/datahub/ClientNotFoundError.yaml b/ext/openAPI/components/schemas/errors/datahub/ClientNotFoundError.yaml index 11a84180cc..8889727ecc 100644 --- a/ext/openAPI/components/schemas/errors/datahub/ClientNotFoundError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/ClientNotFoundError.yaml @@ -1,5 +1,5 @@ allOf: - - $ref: "../ApiError.yaml" + - $ref: "../ApiProblemDetails.yaml" - type: object properties: id: diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyAlreadyPresentError.yaml b/ext/openAPI/components/schemas/errors/datahub/DataPolicyAlreadyPresentError.yaml index 0dc5bb19ea..f37ab54ace 100644 --- a/ext/openAPI/components/schemas/errors/datahub/DataPolicyAlreadyPresentError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/DataPolicyAlreadyPresentError.yaml @@ -1,5 +1,5 @@ allOf: - - $ref: "../ApiError.yaml" + - $ref: "../ApiProblemDetails.yaml" - type: object properties: id: diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyCreationFailureError.yaml b/ext/openAPI/components/schemas/errors/datahub/DataPolicyCreationFailureError.yaml index a1af32fd93..ccca26e8d8 100644 --- a/ext/openAPI/components/schemas/errors/datahub/DataPolicyCreationFailureError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/DataPolicyCreationFailureError.yaml @@ -1,5 +1,5 @@ allOf: - - $ref: "../ApiError.yaml" + - $ref: "../ApiProblemDetails.yaml" example: general: status: 400 diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyInvalidErrors.yaml b/ext/openAPI/components/schemas/errors/datahub/DataPolicyInvalidErrors.yaml index fc199bd7da..6dd694a3f7 100644 --- a/ext/openAPI/components/schemas/errors/datahub/DataPolicyInvalidErrors.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/DataPolicyInvalidErrors.yaml @@ -1,5 +1,5 @@ allOf: - - $ref: "../ApiError.yaml" + - $ref: "../ApiProblemDetails.yaml" - type: object properties: childErrors: diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyNotFoundError.yaml b/ext/openAPI/components/schemas/errors/datahub/DataPolicyNotFoundError.yaml index e5c58c44c5..6324c4ebe8 100644 --- a/ext/openAPI/components/schemas/errors/datahub/DataPolicyNotFoundError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/DataPolicyNotFoundError.yaml @@ -1,5 +1,5 @@ allOf: - - $ref: "../ApiError.yaml" + - $ref: "../ApiProblemDetails.yaml" - type: object properties: id: diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyRejectedError.yaml b/ext/openAPI/components/schemas/errors/datahub/DataPolicyRejectedError.yaml index b49c566fc8..4dde36aa3c 100644 --- a/ext/openAPI/components/schemas/errors/datahub/DataPolicyRejectedError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/DataPolicyRejectedError.yaml @@ -1,5 +1,5 @@ allOf: - - $ref: "../ApiError.yaml" + - $ref: "../ApiProblemDetails.yaml" example: general: status: 400 diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyUpdateFailureError.yaml b/ext/openAPI/components/schemas/errors/datahub/DataPolicyUpdateFailureError.yaml index 26784ea62f..ac3cd5832f 100644 --- a/ext/openAPI/components/schemas/errors/datahub/DataPolicyUpdateFailureError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/DataPolicyUpdateFailureError.yaml @@ -1,5 +1,5 @@ allOf: - - $ref: "../ApiError.yaml" + - $ref: "../ApiProblemDetails.yaml" - type: object properties: id: diff --git a/ext/openAPI/components/schemas/errors/datahub/PolicyIdMismatchError.yaml b/ext/openAPI/components/schemas/errors/datahub/PolicyIdMismatchError.yaml index ed7d44096b..6b68f57751 100644 --- a/ext/openAPI/components/schemas/errors/datahub/PolicyIdMismatchError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/PolicyIdMismatchError.yaml @@ -1,5 +1,5 @@ allOf: - - $ref: "../ApiError.yaml" + - $ref: "../ApiProblemDetails.yaml" - type: object properties: actualId: diff --git a/ext/openAPI/components/schemas/errors/datahub/PolicyInsufficientStorageError.yaml b/ext/openAPI/components/schemas/errors/datahub/PolicyInsufficientStorageError.yaml index a44d60b5fe..6ed78b8ab9 100644 --- a/ext/openAPI/components/schemas/errors/datahub/PolicyInsufficientStorageError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/PolicyInsufficientStorageError.yaml @@ -1,5 +1,5 @@ allOf: - - $ref: "../ApiError.yaml" + - $ref: "../ApiProblemDetails.yaml" - type: object properties: id: diff --git a/ext/openAPI/components/schemas/errors/datahub/PolicyNotFoundError.yaml b/ext/openAPI/components/schemas/errors/datahub/PolicyNotFoundError.yaml index d152dcacd5..f200cc7acf 100644 --- a/ext/openAPI/components/schemas/errors/datahub/PolicyNotFoundError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/PolicyNotFoundError.yaml @@ -1,5 +1,5 @@ allOf: - - $ref: "../ApiError.yaml" + - $ref: "../ApiProblemDetails.yaml" - type: object properties: id: diff --git a/ext/openAPI/components/schemas/errors/datahub/SchemaAlreadyPresentError.yaml b/ext/openAPI/components/schemas/errors/datahub/SchemaAlreadyPresentError.yaml index 48432a577b..e4e8bf878e 100644 --- a/ext/openAPI/components/schemas/errors/datahub/SchemaAlreadyPresentError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/SchemaAlreadyPresentError.yaml @@ -1,5 +1,5 @@ allOf: - - $ref: "../ApiError.yaml" + - $ref: "../ApiProblemDetails.yaml" - type: object properties: id: diff --git a/ext/openAPI/components/schemas/errors/datahub/SchemaEtagMismatchError.yaml b/ext/openAPI/components/schemas/errors/datahub/SchemaEtagMismatchError.yaml index 58138271d9..e0d25107a2 100644 --- a/ext/openAPI/components/schemas/errors/datahub/SchemaEtagMismatchError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/SchemaEtagMismatchError.yaml @@ -1,5 +1,5 @@ allOf: - - $ref: "../ApiError.yaml" + - $ref: "../ApiProblemDetails.yaml" - type: object properties: id: diff --git a/ext/openAPI/components/schemas/errors/datahub/SchemaInsufficientStorageError.yaml b/ext/openAPI/components/schemas/errors/datahub/SchemaInsufficientStorageError.yaml index 4997b4efd1..12e490c9c2 100644 --- a/ext/openAPI/components/schemas/errors/datahub/SchemaInsufficientStorageError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/SchemaInsufficientStorageError.yaml @@ -1,5 +1,5 @@ allOf: - - $ref: "../ApiError.yaml" + - $ref: "../ApiProblemDetails.yaml" - type: object properties: id: diff --git a/ext/openAPI/components/schemas/errors/datahub/SchemaInvalidErrors.yaml b/ext/openAPI/components/schemas/errors/datahub/SchemaInvalidErrors.yaml index 07b9039f7a..aec67a1e3c 100644 --- a/ext/openAPI/components/schemas/errors/datahub/SchemaInvalidErrors.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/SchemaInvalidErrors.yaml @@ -1,5 +1,5 @@ allOf: - - $ref: "../ApiError.yaml" + - $ref: "../ApiProblemDetails.yaml" - type: object properties: childErrors: diff --git a/ext/openAPI/components/schemas/errors/datahub/SchemaNotFoundError.yaml b/ext/openAPI/components/schemas/errors/datahub/SchemaNotFoundError.yaml index 87c3f5d2b4..fb7f559489 100644 --- a/ext/openAPI/components/schemas/errors/datahub/SchemaNotFoundError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/SchemaNotFoundError.yaml @@ -1,5 +1,5 @@ allOf: - - $ref: "../ApiError.yaml" + - $ref: "../ApiProblemDetails.yaml" - type: object properties: id: diff --git a/ext/openAPI/components/schemas/errors/datahub/SchemaParsingFailureError.yaml b/ext/openAPI/components/schemas/errors/datahub/SchemaParsingFailureError.yaml index 0e17b9033a..b732896c47 100644 --- a/ext/openAPI/components/schemas/errors/datahub/SchemaParsingFailureError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/SchemaParsingFailureError.yaml @@ -1,5 +1,5 @@ allOf: - - $ref: "../ApiError.yaml" + - $ref: "../ApiProblemDetails.yaml" - type: object properties: alias: diff --git a/ext/openAPI/components/schemas/errors/datahub/SchemaReferencedError.yaml b/ext/openAPI/components/schemas/errors/datahub/SchemaReferencedError.yaml index 6fc5d6d8df..c76cd6d91c 100644 --- a/ext/openAPI/components/schemas/errors/datahub/SchemaReferencedError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/SchemaReferencedError.yaml @@ -1,5 +1,5 @@ allOf: - - $ref: "../ApiError.yaml" + - $ref: "../ApiProblemDetails.yaml" - type: object properties: id: diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptAlreadyPresentError.yaml b/ext/openAPI/components/schemas/errors/datahub/ScriptAlreadyPresentError.yaml index 51d31e76c7..3eaa052695 100644 --- a/ext/openAPI/components/schemas/errors/datahub/ScriptAlreadyPresentError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/ScriptAlreadyPresentError.yaml @@ -1,5 +1,5 @@ allOf: - - $ref: "../ApiError.yaml" + - $ref: "../ApiProblemDetails.yaml" - type: object properties: id: diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptCreationFailureError.yaml b/ext/openAPI/components/schemas/errors/datahub/ScriptCreationFailureError.yaml index 8e117e0c08..e87b021ba2 100644 --- a/ext/openAPI/components/schemas/errors/datahub/ScriptCreationFailureError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/ScriptCreationFailureError.yaml @@ -1,5 +1,5 @@ allOf: - - $ref: "../ApiError.yaml" + - $ref: "../ApiProblemDetails.yaml" example: general: status: 400 diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptEtagMismatchError.yaml b/ext/openAPI/components/schemas/errors/datahub/ScriptEtagMismatchError.yaml index 64a39d4f04..cedf730d53 100644 --- a/ext/openAPI/components/schemas/errors/datahub/ScriptEtagMismatchError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/ScriptEtagMismatchError.yaml @@ -1,5 +1,5 @@ allOf: - - $ref: "../ApiError.yaml" + - $ref: "../ApiProblemDetails.yaml" - type: object properties: id: diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptInsufficientStorageError.yaml b/ext/openAPI/components/schemas/errors/datahub/ScriptInsufficientStorageError.yaml index 605012355f..718c032f3e 100644 --- a/ext/openAPI/components/schemas/errors/datahub/ScriptInsufficientStorageError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/ScriptInsufficientStorageError.yaml @@ -1,5 +1,5 @@ allOf: - - $ref: "../ApiError.yaml" + - $ref: "../ApiProblemDetails.yaml" - type: object properties: id: diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptInvalidErrors.yaml b/ext/openAPI/components/schemas/errors/datahub/ScriptInvalidErrors.yaml index 388efa097f..d2519e5ae1 100644 --- a/ext/openAPI/components/schemas/errors/datahub/ScriptInvalidErrors.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/ScriptInvalidErrors.yaml @@ -1,5 +1,5 @@ allOf: - - $ref: "../ApiError.yaml" + - $ref: "../ApiProblemDetails.yaml" - type: object properties: childErrors: diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptNotFoundError.yaml b/ext/openAPI/components/schemas/errors/datahub/ScriptNotFoundError.yaml index 00b71ccde5..d6d36a8eab 100644 --- a/ext/openAPI/components/schemas/errors/datahub/ScriptNotFoundError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/ScriptNotFoundError.yaml @@ -1,5 +1,5 @@ allOf: - - $ref: "../ApiError.yaml" + - $ref: "../ApiProblemDetails.yaml" - type: object properties: id: diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptParsingFailureError.yaml b/ext/openAPI/components/schemas/errors/datahub/ScriptParsingFailureError.yaml index af9f6a4cc8..b2ddfde818 100644 --- a/ext/openAPI/components/schemas/errors/datahub/ScriptParsingFailureError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/ScriptParsingFailureError.yaml @@ -1,5 +1,5 @@ allOf: - - $ref: "../ApiError.yaml" + - $ref: "../ApiProblemDetails.yaml" example: general: status: 400 diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptReferencedError.yaml b/ext/openAPI/components/schemas/errors/datahub/ScriptReferencedError.yaml index 6ae4c4b99f..a43a8e8691 100644 --- a/ext/openAPI/components/schemas/errors/datahub/ScriptReferencedError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/ScriptReferencedError.yaml @@ -1,5 +1,5 @@ allOf: - - $ref: "../ApiError.yaml" + - $ref: "../ApiProblemDetails.yaml" - type: object properties: id: diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptSanitationFailureError.yaml b/ext/openAPI/components/schemas/errors/datahub/ScriptSanitationFailureError.yaml index 993184d87c..47ff64b1a9 100644 --- a/ext/openAPI/components/schemas/errors/datahub/ScriptSanitationFailureError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/ScriptSanitationFailureError.yaml @@ -1,5 +1,5 @@ allOf: - - $ref: "../ApiError.yaml" + - $ref: "../ApiProblemDetails.yaml" example: general: status: 400 diff --git a/ext/openAPI/components/schemas/errors/datahub/TopicFilterMismatchError.yaml b/ext/openAPI/components/schemas/errors/datahub/TopicFilterMismatchError.yaml index 8c7d64fbf7..f056a95efe 100644 --- a/ext/openAPI/components/schemas/errors/datahub/TopicFilterMismatchError.yaml +++ b/ext/openAPI/components/schemas/errors/datahub/TopicFilterMismatchError.yaml @@ -1,5 +1,5 @@ allOf: - - $ref: "../ApiError.yaml" + - $ref: "../ApiProblemDetails.yaml" - type: object properties: path: diff --git a/ext/openAPI/components/schemas/errors/http/InsufficientStorageError.yaml b/ext/openAPI/components/schemas/errors/http/InsufficientStorageError.yaml index 95b438ad62..ee12683fe0 100644 --- a/ext/openAPI/components/schemas/errors/http/InsufficientStorageError.yaml +++ b/ext/openAPI/components/schemas/errors/http/InsufficientStorageError.yaml @@ -1,5 +1,5 @@ allOf: - - $ref: "../ApiError.yaml" + - $ref: "../ApiProblemDetails.yaml" example: general: status: 507 diff --git a/ext/openAPI/components/schemas/errors/http/InternalServerError.yaml b/ext/openAPI/components/schemas/errors/http/InternalServerError.yaml index b59bc70d4c..a43ce5dbb1 100644 --- a/ext/openAPI/components/schemas/errors/http/InternalServerError.yaml +++ b/ext/openAPI/components/schemas/errors/http/InternalServerError.yaml @@ -1,5 +1,5 @@ allOf: - - $ref: "../ApiError.yaml" + - $ref: "../ApiProblemDetails.yaml" example: general: status: 500 diff --git a/ext/openAPI/components/schemas/errors/http/InvalidQueryParameterError.yaml b/ext/openAPI/components/schemas/errors/http/InvalidQueryParameterError.yaml index 61ec1ef357..1cf783a41c 100644 --- a/ext/openAPI/components/schemas/errors/http/InvalidQueryParameterError.yaml +++ b/ext/openAPI/components/schemas/errors/http/InvalidQueryParameterError.yaml @@ -1,5 +1,5 @@ allOf: - - $ref: "../ApiError.yaml" + - $ref: "../ApiProblemDetails.yaml" - type: object properties: parameter: diff --git a/ext/openAPI/components/schemas/errors/http/PreconditionFailedError.yaml b/ext/openAPI/components/schemas/errors/http/PreconditionFailedError.yaml index 26ee530325..bfe529d962 100644 --- a/ext/openAPI/components/schemas/errors/http/PreconditionFailedError.yaml +++ b/ext/openAPI/components/schemas/errors/http/PreconditionFailedError.yaml @@ -1,5 +1,5 @@ allOf: - - $ref: "../ApiError.yaml" + - $ref: "../ApiProblemDetails.yaml" example: general: status: 412 diff --git a/ext/openAPI/components/schemas/errors/http/RequestBodyMissingError.yaml b/ext/openAPI/components/schemas/errors/http/RequestBodyMissingError.yaml index 94a583e0aa..872361f40b 100644 --- a/ext/openAPI/components/schemas/errors/http/RequestBodyMissingError.yaml +++ b/ext/openAPI/components/schemas/errors/http/RequestBodyMissingError.yaml @@ -1,5 +1,5 @@ allOf: - - $ref: "../ApiError.yaml" + - $ref: "../ApiProblemDetails.yaml" example: general: status: 400 diff --git a/ext/openAPI/components/schemas/errors/http/RequestBodyParameterMissingError.yaml b/ext/openAPI/components/schemas/errors/http/RequestBodyParameterMissingError.yaml index e3e39383e0..6459c06c76 100644 --- a/ext/openAPI/components/schemas/errors/http/RequestBodyParameterMissingError.yaml +++ b/ext/openAPI/components/schemas/errors/http/RequestBodyParameterMissingError.yaml @@ -1,5 +1,5 @@ allOf: - - $ref: "../ApiError.yaml" + - $ref: "../ApiProblemDetails.yaml" - type: object properties: parameter: diff --git a/ext/openAPI/components/schemas/errors/http/TemporaryNotAvailableError.yaml b/ext/openAPI/components/schemas/errors/http/TemporaryNotAvailableError.yaml index 7b9010e157..a4e9708441 100644 --- a/ext/openAPI/components/schemas/errors/http/TemporaryNotAvailableError.yaml +++ b/ext/openAPI/components/schemas/errors/http/TemporaryNotAvailableError.yaml @@ -1,5 +1,5 @@ allOf: - - $ref: "../ApiError.yaml" + - $ref: "../ApiProblemDetails.yaml" example: general: status: 503 diff --git a/ext/openAPI/components/schemas/errors/http/UrlParameterMissingError.yaml b/ext/openAPI/components/schemas/errors/http/UrlParameterMissingError.yaml index e3a14e67df..829998c05b 100644 --- a/ext/openAPI/components/schemas/errors/http/UrlParameterMissingError.yaml +++ b/ext/openAPI/components/schemas/errors/http/UrlParameterMissingError.yaml @@ -1,5 +1,5 @@ allOf: - - $ref: "../ApiError.yaml" + - $ref: "../ApiProblemDetails.yaml" - type: object properties: parameter: diff --git a/hivemq-edge/src/main/java/com/hivemq/util/ErrorResponseUtil.java b/hivemq-edge/src/main/java/com/hivemq/util/ErrorResponseUtil.java index 6b3e86ed91..5b4d125b4e 100644 --- a/hivemq-edge/src/main/java/com/hivemq/util/ErrorResponseUtil.java +++ b/hivemq-edge/src/main/java/com/hivemq/util/ErrorResponseUtil.java @@ -17,6 +17,7 @@ import com.hivemq.api.error.ApiExceptionMapper; import com.hivemq.edge.api.model.ApiError; +import com.hivemq.edge.api.model.ApiProblemDetails; import com.hivemq.http.HttpConstants; import com.hivemq.http.error.ProblemDetails; import jakarta.ws.rs.core.Response; @@ -26,7 +27,7 @@ * @author Christoph Schäbel */ public class ErrorResponseUtil { - public static @NotNull Response errorResponse(final @NotNull ApiError error) { + public static @NotNull Response errorResponse(final @NotNull ApiProblemDetails error) { return Response.status(error.getStatus()) .entity(error) .type(HttpConstants.APPLICATION_PROBLEM_JSON_TYPE) From e0c0bc34a996e67a49ee33978aedab00edf3eb8d Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Tue, 29 Jul 2025 09:13:55 +0200 Subject: [PATCH 112/121] fix: Remove ApiError from ErrorResponseUtil --- .../src/main/java/com/hivemq/util/ErrorResponseUtil.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/hivemq-edge/src/main/java/com/hivemq/util/ErrorResponseUtil.java b/hivemq-edge/src/main/java/com/hivemq/util/ErrorResponseUtil.java index 5b4d125b4e..9c68a56b72 100644 --- a/hivemq-edge/src/main/java/com/hivemq/util/ErrorResponseUtil.java +++ b/hivemq-edge/src/main/java/com/hivemq/util/ErrorResponseUtil.java @@ -15,8 +15,6 @@ */ package com.hivemq.util; -import com.hivemq.api.error.ApiExceptionMapper; -import com.hivemq.edge.api.model.ApiError; import com.hivemq.edge.api.model.ApiProblemDetails; import com.hivemq.http.HttpConstants; import com.hivemq.http.error.ProblemDetails; From e8a0861f39c03d6a947268f358c48e299c2c32e9 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Thu, 7 Aug 2025 16:11:04 +0200 Subject: [PATCH 113/121] fix: Regenerate openapi spec --- ext/hivemq-edge-openapi-2025.11.yaml | 1727 ++--------------------- ext/hivemq-edge-openapi-2025.12.yaml | 1889 +++---------------------- ext/hivemq-edge-openapi-2025.13.yaml | 1258 ----------------- ext/hivemq-edge-openapi-2025.14.yaml | 1927 ++++++++++++++++++++++---- ext/hivemq-edge-openapi-2025.9.yaml | 1796 ++---------------------- 5 files changed, 2184 insertions(+), 6413 deletions(-) diff --git a/ext/hivemq-edge-openapi-2025.11.yaml b/ext/hivemq-edge-openapi-2025.11.yaml index 1a70c79239..b9ef383fa6 100644 --- a/ext/hivemq-edge-openapi-2025.11.yaml +++ b/ext/hivemq-edge-openapi-2025.11.yaml @@ -14,7 +14,7 @@ info: ## OpenAPI HiveMQ's REST API provides an OpenAPI 3.0 schema definition that can imported into popular API tooling (e.g. Postman) or can be used to generate client-code for multiple programming languages. title: HiveMQ Edge REST API - version: 2025.11-SNAPSHOT + version: 2025.10-SNAPSHOT x-logo: url: https://www.hivemq.com/img/svg/hivemq-bee.svg tags: @@ -354,23 +354,12 @@ paths: schema: $ref: '#/components/schemas/BehaviorPolicyList' description: Success - '400': - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/InvalidQueryParameterError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' - description: URL parameter missing '503': content: application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable + $ref: '#/components/schemas/ProblemDetails' + description: Temporarily not available summary: Get all policies tags: - Data Hub - Behavior Policies @@ -457,43 +446,32 @@ paths: content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/BehaviorPolicyCreationFailureError' - - $ref: '#/components/schemas/BehaviorPolicyInvalidErrors' - - $ref: '#/components/schemas/BehaviorPolicyRejectedError' - - $ref: '#/components/schemas/RequestBodyMissingError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError: '#/components/schemas/BehaviorPolicyCreationFailureError' - https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors: '#/components/schemas/BehaviorPolicyInvalidErrors' - https://hivemq.com/edge/api/model/BehaviorPolicyRejectedError: '#/components/schemas/BehaviorPolicyRejectedError' - https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' + $ref: '#/components/schemas/ProblemDetails' description: Policy creation failed '409': content: application/json: schema: - $ref: '#/components/schemas/BehaviorPolicyAlreadyPresentError' - description: Behavior policy already present + $ref: '#/components/schemas/ProblemDetails' + description: Already exists '500': content: application/json: schema: - $ref: '#/components/schemas/InternalServerError' - description: Internal server error + $ref: '#/components/schemas/ProblemDetails' + description: Internal error '503': content: application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable + $ref: '#/components/schemas/ProblemDetails' + description: Temporarily unavailable '507': content: application/json: schema: - $ref: '#/components/schemas/PolicyInsufficientStorageError' - description: Insufficient storage + $ref: '#/components/schemas/ProblemDetails' + description: Insufficient storage error summary: Create a new policy tags: - Data Hub - Behavior Policies @@ -525,37 +503,32 @@ paths: content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + $ref: '#/components/schemas/ProblemDetails' description: URL parameter missing '404': content: application/json: schema: - $ref: '#/components/schemas/PolicyNotFoundError' - description: Behavior policy not found + $ref: '#/components/schemas/ProblemDetails' + description: Policy not found '412': content: application/json: schema: - $ref: '#/components/schemas/PreconditionFailedError' + $ref: '#/components/schemas/ProblemDetails' description: Precondition failed '500': content: application/json: schema: - $ref: '#/components/schemas/InternalServerError' - description: Internal server error + $ref: '#/components/schemas/ProblemDetails' + description: Internal error '503': content: application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable + $ref: '#/components/schemas/ProblemDetails' + description: Temporarily not available summary: Delete a behavior policy tags: - Data Hub - Behavior Policies @@ -625,31 +598,14 @@ paths: content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' - description: Bad request + $ref: '#/components/schemas/ProblemDetails' + description: Invalid query parameter '404': content: application/json: schema: - $ref: '#/components/schemas/BehaviorPolicyNotFoundError' + $ref: '#/components/schemas/ProblemDetails' description: Policy not found - '500': - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerError' - description: Internal server error - '503': - content: - application/json: - schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable summary: Get a policy tags: - Data Hub - Behavior Policies @@ -752,54 +708,39 @@ paths: content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/RequestBodyMissingError' - - $ref: '#/components/schemas/UrlParameterMissingError' - - $ref: '#/components/schemas/BehaviorPolicyCreationFailureError' - - $ref: '#/components/schemas/BehaviorPolicyInvalidErrors' - - $ref: '#/components/schemas/BehaviorPolicyUpdateFailureError' - - $ref: '#/components/schemas/PolicyIdMismatchError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' - https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError: '#/components/schemas/BehaviorPolicyCreationFailureError' - https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors: '#/components/schemas/BehaviorPolicyInvalidErrors' - https://hivemq.com/edge/api/model/BehaviorPolicyUpdateFailureError: '#/components/schemas/BehaviorPolicyUpdateFailureError' - https://hivemq.com/edge/api/model/PolicyIdMismatchError: '#/components/schemas/PolicyIdMismatchError' - description: Behavior policy creation failed + $ref: '#/components/schemas/ProblemDetails' + description: Policy creation failed '404': content: application/json: schema: - $ref: '#/components/schemas/BehaviorPolicyNotFoundError' - description: Data policy not found + $ref: '#/components/schemas/ProblemDetails' + description: Policy not found '412': content: application/json: schema: - $ref: '#/components/schemas/PreconditionFailedError' + $ref: '#/components/schemas/ProblemDetails' description: Precondition failed '500': content: application/json: schema: - $ref: '#/components/schemas/InternalServerError' - description: Internal server error + $ref: '#/components/schemas/ProblemDetails' + description: Internal error '503': content: application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable + $ref: '#/components/schemas/ProblemDetails' + description: Temporarily unavailable '507': content: application/json: schema: - $ref: '#/components/schemas/PolicyInsufficientStorageError' - description: Insufficient storage - summary: Update an existing behavior policy + $ref: '#/components/schemas/ProblemDetails' + description: Insufficient storage error + summary: Update an existing policy tags: - Data Hub - Behavior Policies /api/v1/data-hub/behavior-validation/states/{clientId}: @@ -845,32 +786,20 @@ paths: content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + $ref: '#/components/schemas/ProblemDetails' description: URL parameter missing '404': content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/ClientDisconnectedError' - - $ref: '#/components/schemas/ClientNotFoundError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/ClientDisconnectedError: '#/components/schemas/ClientDisconnectedError' - https://hivemq.com/edge/api/model/ClientNotFoundError: '#/components/schemas/ClientNotFoundError' - description: Client error + $ref: '#/components/schemas/ProblemDetails' + description: Client is disconnected '500': content: application/json: schema: - $ref: '#/components/schemas/InternalServerError' - description: Internal server error + $ref: '#/components/schemas/ProblemDetails' + description: Internal Server error summary: Get the state of a client tags: - Data Hub - State @@ -1121,18 +1050,25 @@ paths: content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/InvalidQueryParameterError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' + $ref: '#/components/schemas/ProblemDetails' description: URL parameter missing + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: DataPolicy not found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: Internal server error '503': content: application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' + $ref: '#/components/schemas/ProblemDetails' description: Request resource temporary unavailable summary: Get all data policies tags: @@ -1218,42 +1154,31 @@ paths: content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/RequestBodyMissingError' - - $ref: '#/components/schemas/DataPolicyCreationFailureError' - - $ref: '#/components/schemas/DataPolicyInvalidErrors' - - $ref: '#/components/schemas/DataPolicyRejectedError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' - https://hivemq.com/edge/api/model/DataPolicyCreationFailureError: '#/components/schemas/DataPolicyCreationFailureError' - https://hivemq.com/edge/api/model/DataPolicyInvalidErrors: '#/components/schemas/DataPolicyInvalidErrors' - https://hivemq.com/edge/api/model/DataPolicyRejectedError: '#/components/schemas/DataPolicyRejectedError' - description: Data policy creation failed + $ref: '#/components/schemas/ProblemDetails' + description: DataPolicy creation failed '409': content: application/json: schema: - $ref: '#/components/schemas/DataPolicyAlreadyPresentError' - description: Data policy already present + $ref: '#/components/schemas/ProblemDetails' + description: DataPolicy already present '500': content: application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error '503': content: application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' + $ref: '#/components/schemas/ProblemDetails' description: Request resource temporary unavailable '507': content: application/json: schema: - $ref: '#/components/schemas/PolicyInsufficientStorageError' + $ref: '#/components/schemas/ProblemDetails' description: Insufficient storage summary: Create a new data policy tags: @@ -1286,36 +1211,25 @@ paths: content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + $ref: '#/components/schemas/ProblemDetails' description: URL parameter missing '404': content: application/json: schema: - $ref: '#/components/schemas/PolicyNotFoundError' - description: Data policy not found - '412': - content: - application/json: - schema: - $ref: '#/components/schemas/PreconditionFailedError' - description: Precondition failed + $ref: '#/components/schemas/ProblemDetails' + description: DataPolicy not found '500': content: application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error '503': content: application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' + $ref: '#/components/schemas/ProblemDetails' description: Request resource temporary unavailable summary: Delete a data policy tags: @@ -1384,32 +1298,31 @@ paths: '400': content: application/json: + examples: + param-missing: + description: Example response when a required parameter is missing. + summary: Required URL parameter missing + value: + errors: + - title: Required parameter missing + detail: Required URL parameter 'parameterName' is missing schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + $ref: '#/components/schemas/ProblemDetails' description: Bad request '404': content: application/json: + examples: + not-found: + description: Policy not found + summary: Not found + value: + errors: + - title: Resource not found + detail: Resource with id 'my-resource-id' not found schema: - $ref: '#/components/schemas/PolicyNotFoundError' + $ref: '#/components/schemas/ProblemDetails' description: Resource not found - '500': - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerError' - description: Internal server error - '503': - content: - application/json: - schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable summary: Get a data policy tags: - Data Hub - Data Policies @@ -1511,54 +1424,31 @@ paths: content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/RequestBodyMissingError' - - $ref: '#/components/schemas/UrlParameterMissingError' - - $ref: '#/components/schemas/DataPolicyCreationFailureError' - - $ref: '#/components/schemas/DataPolicyInvalidErrors' - - $ref: '#/components/schemas/DataPolicyUpdateFailureError' - - $ref: '#/components/schemas/PolicyIdMismatchError' - - $ref: '#/components/schemas/TopicFilterMismatchError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' - https://hivemq.com/edge/api/model/DataPolicyCreationFailureError: '#/components/schemas/DataPolicyCreationFailureError' - https://hivemq.com/edge/api/model/DataPolicyInvalidErrors: '#/components/schemas/DataPolicyInvalidErrors' - https://hivemq.com/edge/api/model/DataPolicyUpdateFailureError: '#/components/schemas/DataPolicyUpdateFailureError' - https://hivemq.com/edge/api/model/PolicyIdMismatchError: '#/components/schemas/PolicyIdMismatchError' - https://hivemq.com/edge/api/model/TopicFilterMismatchError: '#/components/schemas/TopicFilterMismatchError' - description: Data policy creation failed + $ref: '#/components/schemas/ProblemDetails' + description: DataPolicy creation failed '404': content: application/json: schema: - $ref: '#/components/schemas/DataPolicyNotFoundError' - description: Data policy not found - '412': - content: - application/json: - schema: - $ref: '#/components/schemas/PreconditionFailedError' - description: Precondition failed + $ref: '#/components/schemas/ProblemDetails' + description: DataPolicy not found '500': content: application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error '503': content: application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' + $ref: '#/components/schemas/ProblemDetails' description: Request resource temporary unavailable '507': content: application/json: schema: - $ref: '#/components/schemas/PolicyInsufficientStorageError' + $ref: '#/components/schemas/ProblemDetails' description: Insufficient storage summary: Update an existing data policy tags: @@ -1646,7 +1536,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/Errors' description: Internal server error summary: Get all FSMs as a JSON Schema tags: @@ -1808,7 +1698,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error summary: Get all functions as a JSON Schema tags: @@ -1828,7 +1718,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error summary: Get all interpolation variables tags: @@ -1848,7 +1738,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error summary: Get all functions as a list of function specifications tags: @@ -1983,22 +1873,11 @@ paths: schema: $ref: '#/components/schemas/SchemaList' description: Success - '400': - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/InvalidQueryParameterError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' - description: URL parameter missing '503': content: application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' + $ref: '#/components/schemas/ProblemDetails' description: Request resource temporary unavailable summary: Get all schemas tags: @@ -2047,46 +1926,31 @@ paths: content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/RequestBodyParameterMissingError' - - $ref: '#/components/schemas/SchemaInvalidErrors' - - $ref: '#/components/schemas/SchemaParsingFailureError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/RequestBodyParameterMissingError: '#/components/schemas/RequestBodyParameterMissingError' - https://hivemq.com/edge/api/model/SchemaInvalidErrors: '#/components/schemas/SchemaInvalidErrors' - https://hivemq.com/edge/api/model/SchemaParsingFailureError: '#/components/schemas/SchemaParsingFailureError' - description: Schema creation failed + $ref: '#/components/schemas/ProblemDetails' + description: Schema could not be validatetd '409': content: application/json: schema: - $ref: '#/components/schemas/SchemaAlreadyPresentError' - description: Schema is already present + $ref: '#/components/schemas/ProblemDetails' + description: Schema already exists '412': content: application/json: schema: - $ref: '#/components/schemas/SchemaEtagMismatchError' - description: Schema doesn't match etag + $ref: '#/components/schemas/ProblemDetails' + description: Mismatch between schema and etag '500': content: application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error - '503': - content: - application/json: - schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable '507': content: application/json: schema: - $ref: '#/components/schemas/SchemaInsufficientStorageError' + $ref: '#/components/schemas/ProblemDetails' description: Insufficient storage summary: Create a new schema tags: @@ -2119,38 +1983,31 @@ paths: content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - - $ref: '#/components/schemas/SchemaReferencedError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' - https://hivemq.com/edge/api/model/SchemaReferencedError: '#/components/schemas/SchemaReferencedError' - description: URL parameter missing + $ref: '#/components/schemas/ProblemDetails' + description: Schema referenced '404': content: application/json: schema: - $ref: '#/components/schemas/SchemaNotFoundError' + $ref: '#/components/schemas/ProblemDetails' description: Schema not found '412': content: application/json: schema: - $ref: '#/components/schemas/SchemaEtagMismatchError' - description: Schema doesn't match etag + $ref: '#/components/schemas/ProblemDetails' + description: Mismatch between schema and etag '500': content: application/json: schema: - $ref: '#/components/schemas/InternalServerError' - description: Internal Server error + $ref: '#/components/schemas/ProblemDetails' + description: Internal server error '503': content: application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' + $ref: '#/components/schemas/ProblemDetails' description: Request resource temporary unavailable summary: Delete all versions of the schema tags: @@ -2198,31 +2055,20 @@ paths: content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' - description: URL parameter missing + $ref: '#/components/schemas/ProblemDetails' + description: A url parameter is missing '404': content: application/json: schema: - $ref: '#/components/schemas/SchemaNotFoundError' + $ref: '#/components/schemas/ProblemDetails' description: Schema not found '500': content: application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error - '503': - content: - application/json: - schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable summary: Get a schema tags: - Data Hub - Schemas @@ -2343,23 +2189,12 @@ paths: schema: $ref: '#/components/schemas/ScriptList' description: Success - '400': - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/InvalidQueryParameterError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' - description: URL parameter missing '503': content: application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable + $ref: '#/components/schemas/ProblemDetails' + description: Temporary not available summary: Get all scripts tags: - Data Hub - Scripts @@ -2407,50 +2242,37 @@ paths: content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/RequestBodyParameterMissingError' - - $ref: '#/components/schemas/ScriptCreationFailureError' - - $ref: '#/components/schemas/ScriptInvalidErrors' - - $ref: '#/components/schemas/ScriptParsingFailureError' - - $ref: '#/components/schemas/ScriptSanitationFailureError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/RequestBodyParameterMissingError: '#/components/schemas/RequestBodyParameterMissingError' - https://hivemq.com/edge/api/model/ScriptCreationFailureError: '#/components/schemas/ScriptCreationFailureError' - https://hivemq.com/edge/api/model/ScriptInvalidErrors: '#/components/schemas/ScriptInvalidErrors' - https://hivemq.com/edge/api/model/ScriptParsingFailureError: '#/components/schemas/ScriptParsingFailureError' - https://hivemq.com/edge/api/model/ScriptSanitationFailureError: '#/components/schemas/ScriptSanitationFailureError' - description: Script creation failed + $ref: '#/components/schemas/ProblemDetails' + description: Script is invalid '409': content: application/json: schema: - $ref: '#/components/schemas/ScriptAlreadyPresentError' + $ref: '#/components/schemas/ProblemDetails' description: Script is already present '412': content: application/json: schema: - $ref: '#/components/schemas/ScriptEtagMismatchError' + $ref: '#/components/schemas/ProblemDetails' description: Script doesn't match etag '500': content: application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error '503': content: application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable + $ref: '#/components/schemas/ProblemDetails' + description: Temporary not available '507': content: application/json: schema: - $ref: '#/components/schemas/ScriptInsufficientStorageError' + $ref: '#/components/schemas/ProblemDetails' description: Insufficient storage summary: Create a new script tags: @@ -2480,39 +2302,32 @@ paths: content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - - $ref: '#/components/schemas/ScriptReferencedError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' - https://hivemq.com/edge/api/model/ScriptReferencedError: '#/components/schemas/ScriptReferencedError' - description: URL parameter missing + $ref: '#/components/schemas/ProblemDetails' + description: Script is referenced '404': content: application/json: schema: - $ref: '#/components/schemas/ScriptNotFoundError' + $ref: '#/components/schemas/ProblemDetails' description: Script not found '412': content: application/json: schema: - $ref: '#/components/schemas/ScriptEtagMismatchError' + $ref: '#/components/schemas/ProblemDetails' description: Script doesn't match etag '500': content: application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal Server error '503': content: application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable + $ref: '#/components/schemas/ProblemDetails' + description: Temporary not available summary: Delete a script tags: - Data Hub - Scripts @@ -2555,31 +2370,26 @@ paths: content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + $ref: '#/components/schemas/ProblemDetails' description: URL parameter missing '404': content: application/json: schema: - $ref: '#/components/schemas/ScriptNotFoundError' + $ref: '#/components/schemas/ProblemDetails' description: Script not found '500': content: application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal Server error '503': content: application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable + $ref: '#/components/schemas/ProblemDetails' + description: Temporary not available summary: Get a script tags: - Data Hub - Scripts @@ -4694,7 +4504,6 @@ components: detail: type: string errors: - deprecated: true type: array items: $ref: '#/components/schemas/Error' @@ -4859,1264 +4668,6 @@ components: description: List of result items that are returned by this endpoint items: $ref: '#/components/schemas/BehaviorPolicy' - ApiError: - allOf: - - $ref: '#/components/schemas/ProblemDetails' - - type: object - required: - - detail - - status - - type - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/BehaviorPolicyAlreadyPresentError: '#/components/schemas/BehaviorPolicyAlreadyPresentError' - https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError: '#/components/schemas/BehaviorPolicyCreationFailureError' - https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors: '#/components/schemas/BehaviorPolicyInvalidErrors' - https://hivemq.com/edge/api/model/BehaviorPolicyNotFoundError: '#/components/schemas/BehaviorPolicyNotFoundError' - https://hivemq.com/edge/api/model/BehaviorPolicyRejectedError: '#/components/schemas/BehaviorPolicyRejectedError' - https://hivemq.com/edge/api/model/BehaviorPolicyUpdateFailureError: '#/components/schemas/BehaviorPolicyUpdateFailureError' - https://hivemq.com/edge/api/model/ClientDisconnectedError: '#/components/schemas/ClientDisconnectedError' - https://hivemq.com/edge/api/model/ClientNotFoundError: '#/components/schemas/ClientNotFoundError' - https://hivemq.com/edge/api/model/DataPolicyAlreadyPresentError: '#/components/schemas/DataPolicyAlreadyPresentError' - https://hivemq.com/edge/api/model/DataPolicyCreationFailureError: '#/components/schemas/DataPolicyCreationFailureError' - https://hivemq.com/edge/api/model/DataPolicyInvalidErrors: '#/components/schemas/DataPolicyInvalidErrors' - https://hivemq.com/edge/api/model/DataPolicyNotFoundError: '#/components/schemas/DataPolicyNotFoundError' - https://hivemq.com/edge/api/model/DataPolicyRejectedError: '#/components/schemas/DataPolicyRejectedError' - https://hivemq.com/edge/api/model/DataPolicyUpdateFailureError: '#/components/schemas/DataPolicyUpdateFailureError' - https://hivemq.com/edge/api/model/PolicyIdMismatchError: '#/components/schemas/PolicyIdMismatchError' - https://hivemq.com/edge/api/model/PolicyInsufficientStorageError: '#/components/schemas/PolicyInsufficientStorageError' - https://hivemq.com/edge/api/model/PolicyNotFoundError: '#/components/schemas/PolicyNotFoundError' - https://hivemq.com/edge/api/model/SchemaAlreadyPresentError: '#/components/schemas/SchemaAlreadyPresentError' - https://hivemq.com/edge/api/model/SchemaEtagMismatchError: '#/components/schemas/SchemaEtagMismatchError' - https://hivemq.com/edge/api/model/SchemaInsufficientStorageError: '#/components/schemas/SchemaInsufficientStorageError' - https://hivemq.com/edge/api/model/SchemaInvalidErrors: '#/components/schemas/SchemaInvalidErrors' - https://hivemq.com/edge/api/model/SchemaNotFoundError: '#/components/schemas/SchemaNotFoundError' - https://hivemq.com/edge/api/model/SchemaParsingFailureError: '#/components/schemas/SchemaParsingFailureError' - https://hivemq.com/edge/api/model/SchemaReferencedError: '#/components/schemas/SchemaReferencedError' - https://hivemq.com/edge/api/model/ScriptAlreadyPresentError: '#/components/schemas/ScriptAlreadyPresentError' - https://hivemq.com/edge/api/model/ScriptCreationFailureError: '#/components/schemas/ScriptCreationFailureError' - https://hivemq.com/edge/api/model/ScriptEtagMismatchError: '#/components/schemas/ScriptEtagMismatchError' - https://hivemq.com/edge/api/model/ScriptInsufficientStorageError: '#/components/schemas/ScriptInsufficientStorageError' - https://hivemq.com/edge/api/model/ScriptInvalidErrors: '#/components/schemas/ScriptInvalidErrors' - https://hivemq.com/edge/api/model/ScriptNotFoundError: '#/components/schemas/ScriptNotFoundError' - https://hivemq.com/edge/api/model/ScriptParsingFailureError: '#/components/schemas/ScriptParsingFailureError' - https://hivemq.com/edge/api/model/ScriptReferencedError: '#/components/schemas/ScriptReferencedError' - https://hivemq.com/edge/api/model/ScriptSanitationFailureError: '#/components/schemas/ScriptSanitationFailureError' - https://hivemq.com/edge/api/model/TopicFilterMismatchError: '#/components/schemas/TopicFilterMismatchError' - https://hivemq.com/edge/api/model/InsufficientStorageError: '#/components/schemas/InsufficientStorageError' - https://hivemq.com/edge/api/model/InternalServerError: '#/components/schemas/InternalServerError' - https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' - https://hivemq.com/edge/api/model/PreconditionFailedError: '#/components/schemas/PreconditionFailedError' - https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' - https://hivemq.com/edge/api/model/RequestBodyParameterMissingError: '#/components/schemas/RequestBodyParameterMissingError' - https://hivemq.com/edge/api/model/TemporaryNotAvailableError: '#/components/schemas/TemporaryNotAvailableError' - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' - BehaviorPolicyAlreadyPresentError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The behavior policy id. - example: abc - required: - - id - example: - general: - status: 409 - title: Behavior Policy Already Present - detail: The given behavior policy 'abc' is already present. - id: abc - type: https://hivemq.com/edge/api/model/BehaviorPolicyAlreadyPresentError - BehaviorPolicyCreationFailureError: - allOf: - - $ref: '#/components/schemas/ApiError' - example: - general: - status: 400 - title: Behavior Policy Creation Failed - detail: 'Behavior policy creation failed: The policy was rejected.' - type: https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError - AtLeastOneFieldMissingValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - paths: - type: array - description: The missing json paths. - items: - type: string - format: json-path - description: The json path. - example: - - $.field1 - - $.field2 - required: - - paths - example: - general: - detail: 'At least one of the fields must be present: ''$.field1'', ''$.field2''.' - paths: - - $.field1 - - $.field2 - type: https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError - ValidationError: - type: object - properties: - detail: - type: string - description: Detailed contextual description of the validation error. - type: - type: string - format: uri - description: Type of the validation error. - required: - - detail - - type - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError: '#/components/schemas/AtLeastOneFieldMissingValidationError' - https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError: '#/components/schemas/AtMostOneFunctionValidationError' - https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' - https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError: '#/components/schemas/FunctionMustBePairedValidationError' - https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError: '#/components/schemas/IllegalEventTransitionValidationError' - https://hivemq.com/edge/api/model/IllegalFunctionValidationError: '#/components/schemas/IllegalFunctionValidationError' - https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' - https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' - https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError: '#/components/schemas/InvalidFunctionOrderValidationError' - https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' - https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError: '#/components/schemas/InvalidSchemaVersionValidationError' - https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' - https://hivemq.com/edge/api/model/UnknownVariableValidationError: '#/components/schemas/UnknownVariableValidationError' - https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' - AtMostOneFunctionValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - function: - type: string - description: The function. - example: function1 - occurrences: - type: integer - format: int32 - description: The occurrences of the function. - minimum: 0 - example: 3 - paths: - type: array - items: - type: string - format: json-path - description: The json paths where the function occurs. - example: - - $.path1 - - $.path2 - - $.path3 - required: - - function - - occurrences - - paths - example: - general: - detail: The pipeline must contain at most one 'function1' function, but 3 were found at ['$.path1', '$.path2', '$.path3']. - function: function1 - occurrences: 3 - paths: - - $.path1 - - $.path2 - - $.path3 - type: https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError - EmptyFieldValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - path: - type: string - format: json-path - description: The missing field. - example: $.field - required: - - path - example: - general: - detail: Required field '$.field' is empty. - path: $.field - type: https://hivemq.com/edge/api/model/EmptyFieldValidationError - FunctionMustBePairedValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - existingFunction: - type: string - description: The existing function. - example: function1 - missingFunction: - type: string - description: The missing function. - example: function2 - required: - - existingFunction - - missingFunction - example: - general: - detail: If 'function1' function is present in the pipeline, 'function2' function must be present as well. - existingFunction: function1 - missingFunction: function2 - type: https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError - IllegalEventTransitionValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - event: - type: string - description: The event name. - example: event1 - fromState: - type: string - description: The event from state. - example: state1 - id: - type: string - description: The event id. - example: abc - path: - type: string - description: The path. - example: $.event - toState: - type: string - description: The event to state. - example: state2 - required: - - event - - fromState - - id - - path - - toState - example: - general: - detail: The transition from state 'state1' to state 'state2' on event 'event1' in '$.event' is not defined for behavior 'abc'. - event: event1 - fromState: state1 - toState: state2 - id: abc - path: $.event - type: https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError - IllegalFunctionValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - event: - type: string - description: The event name. - example: event1 - id: - type: string - description: The function id. - example: abc - path: - type: string - format: json-path - description: The json path. - example: $.event - required: - - event - - id - - path - example: - general: - detail: The function 'abc' is not allowed for event 'event1' in '$.event'. - event: event1 - id: abc - path: $.event - type: https://hivemq.com/edge/api/model/IllegalFunctionValidationError - InvalidFieldLengthValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - actualLength: - type: integer - format: int32 - description: The actual length of the field value. - example: 10 - expectedMinimumLength: - type: integer - format: int32 - description: The minimum length expected for the field value. - minimum: 0 - example: 5 - expectedMaximumLength: - type: integer - format: int32 - description: The maximum length expected for the field value. - minimum: 0 - example: 20 - path: - type: string - format: json-path - description: The invalid json path. - example: $.field - value: - type: string - description: The invalid value. - example: function transform() { return 'Hello, World!'; } - required: - - actualLength - - expectedMinimumLength - - expectedMaximumLength - - path - - value - example: - general: - detail: The length of script field '$.transform' 48 must be between 0 and 20. - actualLength: 48 - minimumLength: 0 - maximumLength: 20 - path: $.transform - value: function transform() { return 'Hello, World!'; } - type: https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError - InvalidFieldValueValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - path: - type: string - format: json-path - description: The invalid json path. - example: $.action.pipeline[1].field - value: - type: string - description: The invalid value. - example: functionDoesNotExist - required: - - path - example: - general: - detail: Referenced function does not exist. - path: $.action.pipeline[1].field - value: functionDoesNotExist - type: https://hivemq.com/edge/api/model/InvalidFieldValueValidationError - InvalidFunctionOrderValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - function: - type: string - description: The function. - example: transform - path: - type: string - format: json-path - description: The json path. - example: $.path - previousFunction: - type: string - description: The previous function. - example: init - required: - - function - - path - - previousFunction - example: - general: - detail: The operation at '$.path' with the functionId 'transform' must be after a 'init' operation. - function: transform - path: $.path - previousFunction: init - type: https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError - InvalidIdentifierValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - path: - type: string - format: json-path - description: The invalid identifier path. - example: $.id - value: - type: string - description: The invalid identifier value. - example: invalidId - required: - - path - - value - example: - general: - detail: Identifier script 'id' must begin with a letter and may only consist of lowercase letters, uppercase letters, numbers, periods, hyphens, and underscores. - path: $.id - value: invalidId - type: https://hivemq.com/edge/api/model/InvalidIdentifierValidationError - InvalidSchemaVersionValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - id: - type: string - description: The schema id. - example: abc - version: - type: string - description: The schema version. - example: '2' - required: - - id - - version - example: - general: - detail: The referenced schema with id 'abc' and version '2' was not found. - id: abc - version: '2' - type: https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError - MissingFieldValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - path: - type: string - format: json-path - description: The missing path. - example: $.id - required: - - path - example: - general: - detail: Required field '$.id' is missing. - path: $.id - type: https://hivemq.com/edge/api/model/MissingFieldValidationError - UnknownVariableValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - path: - type: string - description: The json path of the field. - example: $.path - variables: - type: array - items: - type: string - description: The unknown variables. - example: - - a - - b - - c - required: - - path - - variables - example: - general: - detail: 'Field ''$.path'' contains unknown variables: [a, b, c].' - path: $.path - variables: - - a - - b - - c - type: https://hivemq.com/edge/api/model/UnknownVariableValidationError - UnsupportedFieldValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - actualValue: - type: string - description: The actual value. - expectedValue: - type: string - description: The expected value. - path: - type: string - format: json-path - description: The json path. - example: $.id - required: - - actualValue - - expectedValue - - path - example: - general: - detail: Unsupported type 'String' for field '$.id'. Expected type is 'Object'. - actualValue: String - expectedValue: Object - path: $.id - type: https://hivemq.com/edge/api/model/UnsupportedFieldValidationError - BehaviorPolicyValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - oneOf: - - $ref: '#/components/schemas/IllegalEventTransitionValidationError' - - $ref: '#/components/schemas/IllegalFunctionValidationError' - - $ref: '#/components/schemas/InvalidSchemaVersionValidationError' - - $ref: '#/components/schemas/AtLeastOneFieldMissingValidationError' - - $ref: '#/components/schemas/EmptyFieldValidationError' - - $ref: '#/components/schemas/InvalidFieldLengthValidationError' - - $ref: '#/components/schemas/InvalidFieldValueValidationError' - - $ref: '#/components/schemas/InvalidIdentifierValidationError' - - $ref: '#/components/schemas/MissingFieldValidationError' - - $ref: '#/components/schemas/UnsupportedFieldValidationError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError: '#/components/schemas/AtLeastOneFieldMissingValidationError' - https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' - https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError: '#/components/schemas/IllegalEventTransitionValidationError' - https://hivemq.com/edge/api/model/IllegalFunctionValidationError: '#/components/schemas/IllegalFunctionValidationError' - https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' - https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' - https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' - https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError: '#/components/schemas/InvalidSchemaVersionValidationError' - https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' - https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' - BehaviorPolicyInvalidErrors: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - childErrors: - type: array - description: List of child validation errors. - items: - $ref: '#/components/schemas/BehaviorPolicyValidationError' - required: - - childErrors - example: - general: - status: 400 - title: Behavior Policy Invalid - detail: Behavior policy is invalid due to validation errors. - type: https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors - childErrors: - - detail: The transition from state 'state1' to state 'state2' on event 'event1' in '$.path' is not defined for behavior 'id1'. - fromState: state1 - toState: state2 - path: $.path - id: id1 - type: https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError - BehaviorPolicyNotFoundError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The data policy id. - example: abc - required: - - id - example: - general: - status: 404 - title: Behavior Policy Not Found - detail: Behavior policy with ID 'abc' is not found. - id: abc - type: https://hivemq.com/edge/api/model/BehaviorPolicyNotFoundError - BehaviorPolicyRejectedError: - allOf: - - $ref: '#/components/schemas/ApiError' - example: - general: - status: 400 - title: Behavior Policy Rejected - detail: Behavior policy is rejected. - type: https://hivemq.com/edge/api/model/BehaviorPolicyRejectedError - BehaviorPolicyUpdateFailureError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The ID of the policy that failed to update. - example: abc - required: - - id - example: - general: - status: 400 - title: Behavior Policy Update Failed - detail: Behavior policy with ID 'abc' update failed. - id: abc - type: https://hivemq.com/edge/api/model/BehaviorPolicyUpdateFailureError - ClientDisconnectedError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The client id. - example: abc - required: - - id - example: - general: - status: 404 - title: Client Disconnected - detail: Client with ID 'abc' is disconnected. - id: abc - type: https://hivemq.com/edge/api/model/ClientDisconnectedError - ClientNotFoundError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The client id. - example: abc - required: - - id - example: - general: - status: 404 - title: Client Not Found - detail: Client with ID 'abc' is not found. - id: abc - type: https://hivemq.com/edge/api/model/ClientNotFoundError - DataPolicyAlreadyPresentError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The data policy id. - example: abc - required: - - id - example: - general: - status: 409 - title: Data Policy Already Present - detail: The given data policy 'abc' is already present. - id: abc - type: https://hivemq.com/edge/api/model/DataPolicyAlreadyPresentError - DataPolicyCreationFailureError: - allOf: - - $ref: '#/components/schemas/ApiError' - example: - general: - status: 400 - title: Data Policy Creation Failed - detail: 'Data policy creation failed: The policy was rejected.' - type: https://hivemq.com/edge/api/model/DataPolicyCreationFailureError - DataPolicyValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - oneOf: - - $ref: '#/components/schemas/AtMostOneFunctionValidationError' - - $ref: '#/components/schemas/FunctionMustBePairedValidationError' - - $ref: '#/components/schemas/InvalidFunctionOrderValidationError' - - $ref: '#/components/schemas/InvalidSchemaVersionValidationError' - - $ref: '#/components/schemas/UnknownVariableValidationError' - - $ref: '#/components/schemas/EmptyFieldValidationError' - - $ref: '#/components/schemas/InvalidFieldLengthValidationError' - - $ref: '#/components/schemas/InvalidFieldValueValidationError' - - $ref: '#/components/schemas/InvalidIdentifierValidationError' - - $ref: '#/components/schemas/MissingFieldValidationError' - - $ref: '#/components/schemas/UnsupportedFieldValidationError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError: '#/components/schemas/AtMostOneFunctionValidationError' - https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' - https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError: '#/components/schemas/FunctionMustBePairedValidationError' - https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' - https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' - https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError: '#/components/schemas/InvalidFunctionOrderValidationError' - https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' - https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError: '#/components/schemas/InvalidSchemaVersionValidationError' - https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' - https://hivemq.com/edge/api/model/UnknownVariableValidationError: '#/components/schemas/UnknownVariableValidationError' - https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' - DataPolicyInvalidErrors: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - childErrors: - type: array - description: List of child validation errors. - items: - $ref: '#/components/schemas/DataPolicyValidationError' - required: - - childErrors - example: - general: - status: 400 - title: Data Policy Invalid - detail: Data policy is invalid due to validation errors. - type: https://hivemq.com/edge/api/model/DataPolicyInvalidErrors - childErrors: - - detail: The pipeline must contain at most one 'function1' function, but 3 were found at ['$.path1', '$.path2', '$.path3']. - function: function1 - occurrences: 3 - paths: - - $.path1 - - $.path2 - - $.path3 - type: https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError - DataPolicyNotFoundError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The data policy id. - example: abc - required: - - id - example: - general: - status: 404 - title: Data Policy Not Found - detail: Data policy with ID 'abc' is not found. - id: abc - type: https://hivemq.com/edge/api/model/DataPolicyNotFoundError - DataPolicyRejectedError: - allOf: - - $ref: '#/components/schemas/ApiError' - example: - general: - status: 400 - title: Data Policy Rejected - detail: Data policy is rejected. - type: https://hivemq.com/edge/api/model/DataPolicyRejectedError - DataPolicyUpdateFailureError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The ID of the policy that failed to update. - example: abc - required: - - id - example: - general: - status: 400 - title: Data Policy Update Failed - detail: Data policy with ID 'abc' update failed. - id: abc - type: https://hivemq.com/edge/api/model/DataPolicyUpdateFailureError - PolicyIdMismatchError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - actualId: - type: string - description: The actual id. - example: id1 - expectedId: - type: string - description: The expected id. - example: id2 - required: - - actualId - - expectedId - example: - general: - status: 400 - title: Policy ID Mismatch - detail: The policy ID 'id1' in the request parameter does not match the policy ID 'id2' in the policy request body. - id: abc - type: https://hivemq.com/edge/api/model/PolicyIdMismatchError - PolicyInsufficientStorageError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The policy id. - example: abc - required: - - id - example: - general: - status: 507 - title: Policy Insufficient Storage - detail: Policy with ID '123' could not be added because of insufficient server storage. - id: abc - type: https://hivemq.com/edge/api/model/PolicyInsufficientStorageError - PolicyNotFoundError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The policy id. - example: abc - required: - - id - example: - general: - status: 404 - title: Policy Not Found - detail: Policy with ID 'abc' is not found. - id: abc - type: https://hivemq.com/edge/api/model/PolicyNotFoundError - SchemaAlreadyPresentError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The schema id. - example: abc - required: - - id - example: - general: - status: 409 - title: Schema Already Present - detail: The given schema is already present as the latest version for the schema id 'abc'. - id: abc - type: https://hivemq.com/edge/api/model/SchemaAlreadyPresentError - SchemaEtagMismatchError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The schema id. - example: abc - eTag: - type: string - description: The eTag. - example: 33a64df551425fcc55e4d42a148795d9f25f89d4 - required: - - id - example: - general: - status: 412 - title: Schema eTag Mismatch - detail: Schema with id 'abc' does not match the given etag '33a64df551425fcc55e4d42a148795d9f25f89d4'. - id: abc - eTag: 33a64df551425fcc55e4d42a148795d9f25f89d4 - type: https://hivemq.com/edge/api/model/SchemaEtagMismatchError - SchemaInsufficientStorageError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The policy id. - example: abc - required: - - id - example: - general: - status: 507 - title: Schema Insufficient Storage - detail: Schema with ID '123' could not be added because of insufficient server storage. - id: abc - type: https://hivemq.com/edge/api/model/SchemaInsufficientStorageError - SchemaValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - oneOf: - - $ref: '#/components/schemas/EmptyFieldValidationError' - - $ref: '#/components/schemas/InvalidFieldLengthValidationError' - - $ref: '#/components/schemas/InvalidFieldValueValidationError' - - $ref: '#/components/schemas/InvalidIdentifierValidationError' - - $ref: '#/components/schemas/MissingFieldValidationError' - - $ref: '#/components/schemas/UnsupportedFieldValidationError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' - https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' - https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' - https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' - https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' - https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' - SchemaInvalidErrors: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - childErrors: - type: array - description: List of child validation errors. - items: - $ref: '#/components/schemas/SchemaValidationError' - required: - - childErrors - example: - general: - status: 400 - title: Schema Invalid - detail: Schema is invalid due to validation errors. - type: https://hivemq.com/edge/api/model/SchemaInvalidErrors - childErrors: - - detail: The length of script field '$.id' 1025 must be between 0 and 1024. - paths: $.id - value: aaa...aaa - actualLength: 1025 - expectedMinimumLength: 0 - expectedMaximumLength: 1024 - type: https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError - SchemaNotFoundError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The schema ID. - example: abc - required: - - id - example: - general: - status: 404 - title: Schema Not Found - detail: Schema with ID 'abc' is not found. - id: abc - type: https://hivemq.com/edge/api/model/SchemaNotFoundError - SchemaParsingFailureError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - alias: - type: string - description: The schema alias. - example: abc - required: - - alias - example: - general: - status: 400 - title: Schema Parsing Failure - detail: The given schema 'abc' could not be parsed. - alias: abc - type: https://hivemq.com/edge/api/model/SchemaParsingFailureError - SchemaReferencedError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The schema ID. - example: abc - required: - - id - example: - general: - status: 400 - title: Schema Referenced - detail: Schema with ID 'abc' is referenced. - id: abc - type: https://hivemq.com/edge/api/model/SchemaReferencedError - ScriptAlreadyPresentError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The script id. - example: abc - required: - - id - example: - general: - status: 409 - title: Script Already Present - detail: The given script 'abc' is already present. - id: abc - type: https://hivemq.com/edge/api/model/ScriptAlreadyPresentError - ScriptCreationFailureError: - allOf: - - $ref: '#/components/schemas/ApiError' - example: - general: - status: 400 - title: Script Creation Failure - detail: The given script could not be created. - type: https://hivemq.com/edge/api/model/ScriptCreationFailureError - ScriptEtagMismatchError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The script id. - example: abc - eTag: - type: string - description: The eTag. - example: 33a64df551425fcc55e4d42a148795d9f25f89d4 - required: - - id - example: - general: - status: 412 - title: Script eTag Mismatch - detail: Script with id 'abc' does not match the given etag '33a64df551425fcc55e4d42a148795d9f25f89d4'. - id: abc - eTag: 33a64df551425fcc55e4d42a148795d9f25f89d4 - type: https://hivemq.com/edge/api/model/ScriptEtagMismatchError - ScriptInsufficientStorageError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The policy id. - example: abc - required: - - id - example: - general: - status: 507 - title: Script Insufficient Storage - detail: Script with ID '123' could not be added because of insufficient server storage. - id: abc - type: https://hivemq.com/edge/api/model/ScriptInsufficientStorageError - ScriptValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - oneOf: - - $ref: '#/components/schemas/InvalidFieldLengthValidationError' - - $ref: '#/components/schemas/InvalidFieldValueValidationError' - - $ref: '#/components/schemas/InvalidIdentifierValidationError' - - $ref: '#/components/schemas/MissingFieldValidationError' - - $ref: '#/components/schemas/UnsupportedFieldValidationError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' - https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' - https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' - https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' - https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' - ScriptInvalidErrors: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - childErrors: - type: array - description: List of child validation errors. - items: - $ref: '#/components/schemas/ScriptValidationError' - required: - - childErrors - example: - general: - status: 400 - title: Script Invalid - detail: Script is invalid due to validation errors. - type: https://hivemq.com/edge/api/model/ScriptInvalidErrors - childErrors: - - detail: The length of script field '$.id' 1025 must be between 0 and 1024. - paths: $.id - value: aaa...aaa - actualLength: 1025 - expectedMinimumLength: 0 - expectedMaximumLength: 1024 - type: https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError - ScriptNotFoundError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The script ID. - example: abc - required: - - id - example: - general: - status: 404 - title: Script Not Found - detail: Script with ID 'abc' is not found. - id: abc - type: https://hivemq.com/edge/api/model/ScriptNotFoundError - ScriptParsingFailureError: - allOf: - - $ref: '#/components/schemas/ApiError' - example: - general: - status: 400 - title: Script Parsing Failure - detail: The given script 'abc' could not be parsed. - type: https://hivemq.com/edge/api/model/ScriptParsingFailureError - ScriptReferencedError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The script ID. - example: abc - required: - - id - example: - general: - status: 400 - title: Script Referenced - detail: Script with ID 'abc' is referenced. - id: abc - type: https://hivemq.com/edge/api/model/ScriptReferencedError - ScriptSanitationFailureError: - allOf: - - $ref: '#/components/schemas/ApiError' - example: - general: - status: 400 - title: Script Sanitation Failure - detail: The given script could not be sanitized. - type: https://hivemq.com/edge/api/model/ScriptSanitationFailureError - TopicFilterMismatchError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - path: - type: string - description: The json path of the topic filter. - example: $.filter - required: - - path - example: - general: - status: 400 - title: Topic Filter Mismatch - detail: The topic filter '$.filter' mismatches. - type: https://hivemq.com/edge/api/model/TopicFilterMismatchError - InsufficientStorageError: - allOf: - - $ref: '#/components/schemas/ApiError' - example: - general: - status: 507 - title: Insufficient Storage - detail: Insufficient Storage. - type: https://hivemq.com/edge/api/model/InsufficientStorageError - InternalServerError: - allOf: - - $ref: '#/components/schemas/ApiError' - example: - general: - status: 500 - title: Internal Server Error - detail: An unexpected error occurred, check the logs. - type: https://hivemq.com/edge/api/model/InternalServerError - creation: - status: 500 - title: Internal Server Error - detail: 'An unexpected error occurred: Exception during creation of the Json Schema for functions.' - type: https://hivemq.com/edge/api/model/InternalServerError - InvalidQueryParameterError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - parameter: - type: string - description: The query parameter. - required: - - parameter - example: - general: - status: 400 - title: Query Parameter is Invalid - detail: 'Query parameter ''a'' is invalid: ''a'' could not be parsed.' - parameter: a - type: https://hivemq.com/edge/api/model/InvalidQueryParameterError - PreconditionFailedError: - allOf: - - $ref: '#/components/schemas/ApiError' - example: - general: - status: 412 - title: Precondition Failed - detail: 'A precondition required for fulfilling the request was not fulfilled: Policy does not match the given etag ''abc''.' - type: https://hivemq.com/edge/api/model/PreconditionFailedError - RequestBodyMissingError: - allOf: - - $ref: '#/components/schemas/ApiError' - example: - general: - status: 400 - title: Required Request Body Missing - detail: Required request body is missing. - type: https://hivemq.com/edge/api/model/RequestBodyMissingError - RequestBodyParameterMissingError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - parameter: - type: string - description: The the missing request body parameter. - required: - - parameter - example: - general: - status: 400 - title: Required Request Body Parameter Missing - detail: Required request body parameter 'a' is missing. - parameter: a - type: https://hivemq.com/edge/api/model/RequestBodyParameterMissingError - TemporaryNotAvailableError: - allOf: - - $ref: '#/components/schemas/ApiError' - example: - general: - status: 503 - title: Endpoint Temporarily not Available - detail: The endpoint is temporarily not available, please try again later. - type: https://hivemq.com/edge/api/model/TemporaryNotAvailableError - UrlParameterMissingError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - parameter: - type: string - description: The name of the missing parameter. - required: - - parameter - example: - general: - status: 400 - title: Required URL Parameter Missing - detail: Required URL parameter 'a' is missing. - parameter: a - type: https://hivemq.com/edge/api/model/UrlParameterMissingError JsonNode: type: object description: The arguments of the fsm derived from the behavior policy. @@ -6238,6 +4789,8 @@ components: description: List of result items that are returned by this endpoint items: $ref: '#/components/schemas/DataPolicy' + Errors: + type: object PolicyType: description: The type of policy in Data Hub type: string diff --git a/ext/hivemq-edge-openapi-2025.12.yaml b/ext/hivemq-edge-openapi-2025.12.yaml index 5df1f0bc7c..d89fb88f34 100644 --- a/ext/hivemq-edge-openapi-2025.12.yaml +++ b/ext/hivemq-edge-openapi-2025.12.yaml @@ -14,7 +14,7 @@ info: ## OpenAPI HiveMQ's REST API provides an OpenAPI 3.0 schema definition that can imported into popular API tooling (e.g. Postman) or can be used to generate client-code for multiple programming languages. title: HiveMQ Edge REST API - version: 2025.12-SNAPSHOT + version: 2025.10-SNAPSHOT x-logo: url: https://www.hivemq.com/img/svg/hivemq-bee.svg tags: @@ -354,23 +354,12 @@ paths: schema: $ref: '#/components/schemas/BehaviorPolicyList' description: Success - '400': - content: - application/problem+json: - schema: - oneOf: - - $ref: '#/components/schemas/InvalidQueryParameterError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' - description: URL parameter missing '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable + $ref: '#/components/schemas/ProblemDetails' + description: Temporarily not available summary: Get all policies tags: - Data Hub - Behavior Policies @@ -455,45 +444,34 @@ paths: description: Success '400': content: - application/problem+json: - schema: - oneOf: - - $ref: '#/components/schemas/BehaviorPolicyCreationFailureError' - - $ref: '#/components/schemas/BehaviorPolicyInvalidErrors' - - $ref: '#/components/schemas/BehaviorPolicyRejectedError' - - $ref: '#/components/schemas/RequestBodyMissingError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError: '#/components/schemas/BehaviorPolicyCreationFailureError' - https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors: '#/components/schemas/BehaviorPolicyInvalidErrors' - https://hivemq.com/edge/api/model/BehaviorPolicyRejectedError: '#/components/schemas/BehaviorPolicyRejectedError' - https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' description: Policy creation failed '409': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/BehaviorPolicyAlreadyPresentError' - description: Behavior policy already present + $ref: '#/components/schemas/ProblemDetails' + description: Already exists '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' - description: Internal server error + $ref: '#/components/schemas/ProblemDetails' + description: Internal error '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable + $ref: '#/components/schemas/ProblemDetails' + description: Temporarily unavailable '507': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/PolicyInsufficientStorageError' - description: Insufficient storage + $ref: '#/components/schemas/ProblemDetails' + description: Insufficient storage error summary: Create a new policy tags: - Data Hub - Behavior Policies @@ -523,39 +501,34 @@ paths: description: Success, no response body '400': content: - application/problem+json: + application/json: schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + $ref: '#/components/schemas/ProblemDetails' description: URL parameter missing '404': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/PolicyNotFoundError' - description: Behavior policy not found + $ref: '#/components/schemas/ProblemDetails' + description: Policy not found '412': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/PreconditionFailedError' + $ref: '#/components/schemas/ProblemDetails' description: Precondition failed '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' - description: Internal server error + $ref: '#/components/schemas/ProblemDetails' + description: Internal error '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable + $ref: '#/components/schemas/ProblemDetails' + description: Temporarily not available summary: Delete a behavior policy tags: - Data Hub - Behavior Policies @@ -623,33 +596,16 @@ paths: description: Success '400': content: - application/problem+json: + application/json: schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' - description: Bad request + $ref: '#/components/schemas/ProblemDetails' + description: Invalid query parameter '404': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/BehaviorPolicyNotFoundError' + $ref: '#/components/schemas/ProblemDetails' description: Policy not found - '500': - content: - application/problem+json: - schema: - $ref: '#/components/schemas/InternalServerError' - description: Internal server error - '503': - content: - application/problem+json: - schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable summary: Get a policy tags: - Data Hub - Behavior Policies @@ -750,56 +706,41 @@ paths: description: Success '400': content: - application/problem+json: - schema: - oneOf: - - $ref: '#/components/schemas/RequestBodyMissingError' - - $ref: '#/components/schemas/UrlParameterMissingError' - - $ref: '#/components/schemas/BehaviorPolicyCreationFailureError' - - $ref: '#/components/schemas/BehaviorPolicyInvalidErrors' - - $ref: '#/components/schemas/BehaviorPolicyUpdateFailureError' - - $ref: '#/components/schemas/PolicyIdMismatchError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' - https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError: '#/components/schemas/BehaviorPolicyCreationFailureError' - https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors: '#/components/schemas/BehaviorPolicyInvalidErrors' - https://hivemq.com/edge/api/model/BehaviorPolicyUpdateFailureError: '#/components/schemas/BehaviorPolicyUpdateFailureError' - https://hivemq.com/edge/api/model/PolicyIdMismatchError: '#/components/schemas/PolicyIdMismatchError' - description: Behavior policy creation failed + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: Policy creation failed '404': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/BehaviorPolicyNotFoundError' - description: Data policy not found + $ref: '#/components/schemas/ProblemDetails' + description: Policy not found '412': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/PreconditionFailedError' + $ref: '#/components/schemas/ProblemDetails' description: Precondition failed '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' - description: Internal server error + $ref: '#/components/schemas/ProblemDetails' + description: Internal error '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable + $ref: '#/components/schemas/ProblemDetails' + description: Temporarily unavailable '507': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/PolicyInsufficientStorageError' - description: Insufficient storage - summary: Update an existing behavior policy + $ref: '#/components/schemas/ProblemDetails' + description: Insufficient storage error + summary: Update an existing policy tags: - Data Hub - Behavior Policies /api/v1/data-hub/behavior-validation/states/{clientId}: @@ -843,34 +784,22 @@ paths: description: Success '400': content: - application/problem+json: + application/json: schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + $ref: '#/components/schemas/ProblemDetails' description: URL parameter missing '404': content: - application/problem+json: - schema: - oneOf: - - $ref: '#/components/schemas/ClientDisconnectedError' - - $ref: '#/components/schemas/ClientNotFoundError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/ClientDisconnectedError: '#/components/schemas/ClientDisconnectedError' - https://hivemq.com/edge/api/model/ClientNotFoundError: '#/components/schemas/ClientNotFoundError' - description: Client error + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: Client is disconnected '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' - description: Internal server error + $ref: '#/components/schemas/ProblemDetails' + description: Internal Server error summary: Get the state of a client tags: - Data Hub - State @@ -1119,20 +1048,27 @@ paths: description: Success '400': content: - application/problem+json: + application/json: schema: - oneOf: - - $ref: '#/components/schemas/InvalidQueryParameterError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' + $ref: '#/components/schemas/ProblemDetails' description: URL parameter missing + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: DataPolicy not found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: Internal server error '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' + $ref: '#/components/schemas/ProblemDetails' description: Request resource temporary unavailable summary: Get all data policies tags: @@ -1216,44 +1152,33 @@ paths: description: Success '400': content: - application/problem+json: - schema: - oneOf: - - $ref: '#/components/schemas/RequestBodyMissingError' - - $ref: '#/components/schemas/DataPolicyCreationFailureError' - - $ref: '#/components/schemas/DataPolicyInvalidErrors' - - $ref: '#/components/schemas/DataPolicyRejectedError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' - https://hivemq.com/edge/api/model/DataPolicyCreationFailureError: '#/components/schemas/DataPolicyCreationFailureError' - https://hivemq.com/edge/api/model/DataPolicyInvalidErrors: '#/components/schemas/DataPolicyInvalidErrors' - https://hivemq.com/edge/api/model/DataPolicyRejectedError: '#/components/schemas/DataPolicyRejectedError' - description: Data policy creation failed + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: DataPolicy creation failed '409': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/DataPolicyAlreadyPresentError' - description: Data policy already present + $ref: '#/components/schemas/ProblemDetails' + description: DataPolicy already present '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' + $ref: '#/components/schemas/ProblemDetails' description: Request resource temporary unavailable '507': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/PolicyInsufficientStorageError' + $ref: '#/components/schemas/ProblemDetails' description: Insufficient storage summary: Create a new data policy tags: @@ -1284,38 +1209,27 @@ paths: description: Success, no response body '400': content: - application/problem+json: + application/json: schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + $ref: '#/components/schemas/ProblemDetails' description: URL parameter missing '404': content: - application/problem+json: - schema: - $ref: '#/components/schemas/PolicyNotFoundError' - description: Data policy not found - '412': - content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/PreconditionFailedError' - description: Precondition failed + $ref: '#/components/schemas/ProblemDetails' + description: DataPolicy not found '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' + $ref: '#/components/schemas/ProblemDetails' description: Request resource temporary unavailable summary: Delete a data policy tags: @@ -1383,33 +1297,32 @@ paths: description: Success '400': content: - application/problem+json: + application/json: + examples: + param-missing: + description: Example response when a required parameter is missing. + summary: Required URL parameter missing + value: + errors: + - title: Required parameter missing + detail: Required URL parameter 'parameterName' is missing schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + $ref: '#/components/schemas/ProblemDetails' description: Bad request '404': content: - application/problem+json: + application/json: + examples: + not-found: + description: Policy not found + summary: Not found + value: + errors: + - title: Resource not found + detail: Resource with id 'my-resource-id' not found schema: - $ref: '#/components/schemas/PolicyNotFoundError' + $ref: '#/components/schemas/ProblemDetails' description: Resource not found - '500': - content: - application/problem+json: - schema: - $ref: '#/components/schemas/InternalServerError' - description: Internal server error - '503': - content: - application/problem+json: - schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable summary: Get a data policy tags: - Data Hub - Data Policies @@ -1509,56 +1422,33 @@ paths: description: Success '400': content: - application/problem+json: - schema: - oneOf: - - $ref: '#/components/schemas/RequestBodyMissingError' - - $ref: '#/components/schemas/UrlParameterMissingError' - - $ref: '#/components/schemas/DataPolicyCreationFailureError' - - $ref: '#/components/schemas/DataPolicyInvalidErrors' - - $ref: '#/components/schemas/DataPolicyUpdateFailureError' - - $ref: '#/components/schemas/PolicyIdMismatchError' - - $ref: '#/components/schemas/TopicFilterMismatchError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' - https://hivemq.com/edge/api/model/DataPolicyCreationFailureError: '#/components/schemas/DataPolicyCreationFailureError' - https://hivemq.com/edge/api/model/DataPolicyInvalidErrors: '#/components/schemas/DataPolicyInvalidErrors' - https://hivemq.com/edge/api/model/DataPolicyUpdateFailureError: '#/components/schemas/DataPolicyUpdateFailureError' - https://hivemq.com/edge/api/model/PolicyIdMismatchError: '#/components/schemas/PolicyIdMismatchError' - https://hivemq.com/edge/api/model/TopicFilterMismatchError: '#/components/schemas/TopicFilterMismatchError' - description: Data policy creation failed - '404': - content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/DataPolicyNotFoundError' - description: Data policy not found - '412': + $ref: '#/components/schemas/ProblemDetails' + description: DataPolicy creation failed + '404': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/PreconditionFailedError' - description: Precondition failed + $ref: '#/components/schemas/ProblemDetails' + description: DataPolicy not found '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' + $ref: '#/components/schemas/ProblemDetails' description: Request resource temporary unavailable '507': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/PolicyInsufficientStorageError' + $ref: '#/components/schemas/ProblemDetails' description: Insufficient storage summary: Update an existing data policy tags: @@ -1644,9 +1534,9 @@ paths: description: Success '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/Errors' description: Internal server error summary: Get all FSMs as a JSON Schema tags: @@ -1806,9 +1696,9 @@ paths: description: Success '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error summary: Get all functions as a JSON Schema tags: @@ -1826,9 +1716,9 @@ paths: description: Success '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error summary: Get all interpolation variables tags: @@ -1846,9 +1736,9 @@ paths: description: Success '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error summary: Get all functions as a list of function specifications tags: @@ -1983,22 +1873,11 @@ paths: schema: $ref: '#/components/schemas/SchemaList' description: Success - '400': - content: - application/problem+json: - schema: - oneOf: - - $ref: '#/components/schemas/InvalidQueryParameterError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' - description: URL parameter missing '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' + $ref: '#/components/schemas/ProblemDetails' description: Request resource temporary unavailable summary: Get all schemas tags: @@ -2045,48 +1924,33 @@ paths: description: Success '400': content: - application/problem+json: - schema: - oneOf: - - $ref: '#/components/schemas/RequestBodyParameterMissingError' - - $ref: '#/components/schemas/SchemaInvalidErrors' - - $ref: '#/components/schemas/SchemaParsingFailureError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/RequestBodyParameterMissingError: '#/components/schemas/RequestBodyParameterMissingError' - https://hivemq.com/edge/api/model/SchemaInvalidErrors: '#/components/schemas/SchemaInvalidErrors' - https://hivemq.com/edge/api/model/SchemaParsingFailureError: '#/components/schemas/SchemaParsingFailureError' - description: Schema creation failed + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: Schema could not be validatetd '409': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/SchemaAlreadyPresentError' - description: Schema is already present + $ref: '#/components/schemas/ProblemDetails' + description: Schema already exists '412': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/SchemaEtagMismatchError' - description: Schema doesn't match etag + $ref: '#/components/schemas/ProblemDetails' + description: Mismatch between schema and etag '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error - '503': - content: - application/problem+json: - schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable '507': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/SchemaInsufficientStorageError' + $ref: '#/components/schemas/ProblemDetails' description: Insufficient storage summary: Create a new schema tags: @@ -2117,40 +1981,33 @@ paths: description: Success, no response body '400': content: - application/problem+json: + application/json: schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - - $ref: '#/components/schemas/SchemaReferencedError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' - https://hivemq.com/edge/api/model/SchemaReferencedError: '#/components/schemas/SchemaReferencedError' - description: URL parameter missing + $ref: '#/components/schemas/ProblemDetails' + description: Schema referenced '404': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/SchemaNotFoundError' + $ref: '#/components/schemas/ProblemDetails' description: Schema not found '412': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/SchemaEtagMismatchError' - description: Schema doesn't match etag + $ref: '#/components/schemas/ProblemDetails' + description: Mismatch between schema and etag '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' - description: Internal Server error + $ref: '#/components/schemas/ProblemDetails' + description: Internal server error '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' + $ref: '#/components/schemas/ProblemDetails' description: Request resource temporary unavailable summary: Delete all versions of the schema tags: @@ -2196,33 +2053,22 @@ paths: description: Success '400': content: - application/problem+json: + application/json: schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' - description: URL parameter missing + $ref: '#/components/schemas/ProblemDetails' + description: A url parameter is missing '404': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/SchemaNotFoundError' + $ref: '#/components/schemas/ProblemDetails' description: Schema not found '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error - '503': - content: - application/problem+json: - schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable summary: Get a schema tags: - Data Hub - Schemas @@ -2343,23 +2189,12 @@ paths: schema: $ref: '#/components/schemas/ScriptList' description: Success - '400': - content: - application/problem+json: - schema: - oneOf: - - $ref: '#/components/schemas/InvalidQueryParameterError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' - description: URL parameter missing '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable + $ref: '#/components/schemas/ProblemDetails' + description: Temporary not available summary: Get all scripts tags: - Data Hub - Scripts @@ -2405,52 +2240,39 @@ paths: description: Success '400': content: - application/problem+json: - schema: - oneOf: - - $ref: '#/components/schemas/RequestBodyParameterMissingError' - - $ref: '#/components/schemas/ScriptCreationFailureError' - - $ref: '#/components/schemas/ScriptInvalidErrors' - - $ref: '#/components/schemas/ScriptParsingFailureError' - - $ref: '#/components/schemas/ScriptSanitationFailureError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/RequestBodyParameterMissingError: '#/components/schemas/RequestBodyParameterMissingError' - https://hivemq.com/edge/api/model/ScriptCreationFailureError: '#/components/schemas/ScriptCreationFailureError' - https://hivemq.com/edge/api/model/ScriptInvalidErrors: '#/components/schemas/ScriptInvalidErrors' - https://hivemq.com/edge/api/model/ScriptParsingFailureError: '#/components/schemas/ScriptParsingFailureError' - https://hivemq.com/edge/api/model/ScriptSanitationFailureError: '#/components/schemas/ScriptSanitationFailureError' - description: Script creation failed + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: Script is invalid '409': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/ScriptAlreadyPresentError' + $ref: '#/components/schemas/ProblemDetails' description: Script is already present '412': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/ScriptEtagMismatchError' + $ref: '#/components/schemas/ProblemDetails' description: Script doesn't match etag '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable + $ref: '#/components/schemas/ProblemDetails' + description: Temporary not available '507': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/ScriptInsufficientStorageError' + $ref: '#/components/schemas/ProblemDetails' description: Insufficient storage summary: Create a new script tags: @@ -2478,41 +2300,34 @@ paths: description: Success, no response body '400': content: - application/problem+json: + application/json: schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - - $ref: '#/components/schemas/ScriptReferencedError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' - https://hivemq.com/edge/api/model/ScriptReferencedError: '#/components/schemas/ScriptReferencedError' - description: URL parameter missing + $ref: '#/components/schemas/ProblemDetails' + description: Script is referenced '404': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/ScriptNotFoundError' + $ref: '#/components/schemas/ProblemDetails' description: Script not found '412': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/ScriptEtagMismatchError' + $ref: '#/components/schemas/ProblemDetails' description: Script doesn't match etag '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal Server error '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable + $ref: '#/components/schemas/ProblemDetails' + description: Temporary not available summary: Delete a script tags: - Data Hub - Scripts @@ -2553,33 +2368,28 @@ paths: description: Success '400': content: - application/problem+json: + application/json: schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + $ref: '#/components/schemas/ProblemDetails' description: URL parameter missing '404': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/ScriptNotFoundError' + $ref: '#/components/schemas/ProblemDetails' description: Script not found '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal Server error '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable + $ref: '#/components/schemas/ProblemDetails' + description: Temporary not available summary: Get a script tags: - Data Hub - Scripts @@ -4700,7 +4510,6 @@ components: detail: type: string errors: - deprecated: true type: array items: $ref: '#/components/schemas/Error' @@ -4865,1264 +4674,6 @@ components: description: List of result items that are returned by this endpoint items: $ref: '#/components/schemas/BehaviorPolicy' - ApiError: - allOf: - - $ref: '#/components/schemas/ProblemDetails' - - type: object - required: - - detail - - status - - type - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/BehaviorPolicyAlreadyPresentError: '#/components/schemas/BehaviorPolicyAlreadyPresentError' - https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError: '#/components/schemas/BehaviorPolicyCreationFailureError' - https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors: '#/components/schemas/BehaviorPolicyInvalidErrors' - https://hivemq.com/edge/api/model/BehaviorPolicyNotFoundError: '#/components/schemas/BehaviorPolicyNotFoundError' - https://hivemq.com/edge/api/model/BehaviorPolicyRejectedError: '#/components/schemas/BehaviorPolicyRejectedError' - https://hivemq.com/edge/api/model/BehaviorPolicyUpdateFailureError: '#/components/schemas/BehaviorPolicyUpdateFailureError' - https://hivemq.com/edge/api/model/ClientDisconnectedError: '#/components/schemas/ClientDisconnectedError' - https://hivemq.com/edge/api/model/ClientNotFoundError: '#/components/schemas/ClientNotFoundError' - https://hivemq.com/edge/api/model/DataPolicyAlreadyPresentError: '#/components/schemas/DataPolicyAlreadyPresentError' - https://hivemq.com/edge/api/model/DataPolicyCreationFailureError: '#/components/schemas/DataPolicyCreationFailureError' - https://hivemq.com/edge/api/model/DataPolicyInvalidErrors: '#/components/schemas/DataPolicyInvalidErrors' - https://hivemq.com/edge/api/model/DataPolicyNotFoundError: '#/components/schemas/DataPolicyNotFoundError' - https://hivemq.com/edge/api/model/DataPolicyRejectedError: '#/components/schemas/DataPolicyRejectedError' - https://hivemq.com/edge/api/model/DataPolicyUpdateFailureError: '#/components/schemas/DataPolicyUpdateFailureError' - https://hivemq.com/edge/api/model/PolicyIdMismatchError: '#/components/schemas/PolicyIdMismatchError' - https://hivemq.com/edge/api/model/PolicyInsufficientStorageError: '#/components/schemas/PolicyInsufficientStorageError' - https://hivemq.com/edge/api/model/PolicyNotFoundError: '#/components/schemas/PolicyNotFoundError' - https://hivemq.com/edge/api/model/SchemaAlreadyPresentError: '#/components/schemas/SchemaAlreadyPresentError' - https://hivemq.com/edge/api/model/SchemaEtagMismatchError: '#/components/schemas/SchemaEtagMismatchError' - https://hivemq.com/edge/api/model/SchemaInsufficientStorageError: '#/components/schemas/SchemaInsufficientStorageError' - https://hivemq.com/edge/api/model/SchemaInvalidErrors: '#/components/schemas/SchemaInvalidErrors' - https://hivemq.com/edge/api/model/SchemaNotFoundError: '#/components/schemas/SchemaNotFoundError' - https://hivemq.com/edge/api/model/SchemaParsingFailureError: '#/components/schemas/SchemaParsingFailureError' - https://hivemq.com/edge/api/model/SchemaReferencedError: '#/components/schemas/SchemaReferencedError' - https://hivemq.com/edge/api/model/ScriptAlreadyPresentError: '#/components/schemas/ScriptAlreadyPresentError' - https://hivemq.com/edge/api/model/ScriptCreationFailureError: '#/components/schemas/ScriptCreationFailureError' - https://hivemq.com/edge/api/model/ScriptEtagMismatchError: '#/components/schemas/ScriptEtagMismatchError' - https://hivemq.com/edge/api/model/ScriptInsufficientStorageError: '#/components/schemas/ScriptInsufficientStorageError' - https://hivemq.com/edge/api/model/ScriptInvalidErrors: '#/components/schemas/ScriptInvalidErrors' - https://hivemq.com/edge/api/model/ScriptNotFoundError: '#/components/schemas/ScriptNotFoundError' - https://hivemq.com/edge/api/model/ScriptParsingFailureError: '#/components/schemas/ScriptParsingFailureError' - https://hivemq.com/edge/api/model/ScriptReferencedError: '#/components/schemas/ScriptReferencedError' - https://hivemq.com/edge/api/model/ScriptSanitationFailureError: '#/components/schemas/ScriptSanitationFailureError' - https://hivemq.com/edge/api/model/TopicFilterMismatchError: '#/components/schemas/TopicFilterMismatchError' - https://hivemq.com/edge/api/model/InsufficientStorageError: '#/components/schemas/InsufficientStorageError' - https://hivemq.com/edge/api/model/InternalServerError: '#/components/schemas/InternalServerError' - https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' - https://hivemq.com/edge/api/model/PreconditionFailedError: '#/components/schemas/PreconditionFailedError' - https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' - https://hivemq.com/edge/api/model/RequestBodyParameterMissingError: '#/components/schemas/RequestBodyParameterMissingError' - https://hivemq.com/edge/api/model/TemporaryNotAvailableError: '#/components/schemas/TemporaryNotAvailableError' - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' - BehaviorPolicyAlreadyPresentError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The behavior policy id. - example: abc - required: - - id - example: - general: - status: 409 - title: Behavior Policy Already Present - detail: The given behavior policy 'abc' is already present. - id: abc - type: https://hivemq.com/edge/api/model/BehaviorPolicyAlreadyPresentError - BehaviorPolicyCreationFailureError: - allOf: - - $ref: '#/components/schemas/ApiError' - example: - general: - status: 400 - title: Behavior Policy Creation Failed - detail: 'Behavior policy creation failed: The policy was rejected.' - type: https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError - AtLeastOneFieldMissingValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - paths: - type: array - description: The missing json paths. - items: - type: string - format: json-path - description: The json path. - example: - - $.field1 - - $.field2 - required: - - paths - example: - general: - detail: 'At least one of the fields must be present: ''$.field1'', ''$.field2''.' - paths: - - $.field1 - - $.field2 - type: https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError - ValidationError: - type: object - properties: - detail: - type: string - description: Detailed contextual description of the validation error. - type: - type: string - format: uri - description: Type of the validation error. - required: - - detail - - type - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError: '#/components/schemas/AtLeastOneFieldMissingValidationError' - https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError: '#/components/schemas/AtMostOneFunctionValidationError' - https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' - https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError: '#/components/schemas/FunctionMustBePairedValidationError' - https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError: '#/components/schemas/IllegalEventTransitionValidationError' - https://hivemq.com/edge/api/model/IllegalFunctionValidationError: '#/components/schemas/IllegalFunctionValidationError' - https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' - https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' - https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError: '#/components/schemas/InvalidFunctionOrderValidationError' - https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' - https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError: '#/components/schemas/InvalidSchemaVersionValidationError' - https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' - https://hivemq.com/edge/api/model/UnknownVariableValidationError: '#/components/schemas/UnknownVariableValidationError' - https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' - AtMostOneFunctionValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - function: - type: string - description: The function. - example: function1 - occurrences: - type: integer - format: int32 - description: The occurrences of the function. - minimum: 0 - example: 3 - paths: - type: array - items: - type: string - format: json-path - description: The json paths where the function occurs. - example: - - $.path1 - - $.path2 - - $.path3 - required: - - function - - occurrences - - paths - example: - general: - detail: The pipeline must contain at most one 'function1' function, but 3 were found at ['$.path1', '$.path2', '$.path3']. - function: function1 - occurrences: 3 - paths: - - $.path1 - - $.path2 - - $.path3 - type: https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError - EmptyFieldValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - path: - type: string - format: json-path - description: The missing field. - example: $.field - required: - - path - example: - general: - detail: Required field '$.field' is empty. - path: $.field - type: https://hivemq.com/edge/api/model/EmptyFieldValidationError - FunctionMustBePairedValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - existingFunction: - type: string - description: The existing function. - example: function1 - missingFunction: - type: string - description: The missing function. - example: function2 - required: - - existingFunction - - missingFunction - example: - general: - detail: If 'function1' function is present in the pipeline, 'function2' function must be present as well. - existingFunction: function1 - missingFunction: function2 - type: https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError - IllegalEventTransitionValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - event: - type: string - description: The event name. - example: event1 - fromState: - type: string - description: The event from state. - example: state1 - id: - type: string - description: The event id. - example: abc - path: - type: string - description: The path. - example: $.event - toState: - type: string - description: The event to state. - example: state2 - required: - - event - - fromState - - id - - path - - toState - example: - general: - detail: The transition from state 'state1' to state 'state2' on event 'event1' in '$.event' is not defined for behavior 'abc'. - event: event1 - fromState: state1 - toState: state2 - id: abc - path: $.event - type: https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError - IllegalFunctionValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - event: - type: string - description: The event name. - example: event1 - id: - type: string - description: The function id. - example: abc - path: - type: string - format: json-path - description: The json path. - example: $.event - required: - - event - - id - - path - example: - general: - detail: The function 'abc' is not allowed for event 'event1' in '$.event'. - event: event1 - id: abc - path: $.event - type: https://hivemq.com/edge/api/model/IllegalFunctionValidationError - InvalidFieldLengthValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - actualLength: - type: integer - format: int32 - description: The actual length of the field value. - example: 10 - expectedMinimumLength: - type: integer - format: int32 - description: The minimum length expected for the field value. - minimum: 0 - example: 5 - expectedMaximumLength: - type: integer - format: int32 - description: The maximum length expected for the field value. - minimum: 0 - example: 20 - path: - type: string - format: json-path - description: The invalid json path. - example: $.field - value: - type: string - description: The invalid value. - example: function transform() { return 'Hello, World!'; } - required: - - actualLength - - expectedMinimumLength - - expectedMaximumLength - - path - - value - example: - general: - detail: The length of script field '$.transform' 48 must be between 0 and 20. - actualLength: 48 - minimumLength: 0 - maximumLength: 20 - path: $.transform - value: function transform() { return 'Hello, World!'; } - type: https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError - InvalidFieldValueValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - path: - type: string - format: json-path - description: The invalid json path. - example: $.action.pipeline[1].field - value: - type: string - description: The invalid value. - example: functionDoesNotExist - required: - - path - example: - general: - detail: Referenced function does not exist. - path: $.action.pipeline[1].field - value: functionDoesNotExist - type: https://hivemq.com/edge/api/model/InvalidFieldValueValidationError - InvalidFunctionOrderValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - function: - type: string - description: The function. - example: transform - path: - type: string - format: json-path - description: The json path. - example: $.path - previousFunction: - type: string - description: The previous function. - example: init - required: - - function - - path - - previousFunction - example: - general: - detail: The operation at '$.path' with the functionId 'transform' must be after a 'init' operation. - function: transform - path: $.path - previousFunction: init - type: https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError - InvalidIdentifierValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - path: - type: string - format: json-path - description: The invalid identifier path. - example: $.id - value: - type: string - description: The invalid identifier value. - example: invalidId - required: - - path - - value - example: - general: - detail: Identifier script 'id' must begin with a letter and may only consist of lowercase letters, uppercase letters, numbers, periods, hyphens, and underscores. - path: $.id - value: invalidId - type: https://hivemq.com/edge/api/model/InvalidIdentifierValidationError - InvalidSchemaVersionValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - id: - type: string - description: The schema id. - example: abc - version: - type: string - description: The schema version. - example: '2' - required: - - id - - version - example: - general: - detail: The referenced schema with id 'abc' and version '2' was not found. - id: abc - version: '2' - type: https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError - MissingFieldValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - path: - type: string - format: json-path - description: The missing path. - example: $.id - required: - - path - example: - general: - detail: Required field '$.id' is missing. - path: $.id - type: https://hivemq.com/edge/api/model/MissingFieldValidationError - UnknownVariableValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - path: - type: string - description: The json path of the field. - example: $.path - variables: - type: array - items: - type: string - description: The unknown variables. - example: - - a - - b - - c - required: - - path - - variables - example: - general: - detail: 'Field ''$.path'' contains unknown variables: [a, b, c].' - path: $.path - variables: - - a - - b - - c - type: https://hivemq.com/edge/api/model/UnknownVariableValidationError - UnsupportedFieldValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - actualValue: - type: string - description: The actual value. - expectedValue: - type: string - description: The expected value. - path: - type: string - format: json-path - description: The json path. - example: $.id - required: - - actualValue - - expectedValue - - path - example: - general: - detail: Unsupported type 'String' for field '$.id'. Expected type is 'Object'. - actualValue: String - expectedValue: Object - path: $.id - type: https://hivemq.com/edge/api/model/UnsupportedFieldValidationError - BehaviorPolicyValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - oneOf: - - $ref: '#/components/schemas/IllegalEventTransitionValidationError' - - $ref: '#/components/schemas/IllegalFunctionValidationError' - - $ref: '#/components/schemas/InvalidSchemaVersionValidationError' - - $ref: '#/components/schemas/AtLeastOneFieldMissingValidationError' - - $ref: '#/components/schemas/EmptyFieldValidationError' - - $ref: '#/components/schemas/InvalidFieldLengthValidationError' - - $ref: '#/components/schemas/InvalidFieldValueValidationError' - - $ref: '#/components/schemas/InvalidIdentifierValidationError' - - $ref: '#/components/schemas/MissingFieldValidationError' - - $ref: '#/components/schemas/UnsupportedFieldValidationError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError: '#/components/schemas/AtLeastOneFieldMissingValidationError' - https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' - https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError: '#/components/schemas/IllegalEventTransitionValidationError' - https://hivemq.com/edge/api/model/IllegalFunctionValidationError: '#/components/schemas/IllegalFunctionValidationError' - https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' - https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' - https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' - https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError: '#/components/schemas/InvalidSchemaVersionValidationError' - https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' - https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' - BehaviorPolicyInvalidErrors: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - childErrors: - type: array - description: List of child validation errors. - items: - $ref: '#/components/schemas/BehaviorPolicyValidationError' - required: - - childErrors - example: - general: - status: 400 - title: Behavior Policy Invalid - detail: Behavior policy is invalid due to validation errors. - type: https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors - childErrors: - - detail: The transition from state 'state1' to state 'state2' on event 'event1' in '$.path' is not defined for behavior 'id1'. - fromState: state1 - toState: state2 - path: $.path - id: id1 - type: https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError - BehaviorPolicyNotFoundError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The data policy id. - example: abc - required: - - id - example: - general: - status: 404 - title: Behavior Policy Not Found - detail: Behavior policy with ID 'abc' is not found. - id: abc - type: https://hivemq.com/edge/api/model/BehaviorPolicyNotFoundError - BehaviorPolicyRejectedError: - allOf: - - $ref: '#/components/schemas/ApiError' - example: - general: - status: 400 - title: Behavior Policy Rejected - detail: Behavior policy is rejected. - type: https://hivemq.com/edge/api/model/BehaviorPolicyRejectedError - BehaviorPolicyUpdateFailureError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The ID of the policy that failed to update. - example: abc - required: - - id - example: - general: - status: 400 - title: Behavior Policy Update Failed - detail: Behavior policy with ID 'abc' update failed. - id: abc - type: https://hivemq.com/edge/api/model/BehaviorPolicyUpdateFailureError - ClientDisconnectedError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The client id. - example: abc - required: - - id - example: - general: - status: 404 - title: Client Disconnected - detail: Client with ID 'abc' is disconnected. - id: abc - type: https://hivemq.com/edge/api/model/ClientDisconnectedError - ClientNotFoundError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The client id. - example: abc - required: - - id - example: - general: - status: 404 - title: Client Not Found - detail: Client with ID 'abc' is not found. - id: abc - type: https://hivemq.com/edge/api/model/ClientNotFoundError - DataPolicyAlreadyPresentError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The data policy id. - example: abc - required: - - id - example: - general: - status: 409 - title: Data Policy Already Present - detail: The given data policy 'abc' is already present. - id: abc - type: https://hivemq.com/edge/api/model/DataPolicyAlreadyPresentError - DataPolicyCreationFailureError: - allOf: - - $ref: '#/components/schemas/ApiError' - example: - general: - status: 400 - title: Data Policy Creation Failed - detail: 'Data policy creation failed: The policy was rejected.' - type: https://hivemq.com/edge/api/model/DataPolicyCreationFailureError - DataPolicyValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - oneOf: - - $ref: '#/components/schemas/AtMostOneFunctionValidationError' - - $ref: '#/components/schemas/FunctionMustBePairedValidationError' - - $ref: '#/components/schemas/InvalidFunctionOrderValidationError' - - $ref: '#/components/schemas/InvalidSchemaVersionValidationError' - - $ref: '#/components/schemas/UnknownVariableValidationError' - - $ref: '#/components/schemas/EmptyFieldValidationError' - - $ref: '#/components/schemas/InvalidFieldLengthValidationError' - - $ref: '#/components/schemas/InvalidFieldValueValidationError' - - $ref: '#/components/schemas/InvalidIdentifierValidationError' - - $ref: '#/components/schemas/MissingFieldValidationError' - - $ref: '#/components/schemas/UnsupportedFieldValidationError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError: '#/components/schemas/AtMostOneFunctionValidationError' - https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' - https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError: '#/components/schemas/FunctionMustBePairedValidationError' - https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' - https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' - https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError: '#/components/schemas/InvalidFunctionOrderValidationError' - https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' - https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError: '#/components/schemas/InvalidSchemaVersionValidationError' - https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' - https://hivemq.com/edge/api/model/UnknownVariableValidationError: '#/components/schemas/UnknownVariableValidationError' - https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' - DataPolicyInvalidErrors: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - childErrors: - type: array - description: List of child validation errors. - items: - $ref: '#/components/schemas/DataPolicyValidationError' - required: - - childErrors - example: - general: - status: 400 - title: Data Policy Invalid - detail: Data policy is invalid due to validation errors. - type: https://hivemq.com/edge/api/model/DataPolicyInvalidErrors - childErrors: - - detail: The pipeline must contain at most one 'function1' function, but 3 were found at ['$.path1', '$.path2', '$.path3']. - function: function1 - occurrences: 3 - paths: - - $.path1 - - $.path2 - - $.path3 - type: https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError - DataPolicyNotFoundError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The data policy id. - example: abc - required: - - id - example: - general: - status: 404 - title: Data Policy Not Found - detail: Data policy with ID 'abc' is not found. - id: abc - type: https://hivemq.com/edge/api/model/DataPolicyNotFoundError - DataPolicyRejectedError: - allOf: - - $ref: '#/components/schemas/ApiError' - example: - general: - status: 400 - title: Data Policy Rejected - detail: Data policy is rejected. - type: https://hivemq.com/edge/api/model/DataPolicyRejectedError - DataPolicyUpdateFailureError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The ID of the policy that failed to update. - example: abc - required: - - id - example: - general: - status: 400 - title: Data Policy Update Failed - detail: Data policy with ID 'abc' update failed. - id: abc - type: https://hivemq.com/edge/api/model/DataPolicyUpdateFailureError - PolicyIdMismatchError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - actualId: - type: string - description: The actual id. - example: id1 - expectedId: - type: string - description: The expected id. - example: id2 - required: - - actualId - - expectedId - example: - general: - status: 400 - title: Policy ID Mismatch - detail: The policy ID 'id1' in the request parameter does not match the policy ID 'id2' in the policy request body. - id: abc - type: https://hivemq.com/edge/api/model/PolicyIdMismatchError - PolicyInsufficientStorageError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The policy id. - example: abc - required: - - id - example: - general: - status: 507 - title: Policy Insufficient Storage - detail: Policy with ID '123' could not be added because of insufficient server storage. - id: abc - type: https://hivemq.com/edge/api/model/PolicyInsufficientStorageError - PolicyNotFoundError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The policy id. - example: abc - required: - - id - example: - general: - status: 404 - title: Policy Not Found - detail: Policy with ID 'abc' is not found. - id: abc - type: https://hivemq.com/edge/api/model/PolicyNotFoundError - SchemaAlreadyPresentError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The schema id. - example: abc - required: - - id - example: - general: - status: 409 - title: Schema Already Present - detail: The given schema is already present as the latest version for the schema id 'abc'. - id: abc - type: https://hivemq.com/edge/api/model/SchemaAlreadyPresentError - SchemaEtagMismatchError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The schema id. - example: abc - eTag: - type: string - description: The eTag. - example: 33a64df551425fcc55e4d42a148795d9f25f89d4 - required: - - id - example: - general: - status: 412 - title: Schema eTag Mismatch - detail: Schema with id 'abc' does not match the given etag '33a64df551425fcc55e4d42a148795d9f25f89d4'. - id: abc - eTag: 33a64df551425fcc55e4d42a148795d9f25f89d4 - type: https://hivemq.com/edge/api/model/SchemaEtagMismatchError - SchemaInsufficientStorageError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The policy id. - example: abc - required: - - id - example: - general: - status: 507 - title: Schema Insufficient Storage - detail: Schema with ID '123' could not be added because of insufficient server storage. - id: abc - type: https://hivemq.com/edge/api/model/SchemaInsufficientStorageError - SchemaValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - oneOf: - - $ref: '#/components/schemas/EmptyFieldValidationError' - - $ref: '#/components/schemas/InvalidFieldLengthValidationError' - - $ref: '#/components/schemas/InvalidFieldValueValidationError' - - $ref: '#/components/schemas/InvalidIdentifierValidationError' - - $ref: '#/components/schemas/MissingFieldValidationError' - - $ref: '#/components/schemas/UnsupportedFieldValidationError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' - https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' - https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' - https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' - https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' - https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' - SchemaInvalidErrors: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - childErrors: - type: array - description: List of child validation errors. - items: - $ref: '#/components/schemas/SchemaValidationError' - required: - - childErrors - example: - general: - status: 400 - title: Schema Invalid - detail: Schema is invalid due to validation errors. - type: https://hivemq.com/edge/api/model/SchemaInvalidErrors - childErrors: - - detail: The length of script field '$.id' 1025 must be between 0 and 1024. - paths: $.id - value: aaa...aaa - actualLength: 1025 - expectedMinimumLength: 0 - expectedMaximumLength: 1024 - type: https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError - SchemaNotFoundError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The schema ID. - example: abc - required: - - id - example: - general: - status: 404 - title: Schema Not Found - detail: Schema with ID 'abc' is not found. - id: abc - type: https://hivemq.com/edge/api/model/SchemaNotFoundError - SchemaParsingFailureError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - alias: - type: string - description: The schema alias. - example: abc - required: - - alias - example: - general: - status: 400 - title: Schema Parsing Failure - detail: The given schema 'abc' could not be parsed. - alias: abc - type: https://hivemq.com/edge/api/model/SchemaParsingFailureError - SchemaReferencedError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The schema ID. - example: abc - required: - - id - example: - general: - status: 400 - title: Schema Referenced - detail: Schema with ID 'abc' is referenced. - id: abc - type: https://hivemq.com/edge/api/model/SchemaReferencedError - ScriptAlreadyPresentError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The script id. - example: abc - required: - - id - example: - general: - status: 409 - title: Script Already Present - detail: The given script 'abc' is already present. - id: abc - type: https://hivemq.com/edge/api/model/ScriptAlreadyPresentError - ScriptCreationFailureError: - allOf: - - $ref: '#/components/schemas/ApiError' - example: - general: - status: 400 - title: Script Creation Failure - detail: The given script could not be created. - type: https://hivemq.com/edge/api/model/ScriptCreationFailureError - ScriptEtagMismatchError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The script id. - example: abc - eTag: - type: string - description: The eTag. - example: 33a64df551425fcc55e4d42a148795d9f25f89d4 - required: - - id - example: - general: - status: 412 - title: Script eTag Mismatch - detail: Script with id 'abc' does not match the given etag '33a64df551425fcc55e4d42a148795d9f25f89d4'. - id: abc - eTag: 33a64df551425fcc55e4d42a148795d9f25f89d4 - type: https://hivemq.com/edge/api/model/ScriptEtagMismatchError - ScriptInsufficientStorageError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The policy id. - example: abc - required: - - id - example: - general: - status: 507 - title: Script Insufficient Storage - detail: Script with ID '123' could not be added because of insufficient server storage. - id: abc - type: https://hivemq.com/edge/api/model/ScriptInsufficientStorageError - ScriptValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - oneOf: - - $ref: '#/components/schemas/InvalidFieldLengthValidationError' - - $ref: '#/components/schemas/InvalidFieldValueValidationError' - - $ref: '#/components/schemas/InvalidIdentifierValidationError' - - $ref: '#/components/schemas/MissingFieldValidationError' - - $ref: '#/components/schemas/UnsupportedFieldValidationError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' - https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' - https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' - https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' - https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' - ScriptInvalidErrors: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - childErrors: - type: array - description: List of child validation errors. - items: - $ref: '#/components/schemas/ScriptValidationError' - required: - - childErrors - example: - general: - status: 400 - title: Script Invalid - detail: Script is invalid due to validation errors. - type: https://hivemq.com/edge/api/model/ScriptInvalidErrors - childErrors: - - detail: The length of script field '$.id' 1025 must be between 0 and 1024. - paths: $.id - value: aaa...aaa - actualLength: 1025 - expectedMinimumLength: 0 - expectedMaximumLength: 1024 - type: https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError - ScriptNotFoundError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The script ID. - example: abc - required: - - id - example: - general: - status: 404 - title: Script Not Found - detail: Script with ID 'abc' is not found. - id: abc - type: https://hivemq.com/edge/api/model/ScriptNotFoundError - ScriptParsingFailureError: - allOf: - - $ref: '#/components/schemas/ApiError' - example: - general: - status: 400 - title: Script Parsing Failure - detail: The given script 'abc' could not be parsed. - type: https://hivemq.com/edge/api/model/ScriptParsingFailureError - ScriptReferencedError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The script ID. - example: abc - required: - - id - example: - general: - status: 400 - title: Script Referenced - detail: Script with ID 'abc' is referenced. - id: abc - type: https://hivemq.com/edge/api/model/ScriptReferencedError - ScriptSanitationFailureError: - allOf: - - $ref: '#/components/schemas/ApiError' - example: - general: - status: 400 - title: Script Sanitation Failure - detail: The given script could not be sanitized. - type: https://hivemq.com/edge/api/model/ScriptSanitationFailureError - TopicFilterMismatchError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - path: - type: string - description: The json path of the topic filter. - example: $.filter - required: - - path - example: - general: - status: 400 - title: Topic Filter Mismatch - detail: The topic filter '$.filter' mismatches. - type: https://hivemq.com/edge/api/model/TopicFilterMismatchError - InsufficientStorageError: - allOf: - - $ref: '#/components/schemas/ApiError' - example: - general: - status: 507 - title: Insufficient Storage - detail: Insufficient Storage. - type: https://hivemq.com/edge/api/model/InsufficientStorageError - InternalServerError: - allOf: - - $ref: '#/components/schemas/ApiError' - example: - general: - status: 500 - title: Internal Server Error - detail: An unexpected error occurred, check the logs. - type: https://hivemq.com/edge/api/model/InternalServerError - creation: - status: 500 - title: Internal Server Error - detail: 'An unexpected error occurred: Exception during creation of the Json Schema for functions.' - type: https://hivemq.com/edge/api/model/InternalServerError - InvalidQueryParameterError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - parameter: - type: string - description: The query parameter. - required: - - parameter - example: - general: - status: 400 - title: Query Parameter is Invalid - detail: 'Query parameter ''a'' is invalid: ''a'' could not be parsed.' - parameter: a - type: https://hivemq.com/edge/api/model/InvalidQueryParameterError - PreconditionFailedError: - allOf: - - $ref: '#/components/schemas/ApiError' - example: - general: - status: 412 - title: Precondition Failed - detail: 'A precondition required for fulfilling the request was not fulfilled: Policy does not match the given etag ''abc''.' - type: https://hivemq.com/edge/api/model/PreconditionFailedError - RequestBodyMissingError: - allOf: - - $ref: '#/components/schemas/ApiError' - example: - general: - status: 400 - title: Required Request Body Missing - detail: Required request body is missing. - type: https://hivemq.com/edge/api/model/RequestBodyMissingError - RequestBodyParameterMissingError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - parameter: - type: string - description: The the missing request body parameter. - required: - - parameter - example: - general: - status: 400 - title: Required Request Body Parameter Missing - detail: Required request body parameter 'a' is missing. - parameter: a - type: https://hivemq.com/edge/api/model/RequestBodyParameterMissingError - TemporaryNotAvailableError: - allOf: - - $ref: '#/components/schemas/ApiError' - example: - general: - status: 503 - title: Endpoint Temporarily not Available - detail: The endpoint is temporarily not available, please try again later. - type: https://hivemq.com/edge/api/model/TemporaryNotAvailableError - UrlParameterMissingError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - parameter: - type: string - description: The name of the missing parameter. - required: - - parameter - example: - general: - status: 400 - title: Required URL Parameter Missing - detail: Required URL parameter 'a' is missing. - parameter: a - type: https://hivemq.com/edge/api/model/UrlParameterMissingError JsonNode: type: object description: The arguments of the fsm derived from the behavior policy. @@ -6244,6 +4795,8 @@ components: description: List of result items that are returned by this endpoint items: $ref: '#/components/schemas/DataPolicy' + Errors: + type: object PolicyType: description: The type of policy in Data Hub type: string diff --git a/ext/hivemq-edge-openapi-2025.13.yaml b/ext/hivemq-edge-openapi-2025.13.yaml index eca1d57d35..15ded3481b 100644 --- a/ext/hivemq-edge-openapi-2025.13.yaml +++ b/ext/hivemq-edge-openapi-2025.13.yaml @@ -4674,1264 +4674,6 @@ components: description: List of result items that are returned by this endpoint items: $ref: '#/components/schemas/BehaviorPolicy' - ApiProblemDetails: - allOf: - - $ref: '#/components/schemas/ProblemDetails' - - type: object - required: - - detail - - status - - type - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/BehaviorPolicyAlreadyPresentError: '#/components/schemas/BehaviorPolicyAlreadyPresentError' - https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError: '#/components/schemas/BehaviorPolicyCreationFailureError' - https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors: '#/components/schemas/BehaviorPolicyInvalidErrors' - https://hivemq.com/edge/api/model/BehaviorPolicyNotFoundError: '#/components/schemas/BehaviorPolicyNotFoundError' - https://hivemq.com/edge/api/model/BehaviorPolicyRejectedError: '#/components/schemas/BehaviorPolicyRejectedError' - https://hivemq.com/edge/api/model/BehaviorPolicyUpdateFailureError: '#/components/schemas/BehaviorPolicyUpdateFailureError' - https://hivemq.com/edge/api/model/ClientDisconnectedError: '#/components/schemas/ClientDisconnectedError' - https://hivemq.com/edge/api/model/ClientNotFoundError: '#/components/schemas/ClientNotFoundError' - https://hivemq.com/edge/api/model/DataPolicyAlreadyPresentError: '#/components/schemas/DataPolicyAlreadyPresentError' - https://hivemq.com/edge/api/model/DataPolicyCreationFailureError: '#/components/schemas/DataPolicyCreationFailureError' - https://hivemq.com/edge/api/model/DataPolicyInvalidErrors: '#/components/schemas/DataPolicyInvalidErrors' - https://hivemq.com/edge/api/model/DataPolicyNotFoundError: '#/components/schemas/DataPolicyNotFoundError' - https://hivemq.com/edge/api/model/DataPolicyRejectedError: '#/components/schemas/DataPolicyRejectedError' - https://hivemq.com/edge/api/model/DataPolicyUpdateFailureError: '#/components/schemas/DataPolicyUpdateFailureError' - https://hivemq.com/edge/api/model/PolicyIdMismatchError: '#/components/schemas/PolicyIdMismatchError' - https://hivemq.com/edge/api/model/PolicyInsufficientStorageError: '#/components/schemas/PolicyInsufficientStorageError' - https://hivemq.com/edge/api/model/PolicyNotFoundError: '#/components/schemas/PolicyNotFoundError' - https://hivemq.com/edge/api/model/SchemaAlreadyPresentError: '#/components/schemas/SchemaAlreadyPresentError' - https://hivemq.com/edge/api/model/SchemaEtagMismatchError: '#/components/schemas/SchemaEtagMismatchError' - https://hivemq.com/edge/api/model/SchemaInsufficientStorageError: '#/components/schemas/SchemaInsufficientStorageError' - https://hivemq.com/edge/api/model/SchemaInvalidErrors: '#/components/schemas/SchemaInvalidErrors' - https://hivemq.com/edge/api/model/SchemaNotFoundError: '#/components/schemas/SchemaNotFoundError' - https://hivemq.com/edge/api/model/SchemaParsingFailureError: '#/components/schemas/SchemaParsingFailureError' - https://hivemq.com/edge/api/model/SchemaReferencedError: '#/components/schemas/SchemaReferencedError' - https://hivemq.com/edge/api/model/ScriptAlreadyPresentError: '#/components/schemas/ScriptAlreadyPresentError' - https://hivemq.com/edge/api/model/ScriptCreationFailureError: '#/components/schemas/ScriptCreationFailureError' - https://hivemq.com/edge/api/model/ScriptEtagMismatchError: '#/components/schemas/ScriptEtagMismatchError' - https://hivemq.com/edge/api/model/ScriptInsufficientStorageError: '#/components/schemas/ScriptInsufficientStorageError' - https://hivemq.com/edge/api/model/ScriptInvalidErrors: '#/components/schemas/ScriptInvalidErrors' - https://hivemq.com/edge/api/model/ScriptNotFoundError: '#/components/schemas/ScriptNotFoundError' - https://hivemq.com/edge/api/model/ScriptParsingFailureError: '#/components/schemas/ScriptParsingFailureError' - https://hivemq.com/edge/api/model/ScriptReferencedError: '#/components/schemas/ScriptReferencedError' - https://hivemq.com/edge/api/model/ScriptSanitationFailureError: '#/components/schemas/ScriptSanitationFailureError' - https://hivemq.com/edge/api/model/TopicFilterMismatchError: '#/components/schemas/TopicFilterMismatchError' - https://hivemq.com/edge/api/model/InsufficientStorageError: '#/components/schemas/InsufficientStorageError' - https://hivemq.com/edge/api/model/InternalServerError: '#/components/schemas/InternalServerError' - https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' - https://hivemq.com/edge/api/model/PreconditionFailedError: '#/components/schemas/PreconditionFailedError' - https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' - https://hivemq.com/edge/api/model/RequestBodyParameterMissingError: '#/components/schemas/RequestBodyParameterMissingError' - https://hivemq.com/edge/api/model/TemporaryNotAvailableError: '#/components/schemas/TemporaryNotAvailableError' - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' - BehaviorPolicyAlreadyPresentError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The behavior policy id. - example: abc - required: - - id - example: - general: - status: 409 - title: Behavior Policy Already Present - detail: The given behavior policy 'abc' is already present. - id: abc - type: https://hivemq.com/edge/api/model/BehaviorPolicyAlreadyPresentError - BehaviorPolicyCreationFailureError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 400 - title: Behavior Policy Creation Failed - detail: 'Behavior policy creation failed: The policy was rejected.' - type: https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError - AtLeastOneFieldMissingValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - paths: - type: array - description: The missing json paths. - items: - type: string - format: json-path - description: The json path. - example: - - $.field1 - - $.field2 - required: - - paths - example: - general: - detail: 'At least one of the fields must be present: ''$.field1'', ''$.field2''.' - paths: - - $.field1 - - $.field2 - type: https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError - ValidationError: - type: object - properties: - detail: - type: string - description: Detailed contextual description of the validation error. - type: - type: string - format: uri - description: Type of the validation error. - required: - - detail - - type - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError: '#/components/schemas/AtLeastOneFieldMissingValidationError' - https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError: '#/components/schemas/AtMostOneFunctionValidationError' - https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' - https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError: '#/components/schemas/FunctionMustBePairedValidationError' - https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError: '#/components/schemas/IllegalEventTransitionValidationError' - https://hivemq.com/edge/api/model/IllegalFunctionValidationError: '#/components/schemas/IllegalFunctionValidationError' - https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' - https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' - https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError: '#/components/schemas/InvalidFunctionOrderValidationError' - https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' - https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError: '#/components/schemas/InvalidSchemaVersionValidationError' - https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' - https://hivemq.com/edge/api/model/UnknownVariableValidationError: '#/components/schemas/UnknownVariableValidationError' - https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' - AtMostOneFunctionValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - function: - type: string - description: The function. - example: function1 - occurrences: - type: integer - format: int32 - description: The occurrences of the function. - minimum: 0 - example: 3 - paths: - type: array - items: - type: string - format: json-path - description: The json paths where the function occurs. - example: - - $.path1 - - $.path2 - - $.path3 - required: - - function - - occurrences - - paths - example: - general: - detail: The pipeline must contain at most one 'function1' function, but 3 were found at ['$.path1', '$.path2', '$.path3']. - function: function1 - occurrences: 3 - paths: - - $.path1 - - $.path2 - - $.path3 - type: https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError - EmptyFieldValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - path: - type: string - format: json-path - description: The missing field. - example: $.field - required: - - path - example: - general: - detail: Required field '$.field' is empty. - path: $.field - type: https://hivemq.com/edge/api/model/EmptyFieldValidationError - FunctionMustBePairedValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - existingFunction: - type: string - description: The existing function. - example: function1 - missingFunction: - type: string - description: The missing function. - example: function2 - required: - - existingFunction - - missingFunction - example: - general: - detail: If 'function1' function is present in the pipeline, 'function2' function must be present as well. - existingFunction: function1 - missingFunction: function2 - type: https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError - IllegalEventTransitionValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - event: - type: string - description: The event name. - example: event1 - fromState: - type: string - description: The event from state. - example: state1 - id: - type: string - description: The event id. - example: abc - path: - type: string - description: The path. - example: $.event - toState: - type: string - description: The event to state. - example: state2 - required: - - event - - fromState - - id - - path - - toState - example: - general: - detail: The transition from state 'state1' to state 'state2' on event 'event1' in '$.event' is not defined for behavior 'abc'. - event: event1 - fromState: state1 - toState: state2 - id: abc - path: $.event - type: https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError - IllegalFunctionValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - event: - type: string - description: The event name. - example: event1 - id: - type: string - description: The function id. - example: abc - path: - type: string - format: json-path - description: The json path. - example: $.event - required: - - event - - id - - path - example: - general: - detail: The function 'abc' is not allowed for event 'event1' in '$.event'. - event: event1 - id: abc - path: $.event - type: https://hivemq.com/edge/api/model/IllegalFunctionValidationError - InvalidFieldLengthValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - actualLength: - type: integer - format: int32 - description: The actual length of the field value. - example: 10 - expectedMinimumLength: - type: integer - format: int32 - description: The minimum length expected for the field value. - minimum: 0 - example: 5 - expectedMaximumLength: - type: integer - format: int32 - description: The maximum length expected for the field value. - minimum: 0 - example: 20 - path: - type: string - format: json-path - description: The invalid json path. - example: $.field - value: - type: string - description: The invalid value. - example: function transform() { return 'Hello, World!'; } - required: - - actualLength - - expectedMinimumLength - - expectedMaximumLength - - path - - value - example: - general: - detail: The length of script field '$.transform' 48 must be between 0 and 20. - actualLength: 48 - minimumLength: 0 - maximumLength: 20 - path: $.transform - value: function transform() { return 'Hello, World!'; } - type: https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError - InvalidFieldValueValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - path: - type: string - format: json-path - description: The invalid json path. - example: $.action.pipeline[1].field - value: - type: string - description: The invalid value. - example: functionDoesNotExist - required: - - path - example: - general: - detail: Referenced function does not exist. - path: $.action.pipeline[1].field - value: functionDoesNotExist - type: https://hivemq.com/edge/api/model/InvalidFieldValueValidationError - InvalidFunctionOrderValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - function: - type: string - description: The function. - example: transform - path: - type: string - format: json-path - description: The json path. - example: $.path - previousFunction: - type: string - description: The previous function. - example: init - required: - - function - - path - - previousFunction - example: - general: - detail: The operation at '$.path' with the functionId 'transform' must be after a 'init' operation. - function: transform - path: $.path - previousFunction: init - type: https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError - InvalidIdentifierValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - path: - type: string - format: json-path - description: The invalid identifier path. - example: $.id - value: - type: string - description: The invalid identifier value. - example: invalidId - required: - - path - - value - example: - general: - detail: Identifier script 'id' must begin with a letter and may only consist of lowercase letters, uppercase letters, numbers, periods, hyphens, and underscores. - path: $.id - value: invalidId - type: https://hivemq.com/edge/api/model/InvalidIdentifierValidationError - InvalidSchemaVersionValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - id: - type: string - description: The schema id. - example: abc - version: - type: string - description: The schema version. - example: '2' - required: - - id - - version - example: - general: - detail: The referenced schema with id 'abc' and version '2' was not found. - id: abc - version: '2' - type: https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError - MissingFieldValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - path: - type: string - format: json-path - description: The missing path. - example: $.id - required: - - path - example: - general: - detail: Required field '$.id' is missing. - path: $.id - type: https://hivemq.com/edge/api/model/MissingFieldValidationError - UnknownVariableValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - path: - type: string - description: The json path of the field. - example: $.path - variables: - type: array - items: - type: string - description: The unknown variables. - example: - - a - - b - - c - required: - - path - - variables - example: - general: - detail: 'Field ''$.path'' contains unknown variables: [a, b, c].' - path: $.path - variables: - - a - - b - - c - type: https://hivemq.com/edge/api/model/UnknownVariableValidationError - UnsupportedFieldValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - actualValue: - type: string - description: The actual value. - expectedValue: - type: string - description: The expected value. - path: - type: string - format: json-path - description: The json path. - example: $.id - required: - - actualValue - - expectedValue - - path - example: - general: - detail: Unsupported type 'String' for field '$.id'. Expected type is 'Object'. - actualValue: String - expectedValue: Object - path: $.id - type: https://hivemq.com/edge/api/model/UnsupportedFieldValidationError - BehaviorPolicyValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - oneOf: - - $ref: '#/components/schemas/IllegalEventTransitionValidationError' - - $ref: '#/components/schemas/IllegalFunctionValidationError' - - $ref: '#/components/schemas/InvalidSchemaVersionValidationError' - - $ref: '#/components/schemas/AtLeastOneFieldMissingValidationError' - - $ref: '#/components/schemas/EmptyFieldValidationError' - - $ref: '#/components/schemas/InvalidFieldLengthValidationError' - - $ref: '#/components/schemas/InvalidFieldValueValidationError' - - $ref: '#/components/schemas/InvalidIdentifierValidationError' - - $ref: '#/components/schemas/MissingFieldValidationError' - - $ref: '#/components/schemas/UnsupportedFieldValidationError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError: '#/components/schemas/AtLeastOneFieldMissingValidationError' - https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' - https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError: '#/components/schemas/IllegalEventTransitionValidationError' - https://hivemq.com/edge/api/model/IllegalFunctionValidationError: '#/components/schemas/IllegalFunctionValidationError' - https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' - https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' - https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' - https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError: '#/components/schemas/InvalidSchemaVersionValidationError' - https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' - https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' - BehaviorPolicyInvalidErrors: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - childErrors: - type: array - description: List of child validation errors. - items: - $ref: '#/components/schemas/BehaviorPolicyValidationError' - required: - - childErrors - example: - general: - status: 400 - title: Behavior Policy Invalid - detail: Behavior policy is invalid due to validation errors. - type: https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors - childErrors: - - detail: The transition from state 'state1' to state 'state2' on event 'event1' in '$.path' is not defined for behavior 'id1'. - fromState: state1 - toState: state2 - path: $.path - id: id1 - type: https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError - BehaviorPolicyNotFoundError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The data policy id. - example: abc - required: - - id - example: - general: - status: 404 - title: Behavior Policy Not Found - detail: Behavior policy with ID 'abc' is not found. - id: abc - type: https://hivemq.com/edge/api/model/BehaviorPolicyNotFoundError - BehaviorPolicyRejectedError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 400 - title: Behavior Policy Rejected - detail: Behavior policy is rejected. - type: https://hivemq.com/edge/api/model/BehaviorPolicyRejectedError - BehaviorPolicyUpdateFailureError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The ID of the policy that failed to update. - example: abc - required: - - id - example: - general: - status: 400 - title: Behavior Policy Update Failed - detail: Behavior policy with ID 'abc' update failed. - id: abc - type: https://hivemq.com/edge/api/model/BehaviorPolicyUpdateFailureError - ClientDisconnectedError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The client id. - example: abc - required: - - id - example: - general: - status: 404 - title: Client Disconnected - detail: Client with ID 'abc' is disconnected. - id: abc - type: https://hivemq.com/edge/api/model/ClientDisconnectedError - ClientNotFoundError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The client id. - example: abc - required: - - id - example: - general: - status: 404 - title: Client Not Found - detail: Client with ID 'abc' is not found. - id: abc - type: https://hivemq.com/edge/api/model/ClientNotFoundError - DataPolicyAlreadyPresentError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The data policy id. - example: abc - required: - - id - example: - general: - status: 409 - title: Data Policy Already Present - detail: The given data policy 'abc' is already present. - id: abc - type: https://hivemq.com/edge/api/model/DataPolicyAlreadyPresentError - DataPolicyCreationFailureError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 400 - title: Data Policy Creation Failed - detail: 'Data policy creation failed: The policy was rejected.' - type: https://hivemq.com/edge/api/model/DataPolicyCreationFailureError - DataPolicyValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - oneOf: - - $ref: '#/components/schemas/AtMostOneFunctionValidationError' - - $ref: '#/components/schemas/FunctionMustBePairedValidationError' - - $ref: '#/components/schemas/InvalidFunctionOrderValidationError' - - $ref: '#/components/schemas/InvalidSchemaVersionValidationError' - - $ref: '#/components/schemas/UnknownVariableValidationError' - - $ref: '#/components/schemas/EmptyFieldValidationError' - - $ref: '#/components/schemas/InvalidFieldLengthValidationError' - - $ref: '#/components/schemas/InvalidFieldValueValidationError' - - $ref: '#/components/schemas/InvalidIdentifierValidationError' - - $ref: '#/components/schemas/MissingFieldValidationError' - - $ref: '#/components/schemas/UnsupportedFieldValidationError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError: '#/components/schemas/AtMostOneFunctionValidationError' - https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' - https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError: '#/components/schemas/FunctionMustBePairedValidationError' - https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' - https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' - https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError: '#/components/schemas/InvalidFunctionOrderValidationError' - https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' - https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError: '#/components/schemas/InvalidSchemaVersionValidationError' - https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' - https://hivemq.com/edge/api/model/UnknownVariableValidationError: '#/components/schemas/UnknownVariableValidationError' - https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' - DataPolicyInvalidErrors: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - childErrors: - type: array - description: List of child validation errors. - items: - $ref: '#/components/schemas/DataPolicyValidationError' - required: - - childErrors - example: - general: - status: 400 - title: Data Policy Invalid - detail: Data policy is invalid due to validation errors. - type: https://hivemq.com/edge/api/model/DataPolicyInvalidErrors - childErrors: - - detail: The pipeline must contain at most one 'function1' function, but 3 were found at ['$.path1', '$.path2', '$.path3']. - function: function1 - occurrences: 3 - paths: - - $.path1 - - $.path2 - - $.path3 - type: https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError - DataPolicyNotFoundError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The data policy id. - example: abc - required: - - id - example: - general: - status: 404 - title: Data Policy Not Found - detail: Data policy with ID 'abc' is not found. - id: abc - type: https://hivemq.com/edge/api/model/DataPolicyNotFoundError - DataPolicyRejectedError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 400 - title: Data Policy Rejected - detail: Data policy is rejected. - type: https://hivemq.com/edge/api/model/DataPolicyRejectedError - DataPolicyUpdateFailureError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The ID of the policy that failed to update. - example: abc - required: - - id - example: - general: - status: 400 - title: Data Policy Update Failed - detail: Data policy with ID 'abc' update failed. - id: abc - type: https://hivemq.com/edge/api/model/DataPolicyUpdateFailureError - PolicyIdMismatchError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - actualId: - type: string - description: The actual id. - example: id1 - expectedId: - type: string - description: The expected id. - example: id2 - required: - - actualId - - expectedId - example: - general: - status: 400 - title: Policy ID Mismatch - detail: The policy ID 'id1' in the request parameter does not match the policy ID 'id2' in the policy request body. - id: abc - type: https://hivemq.com/edge/api/model/PolicyIdMismatchError - PolicyInsufficientStorageError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The policy id. - example: abc - required: - - id - example: - general: - status: 507 - title: Policy Insufficient Storage - detail: Policy with ID '123' could not be added because of insufficient server storage. - id: abc - type: https://hivemq.com/edge/api/model/PolicyInsufficientStorageError - PolicyNotFoundError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The policy id. - example: abc - required: - - id - example: - general: - status: 404 - title: Policy Not Found - detail: Policy with ID 'abc' is not found. - id: abc - type: https://hivemq.com/edge/api/model/PolicyNotFoundError - SchemaAlreadyPresentError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The schema id. - example: abc - required: - - id - example: - general: - status: 409 - title: Schema Already Present - detail: The given schema is already present as the latest version for the schema id 'abc'. - id: abc - type: https://hivemq.com/edge/api/model/SchemaAlreadyPresentError - SchemaEtagMismatchError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The schema id. - example: abc - eTag: - type: string - description: The eTag. - example: 33a64df551425fcc55e4d42a148795d9f25f89d4 - required: - - id - example: - general: - status: 412 - title: Schema eTag Mismatch - detail: Schema with id 'abc' does not match the given etag '33a64df551425fcc55e4d42a148795d9f25f89d4'. - id: abc - eTag: 33a64df551425fcc55e4d42a148795d9f25f89d4 - type: https://hivemq.com/edge/api/model/SchemaEtagMismatchError - SchemaInsufficientStorageError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The policy id. - example: abc - required: - - id - example: - general: - status: 507 - title: Schema Insufficient Storage - detail: Schema with ID '123' could not be added because of insufficient server storage. - id: abc - type: https://hivemq.com/edge/api/model/SchemaInsufficientStorageError - SchemaValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - oneOf: - - $ref: '#/components/schemas/EmptyFieldValidationError' - - $ref: '#/components/schemas/InvalidFieldLengthValidationError' - - $ref: '#/components/schemas/InvalidFieldValueValidationError' - - $ref: '#/components/schemas/InvalidIdentifierValidationError' - - $ref: '#/components/schemas/MissingFieldValidationError' - - $ref: '#/components/schemas/UnsupportedFieldValidationError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' - https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' - https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' - https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' - https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' - https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' - SchemaInvalidErrors: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - childErrors: - type: array - description: List of child validation errors. - items: - $ref: '#/components/schemas/SchemaValidationError' - required: - - childErrors - example: - general: - status: 400 - title: Schema Invalid - detail: Schema is invalid due to validation errors. - type: https://hivemq.com/edge/api/model/SchemaInvalidErrors - childErrors: - - detail: The length of script field '$.id' 1025 must be between 0 and 1024. - paths: $.id - value: aaa...aaa - actualLength: 1025 - expectedMinimumLength: 0 - expectedMaximumLength: 1024 - type: https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError - SchemaNotFoundError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The schema ID. - example: abc - required: - - id - example: - general: - status: 404 - title: Schema Not Found - detail: Schema with ID 'abc' is not found. - id: abc - type: https://hivemq.com/edge/api/model/SchemaNotFoundError - SchemaParsingFailureError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - alias: - type: string - description: The schema alias. - example: abc - required: - - alias - example: - general: - status: 400 - title: Schema Parsing Failure - detail: The given schema 'abc' could not be parsed. - alias: abc - type: https://hivemq.com/edge/api/model/SchemaParsingFailureError - SchemaReferencedError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The schema ID. - example: abc - required: - - id - example: - general: - status: 400 - title: Schema Referenced - detail: Schema with ID 'abc' is referenced. - id: abc - type: https://hivemq.com/edge/api/model/SchemaReferencedError - ScriptAlreadyPresentError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The script id. - example: abc - required: - - id - example: - general: - status: 409 - title: Script Already Present - detail: The given script 'abc' is already present. - id: abc - type: https://hivemq.com/edge/api/model/ScriptAlreadyPresentError - ScriptCreationFailureError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 400 - title: Script Creation Failure - detail: The given script could not be created. - type: https://hivemq.com/edge/api/model/ScriptCreationFailureError - ScriptEtagMismatchError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The script id. - example: abc - eTag: - type: string - description: The eTag. - example: 33a64df551425fcc55e4d42a148795d9f25f89d4 - required: - - id - example: - general: - status: 412 - title: Script eTag Mismatch - detail: Script with id 'abc' does not match the given etag '33a64df551425fcc55e4d42a148795d9f25f89d4'. - id: abc - eTag: 33a64df551425fcc55e4d42a148795d9f25f89d4 - type: https://hivemq.com/edge/api/model/ScriptEtagMismatchError - ScriptInsufficientStorageError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The policy id. - example: abc - required: - - id - example: - general: - status: 507 - title: Script Insufficient Storage - detail: Script with ID '123' could not be added because of insufficient server storage. - id: abc - type: https://hivemq.com/edge/api/model/ScriptInsufficientStorageError - ScriptValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - oneOf: - - $ref: '#/components/schemas/InvalidFieldLengthValidationError' - - $ref: '#/components/schemas/InvalidFieldValueValidationError' - - $ref: '#/components/schemas/InvalidIdentifierValidationError' - - $ref: '#/components/schemas/MissingFieldValidationError' - - $ref: '#/components/schemas/UnsupportedFieldValidationError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' - https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' - https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' - https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' - https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' - ScriptInvalidErrors: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - childErrors: - type: array - description: List of child validation errors. - items: - $ref: '#/components/schemas/ScriptValidationError' - required: - - childErrors - example: - general: - status: 400 - title: Script Invalid - detail: Script is invalid due to validation errors. - type: https://hivemq.com/edge/api/model/ScriptInvalidErrors - childErrors: - - detail: The length of script field '$.id' 1025 must be between 0 and 1024. - paths: $.id - value: aaa...aaa - actualLength: 1025 - expectedMinimumLength: 0 - expectedMaximumLength: 1024 - type: https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError - ScriptNotFoundError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The script ID. - example: abc - required: - - id - example: - general: - status: 404 - title: Script Not Found - detail: Script with ID 'abc' is not found. - id: abc - type: https://hivemq.com/edge/api/model/ScriptNotFoundError - ScriptParsingFailureError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 400 - title: Script Parsing Failure - detail: The given script 'abc' could not be parsed. - type: https://hivemq.com/edge/api/model/ScriptParsingFailureError - ScriptReferencedError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The script ID. - example: abc - required: - - id - example: - general: - status: 400 - title: Script Referenced - detail: Script with ID 'abc' is referenced. - id: abc - type: https://hivemq.com/edge/api/model/ScriptReferencedError - ScriptSanitationFailureError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 400 - title: Script Sanitation Failure - detail: The given script could not be sanitized. - type: https://hivemq.com/edge/api/model/ScriptSanitationFailureError - TopicFilterMismatchError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - path: - type: string - description: The json path of the topic filter. - example: $.filter - required: - - path - example: - general: - status: 400 - title: Topic Filter Mismatch - detail: The topic filter '$.filter' mismatches. - type: https://hivemq.com/edge/api/model/TopicFilterMismatchError - InsufficientStorageError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 507 - title: Insufficient Storage - detail: Insufficient Storage. - type: https://hivemq.com/edge/api/model/InsufficientStorageError - InternalServerError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 500 - title: Internal Server Error - detail: An unexpected error occurred, check the logs. - type: https://hivemq.com/edge/api/model/InternalServerError - creation: - status: 500 - title: Internal Server Error - detail: 'An unexpected error occurred: Exception during creation of the Json Schema for functions.' - type: https://hivemq.com/edge/api/model/InternalServerError - InvalidQueryParameterError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - parameter: - type: string - description: The query parameter. - required: - - parameter - example: - general: - status: 400 - title: Query Parameter is Invalid - detail: 'Query parameter ''a'' is invalid: ''a'' could not be parsed.' - parameter: a - type: https://hivemq.com/edge/api/model/InvalidQueryParameterError - PreconditionFailedError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 412 - title: Precondition Failed - detail: 'A precondition required for fulfilling the request was not fulfilled: Policy does not match the given etag ''abc''.' - type: https://hivemq.com/edge/api/model/PreconditionFailedError - RequestBodyMissingError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 400 - title: Required Request Body Missing - detail: Required request body is missing. - type: https://hivemq.com/edge/api/model/RequestBodyMissingError - RequestBodyParameterMissingError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - parameter: - type: string - description: The the missing request body parameter. - required: - - parameter - example: - general: - status: 400 - title: Required Request Body Parameter Missing - detail: Required request body parameter 'a' is missing. - parameter: a - type: https://hivemq.com/edge/api/model/RequestBodyParameterMissingError - TemporaryNotAvailableError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 503 - title: Endpoint Temporarily not Available - detail: The endpoint is temporarily not available, please try again later. - type: https://hivemq.com/edge/api/model/TemporaryNotAvailableError - UrlParameterMissingError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - parameter: - type: string - description: The name of the missing parameter. - required: - - parameter - example: - general: - status: 400 - title: Required URL Parameter Missing - detail: Required URL parameter 'a' is missing. - parameter: a - type: https://hivemq.com/edge/api/model/UrlParameterMissingError JsonNode: type: object description: The arguments of the fsm derived from the behavior policy. diff --git a/ext/hivemq-edge-openapi-2025.14.yaml b/ext/hivemq-edge-openapi-2025.14.yaml index 109e12c57d..b9a0673cd9 100644 --- a/ext/hivemq-edge-openapi-2025.14.yaml +++ b/ext/hivemq-edge-openapi-2025.14.yaml @@ -14,7 +14,7 @@ info: ## OpenAPI HiveMQ's REST API provides an OpenAPI 3.0 schema definition that can imported into popular API tooling (e.g. Postman) or can be used to generate client-code for multiple programming languages. title: HiveMQ Edge REST API - version: 2025.14-SNAPSHOT + version: 2025.12-SNAPSHOT x-logo: url: https://www.hivemq.com/img/svg/hivemq-bee.svg tags: @@ -357,12 +357,23 @@ paths: schema: $ref: '#/components/schemas/BehaviorPolicyList' description: Success + '400': + content: + application/problem+json: + schema: + oneOf: + - $ref: '#/components/schemas/InvalidQueryParameterError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' + description: URL parameter missing '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporarily not available + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Get all policies tags: - Data Hub - Behavior Policies @@ -447,34 +458,45 @@ paths: description: Success '400': content: - application/json: - schema: - $ref: '#/components/schemas/ProblemDetails' + application/problem+json: + schema: + oneOf: + - $ref: '#/components/schemas/BehaviorPolicyCreationFailureError' + - $ref: '#/components/schemas/BehaviorPolicyInvalidErrors' + - $ref: '#/components/schemas/BehaviorPolicyRejectedError' + - $ref: '#/components/schemas/RequestBodyMissingError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError: '#/components/schemas/BehaviorPolicyCreationFailureError' + https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors: '#/components/schemas/BehaviorPolicyInvalidErrors' + https://hivemq.com/edge/api/model/BehaviorPolicyRejectedError: '#/components/schemas/BehaviorPolicyRejectedError' + https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' description: Policy creation failed '409': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Already exists + $ref: '#/components/schemas/BehaviorPolicyAlreadyPresentError' + description: Behavior policy already present '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Internal error + $ref: '#/components/schemas/InternalServerError' + description: Internal server error '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporarily unavailable + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable '507': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Insufficient storage error + $ref: '#/components/schemas/PolicyInsufficientStorageError' + description: Insufficient storage summary: Create a new policy tags: - Data Hub - Behavior Policies @@ -504,34 +526,39 @@ paths: description: Success, no response body '400': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Policy not found + $ref: '#/components/schemas/PolicyNotFoundError' + description: Behavior policy not found '412': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/PreconditionFailedError' description: Precondition failed '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Internal error + $ref: '#/components/schemas/InternalServerError' + description: Internal server error '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporarily not available + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Delete a behavior policy tags: - Data Hub - Behavior Policies @@ -599,16 +626,33 @@ paths: description: Success '400': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Invalid query parameter + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + description: Bad request '404': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/BehaviorPolicyNotFoundError' description: Policy not found + '500': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/InternalServerError' + description: Internal server error + '503': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Get a policy tags: - Data Hub - Behavior Policies @@ -709,41 +753,56 @@ paths: description: Success '400': content: - application/json: - schema: - $ref: '#/components/schemas/ProblemDetails' - description: Policy creation failed + application/problem+json: + schema: + oneOf: + - $ref: '#/components/schemas/RequestBodyMissingError' + - $ref: '#/components/schemas/UrlParameterMissingError' + - $ref: '#/components/schemas/BehaviorPolicyCreationFailureError' + - $ref: '#/components/schemas/BehaviorPolicyInvalidErrors' + - $ref: '#/components/schemas/BehaviorPolicyUpdateFailureError' + - $ref: '#/components/schemas/PolicyIdMismatchError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError: '#/components/schemas/BehaviorPolicyCreationFailureError' + https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors: '#/components/schemas/BehaviorPolicyInvalidErrors' + https://hivemq.com/edge/api/model/BehaviorPolicyUpdateFailureError: '#/components/schemas/BehaviorPolicyUpdateFailureError' + https://hivemq.com/edge/api/model/PolicyIdMismatchError: '#/components/schemas/PolicyIdMismatchError' + description: Behavior policy creation failed '404': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Policy not found + $ref: '#/components/schemas/BehaviorPolicyNotFoundError' + description: Data policy not found '412': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/PreconditionFailedError' description: Precondition failed '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Internal error + $ref: '#/components/schemas/InternalServerError' + description: Internal server error '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporarily unavailable + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable '507': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Insufficient storage error - summary: Update an existing policy + $ref: '#/components/schemas/PolicyInsufficientStorageError' + description: Insufficient storage + summary: Update an existing behavior policy tags: - Data Hub - Behavior Policies /api/v1/data-hub/behavior-validation/states/{clientId}: @@ -787,22 +846,34 @@ paths: description: Success '400': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' description: URL parameter missing '404': content: - application/json: - schema: - $ref: '#/components/schemas/ProblemDetails' - description: Client is disconnected + application/problem+json: + schema: + oneOf: + - $ref: '#/components/schemas/ClientDisconnectedError' + - $ref: '#/components/schemas/ClientNotFoundError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/ClientDisconnectedError: '#/components/schemas/ClientDisconnectedError' + https://hivemq.com/edge/api/model/ClientNotFoundError: '#/components/schemas/ClientNotFoundError' + description: Client error '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Internal Server error + $ref: '#/components/schemas/InternalServerError' + description: Internal server error summary: Get the state of a client tags: - Data Hub - State @@ -1051,27 +1122,20 @@ paths: description: Success '400': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + oneOf: + - $ref: '#/components/schemas/InvalidQueryParameterError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' description: URL parameter missing - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/ProblemDetails' - description: DataPolicy not found - '500': - content: - application/json: - schema: - $ref: '#/components/schemas/ProblemDetails' - description: Internal server error '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable summary: Get all data policies tags: @@ -1155,33 +1219,44 @@ paths: description: Success '400': content: - application/json: - schema: - $ref: '#/components/schemas/ProblemDetails' - description: DataPolicy creation failed + application/problem+json: + schema: + oneOf: + - $ref: '#/components/schemas/RequestBodyMissingError' + - $ref: '#/components/schemas/DataPolicyCreationFailureError' + - $ref: '#/components/schemas/DataPolicyInvalidErrors' + - $ref: '#/components/schemas/DataPolicyRejectedError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' + https://hivemq.com/edge/api/model/DataPolicyCreationFailureError: '#/components/schemas/DataPolicyCreationFailureError' + https://hivemq.com/edge/api/model/DataPolicyInvalidErrors: '#/components/schemas/DataPolicyInvalidErrors' + https://hivemq.com/edge/api/model/DataPolicyRejectedError: '#/components/schemas/DataPolicyRejectedError' + description: Data policy creation failed '409': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: DataPolicy already present + $ref: '#/components/schemas/DataPolicyAlreadyPresentError' + description: Data policy already present '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable '507': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/PolicyInsufficientStorageError' description: Insufficient storage summary: Create a new data policy tags: @@ -1212,27 +1287,38 @@ paths: description: Success, no response body '400': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: DataPolicy not found + $ref: '#/components/schemas/PolicyNotFoundError' + description: Data policy not found + '412': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/PreconditionFailedError' + description: Precondition failed '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable summary: Delete a data policy tags: @@ -1300,32 +1386,33 @@ paths: description: Success '400': content: - application/json: - examples: - param-missing: - description: Example response when a required parameter is missing. - summary: Required URL parameter missing - value: - errors: - - title: Required parameter missing - detail: Required URL parameter 'parameterName' is missing + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' description: Bad request '404': content: - application/json: - examples: - not-found: - description: Policy not found - summary: Not found - value: - errors: - - title: Resource not found - detail: Resource with id 'my-resource-id' not found + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/PolicyNotFoundError' description: Resource not found + '500': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/InternalServerError' + description: Internal server error + '503': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Get a data policy tags: - Data Hub - Data Policies @@ -1425,33 +1512,56 @@ paths: description: Success '400': content: - application/json: - schema: - $ref: '#/components/schemas/ProblemDetails' - description: DataPolicy creation failed + application/problem+json: + schema: + oneOf: + - $ref: '#/components/schemas/RequestBodyMissingError' + - $ref: '#/components/schemas/UrlParameterMissingError' + - $ref: '#/components/schemas/DataPolicyCreationFailureError' + - $ref: '#/components/schemas/DataPolicyInvalidErrors' + - $ref: '#/components/schemas/DataPolicyUpdateFailureError' + - $ref: '#/components/schemas/PolicyIdMismatchError' + - $ref: '#/components/schemas/TopicFilterMismatchError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + https://hivemq.com/edge/api/model/DataPolicyCreationFailureError: '#/components/schemas/DataPolicyCreationFailureError' + https://hivemq.com/edge/api/model/DataPolicyInvalidErrors: '#/components/schemas/DataPolicyInvalidErrors' + https://hivemq.com/edge/api/model/DataPolicyUpdateFailureError: '#/components/schemas/DataPolicyUpdateFailureError' + https://hivemq.com/edge/api/model/PolicyIdMismatchError: '#/components/schemas/PolicyIdMismatchError' + https://hivemq.com/edge/api/model/TopicFilterMismatchError: '#/components/schemas/TopicFilterMismatchError' + description: Data policy creation failed '404': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: DataPolicy not found + $ref: '#/components/schemas/DataPolicyNotFoundError' + description: Data policy not found + '412': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/PreconditionFailedError' + description: Precondition failed '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable '507': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/PolicyInsufficientStorageError' description: Insufficient storage summary: Update an existing data policy tags: @@ -1537,9 +1647,9 @@ paths: description: Success '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/Errors' + $ref: '#/components/schemas/InternalServerError' description: Internal server error summary: Get all FSMs as a JSON Schema tags: @@ -1699,9 +1809,9 @@ paths: description: Success '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error summary: Get all functions as a JSON Schema tags: @@ -1719,9 +1829,9 @@ paths: description: Success '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error summary: Get all interpolation variables tags: @@ -1739,9 +1849,9 @@ paths: description: Success '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error summary: Get all functions as a list of function specifications tags: @@ -1876,11 +1986,22 @@ paths: schema: $ref: '#/components/schemas/SchemaList' description: Success + '400': + content: + application/problem+json: + schema: + oneOf: + - $ref: '#/components/schemas/InvalidQueryParameterError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' + description: URL parameter missing '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable summary: Get all schemas tags: @@ -1927,33 +2048,48 @@ paths: description: Success '400': content: - application/json: - schema: - $ref: '#/components/schemas/ProblemDetails' - description: Schema could not be validatetd + application/problem+json: + schema: + oneOf: + - $ref: '#/components/schemas/RequestBodyParameterMissingError' + - $ref: '#/components/schemas/SchemaInvalidErrors' + - $ref: '#/components/schemas/SchemaParsingFailureError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/RequestBodyParameterMissingError: '#/components/schemas/RequestBodyParameterMissingError' + https://hivemq.com/edge/api/model/SchemaInvalidErrors: '#/components/schemas/SchemaInvalidErrors' + https://hivemq.com/edge/api/model/SchemaParsingFailureError: '#/components/schemas/SchemaParsingFailureError' + description: Schema creation failed '409': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Schema already exists + $ref: '#/components/schemas/SchemaAlreadyPresentError' + description: Schema is already present '412': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Mismatch between schema and etag + $ref: '#/components/schemas/SchemaEtagMismatchError' + description: Schema doesn't match etag '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error + '503': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable '507': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/SchemaInsufficientStorageError' description: Insufficient storage summary: Create a new schema tags: @@ -1984,33 +2120,40 @@ paths: description: Success, no response body '400': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Schema referenced + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + - $ref: '#/components/schemas/SchemaReferencedError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + https://hivemq.com/edge/api/model/SchemaReferencedError: '#/components/schemas/SchemaReferencedError' + description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/SchemaNotFoundError' description: Schema not found '412': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Mismatch between schema and etag + $ref: '#/components/schemas/SchemaEtagMismatchError' + description: Schema doesn't match etag '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Internal server error + $ref: '#/components/schemas/InternalServerError' + description: Internal Server error '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable summary: Delete all versions of the schema tags: @@ -2056,22 +2199,33 @@ paths: description: Success '400': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: A url parameter is missing + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/SchemaNotFoundError' description: Schema not found '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error + '503': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Get a schema tags: - Data Hub - Schemas @@ -2192,12 +2346,23 @@ paths: schema: $ref: '#/components/schemas/ScriptList' description: Success + '400': + content: + application/problem+json: + schema: + oneOf: + - $ref: '#/components/schemas/InvalidQueryParameterError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' + description: URL parameter missing '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporary not available + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Get all scripts tags: - Data Hub - Scripts @@ -2243,39 +2408,52 @@ paths: description: Success '400': content: - application/json: - schema: - $ref: '#/components/schemas/ProblemDetails' - description: Script is invalid + application/problem+json: + schema: + oneOf: + - $ref: '#/components/schemas/RequestBodyParameterMissingError' + - $ref: '#/components/schemas/ScriptCreationFailureError' + - $ref: '#/components/schemas/ScriptInvalidErrors' + - $ref: '#/components/schemas/ScriptParsingFailureError' + - $ref: '#/components/schemas/ScriptSanitationFailureError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/RequestBodyParameterMissingError: '#/components/schemas/RequestBodyParameterMissingError' + https://hivemq.com/edge/api/model/ScriptCreationFailureError: '#/components/schemas/ScriptCreationFailureError' + https://hivemq.com/edge/api/model/ScriptInvalidErrors: '#/components/schemas/ScriptInvalidErrors' + https://hivemq.com/edge/api/model/ScriptParsingFailureError: '#/components/schemas/ScriptParsingFailureError' + https://hivemq.com/edge/api/model/ScriptSanitationFailureError: '#/components/schemas/ScriptSanitationFailureError' + description: Script creation failed '409': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/ScriptAlreadyPresentError' description: Script is already present '412': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/ScriptEtagMismatchError' description: Script doesn't match etag '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporary not available + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable '507': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/ScriptInsufficientStorageError' description: Insufficient storage summary: Create a new script tags: @@ -2303,34 +2481,41 @@ paths: description: Success, no response body '400': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Script is referenced + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + - $ref: '#/components/schemas/ScriptReferencedError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + https://hivemq.com/edge/api/model/ScriptReferencedError: '#/components/schemas/ScriptReferencedError' + description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/ScriptNotFoundError' description: Script not found '412': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/ScriptEtagMismatchError' description: Script doesn't match etag '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal Server error '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporary not available + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Delete a script tags: - Data Hub - Scripts @@ -2371,28 +2556,33 @@ paths: description: Success '400': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/ScriptNotFoundError' description: Script not found '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal Server error '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporary not available + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Get a script tags: - Data Hub - Scripts @@ -4868,6 +5058,7 @@ components: detail: type: string errors: + deprecated: true type: array items: $ref: '#/components/schemas/Error' @@ -5032,25 +5223,1283 @@ components: description: List of result items that are returned by this endpoint items: $ref: '#/components/schemas/BehaviorPolicy' - JsonNode: - type: object - description: The arguments of the fsm derived from the behavior policy. - FsmStateInformationItem: - type: object - description: List of result items that are returned by this endpoint - properties: - arguments: - $ref: '#/components/schemas/JsonNode' - behaviorId: - type: string - description: The unique identifier of the policy. - firstSetAt: - type: string - description: The timestamp when this state was set the first time. - policyId: - type: string - description: The unique identifier of the policy. - stateName: + ApiProblemDetails: + allOf: + - $ref: '#/components/schemas/ProblemDetails' + - type: object + required: + - detail + - status + - type + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/BehaviorPolicyAlreadyPresentError: '#/components/schemas/BehaviorPolicyAlreadyPresentError' + https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError: '#/components/schemas/BehaviorPolicyCreationFailureError' + https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors: '#/components/schemas/BehaviorPolicyInvalidErrors' + https://hivemq.com/edge/api/model/BehaviorPolicyNotFoundError: '#/components/schemas/BehaviorPolicyNotFoundError' + https://hivemq.com/edge/api/model/BehaviorPolicyRejectedError: '#/components/schemas/BehaviorPolicyRejectedError' + https://hivemq.com/edge/api/model/BehaviorPolicyUpdateFailureError: '#/components/schemas/BehaviorPolicyUpdateFailureError' + https://hivemq.com/edge/api/model/ClientDisconnectedError: '#/components/schemas/ClientDisconnectedError' + https://hivemq.com/edge/api/model/ClientNotFoundError: '#/components/schemas/ClientNotFoundError' + https://hivemq.com/edge/api/model/DataPolicyAlreadyPresentError: '#/components/schemas/DataPolicyAlreadyPresentError' + https://hivemq.com/edge/api/model/DataPolicyCreationFailureError: '#/components/schemas/DataPolicyCreationFailureError' + https://hivemq.com/edge/api/model/DataPolicyInvalidErrors: '#/components/schemas/DataPolicyInvalidErrors' + https://hivemq.com/edge/api/model/DataPolicyNotFoundError: '#/components/schemas/DataPolicyNotFoundError' + https://hivemq.com/edge/api/model/DataPolicyRejectedError: '#/components/schemas/DataPolicyRejectedError' + https://hivemq.com/edge/api/model/DataPolicyUpdateFailureError: '#/components/schemas/DataPolicyUpdateFailureError' + https://hivemq.com/edge/api/model/PolicyIdMismatchError: '#/components/schemas/PolicyIdMismatchError' + https://hivemq.com/edge/api/model/PolicyInsufficientStorageError: '#/components/schemas/PolicyInsufficientStorageError' + https://hivemq.com/edge/api/model/PolicyNotFoundError: '#/components/schemas/PolicyNotFoundError' + https://hivemq.com/edge/api/model/SchemaAlreadyPresentError: '#/components/schemas/SchemaAlreadyPresentError' + https://hivemq.com/edge/api/model/SchemaEtagMismatchError: '#/components/schemas/SchemaEtagMismatchError' + https://hivemq.com/edge/api/model/SchemaInsufficientStorageError: '#/components/schemas/SchemaInsufficientStorageError' + https://hivemq.com/edge/api/model/SchemaInvalidErrors: '#/components/schemas/SchemaInvalidErrors' + https://hivemq.com/edge/api/model/SchemaNotFoundError: '#/components/schemas/SchemaNotFoundError' + https://hivemq.com/edge/api/model/SchemaParsingFailureError: '#/components/schemas/SchemaParsingFailureError' + https://hivemq.com/edge/api/model/SchemaReferencedError: '#/components/schemas/SchemaReferencedError' + https://hivemq.com/edge/api/model/ScriptAlreadyPresentError: '#/components/schemas/ScriptAlreadyPresentError' + https://hivemq.com/edge/api/model/ScriptCreationFailureError: '#/components/schemas/ScriptCreationFailureError' + https://hivemq.com/edge/api/model/ScriptEtagMismatchError: '#/components/schemas/ScriptEtagMismatchError' + https://hivemq.com/edge/api/model/ScriptInsufficientStorageError: '#/components/schemas/ScriptInsufficientStorageError' + https://hivemq.com/edge/api/model/ScriptInvalidErrors: '#/components/schemas/ScriptInvalidErrors' + https://hivemq.com/edge/api/model/ScriptNotFoundError: '#/components/schemas/ScriptNotFoundError' + https://hivemq.com/edge/api/model/ScriptParsingFailureError: '#/components/schemas/ScriptParsingFailureError' + https://hivemq.com/edge/api/model/ScriptReferencedError: '#/components/schemas/ScriptReferencedError' + https://hivemq.com/edge/api/model/ScriptSanitationFailureError: '#/components/schemas/ScriptSanitationFailureError' + https://hivemq.com/edge/api/model/TopicFilterMismatchError: '#/components/schemas/TopicFilterMismatchError' + https://hivemq.com/edge/api/model/InsufficientStorageError: '#/components/schemas/InsufficientStorageError' + https://hivemq.com/edge/api/model/InternalServerError: '#/components/schemas/InternalServerError' + https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' + https://hivemq.com/edge/api/model/PreconditionFailedError: '#/components/schemas/PreconditionFailedError' + https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' + https://hivemq.com/edge/api/model/RequestBodyParameterMissingError: '#/components/schemas/RequestBodyParameterMissingError' + https://hivemq.com/edge/api/model/TemporaryNotAvailableError: '#/components/schemas/TemporaryNotAvailableError' + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + BehaviorPolicyAlreadyPresentError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The behavior policy id. + example: abc + required: + - id + example: + general: + status: 409 + title: Behavior Policy Already Present + detail: The given behavior policy 'abc' is already present. + id: abc + type: https://hivemq.com/edge/api/model/BehaviorPolicyAlreadyPresentError + BehaviorPolicyCreationFailureError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 400 + title: Behavior Policy Creation Failed + detail: 'Behavior policy creation failed: The policy was rejected.' + type: https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError + AtLeastOneFieldMissingValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + paths: + type: array + description: The missing json paths. + items: + type: string + format: json-path + description: The json path. + example: + - $.field1 + - $.field2 + required: + - paths + example: + general: + detail: 'At least one of the fields must be present: ''$.field1'', ''$.field2''.' + paths: + - $.field1 + - $.field2 + type: https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError + ValidationError: + type: object + properties: + detail: + type: string + description: Detailed contextual description of the validation error. + type: + type: string + format: uri + description: Type of the validation error. + required: + - detail + - type + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError: '#/components/schemas/AtLeastOneFieldMissingValidationError' + https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError: '#/components/schemas/AtMostOneFunctionValidationError' + https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' + https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError: '#/components/schemas/FunctionMustBePairedValidationError' + https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError: '#/components/schemas/IllegalEventTransitionValidationError' + https://hivemq.com/edge/api/model/IllegalFunctionValidationError: '#/components/schemas/IllegalFunctionValidationError' + https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' + https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' + https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError: '#/components/schemas/InvalidFunctionOrderValidationError' + https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' + https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError: '#/components/schemas/InvalidSchemaVersionValidationError' + https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' + https://hivemq.com/edge/api/model/UnknownVariableValidationError: '#/components/schemas/UnknownVariableValidationError' + https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' + AtMostOneFunctionValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + function: + type: string + description: The function. + example: function1 + occurrences: + type: integer + format: int32 + description: The occurrences of the function. + minimum: 0 + example: 3 + paths: + type: array + items: + type: string + format: json-path + description: The json paths where the function occurs. + example: + - $.path1 + - $.path2 + - $.path3 + required: + - function + - occurrences + - paths + example: + general: + detail: The pipeline must contain at most one 'function1' function, but 3 were found at ['$.path1', '$.path2', '$.path3']. + function: function1 + occurrences: 3 + paths: + - $.path1 + - $.path2 + - $.path3 + type: https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError + EmptyFieldValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + path: + type: string + format: json-path + description: The missing field. + example: $.field + required: + - path + example: + general: + detail: Required field '$.field' is empty. + path: $.field + type: https://hivemq.com/edge/api/model/EmptyFieldValidationError + FunctionMustBePairedValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + existingFunction: + type: string + description: The existing function. + example: function1 + missingFunction: + type: string + description: The missing function. + example: function2 + required: + - existingFunction + - missingFunction + example: + general: + detail: If 'function1' function is present in the pipeline, 'function2' function must be present as well. + existingFunction: function1 + missingFunction: function2 + type: https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError + IllegalEventTransitionValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + event: + type: string + description: The event name. + example: event1 + fromState: + type: string + description: The event from state. + example: state1 + id: + type: string + description: The event id. + example: abc + path: + type: string + description: The path. + example: $.event + toState: + type: string + description: The event to state. + example: state2 + required: + - event + - fromState + - id + - path + - toState + example: + general: + detail: The transition from state 'state1' to state 'state2' on event 'event1' in '$.event' is not defined for behavior 'abc'. + event: event1 + fromState: state1 + toState: state2 + id: abc + path: $.event + type: https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError + IllegalFunctionValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + event: + type: string + description: The event name. + example: event1 + id: + type: string + description: The function id. + example: abc + path: + type: string + format: json-path + description: The json path. + example: $.event + required: + - event + - id + - path + example: + general: + detail: The function 'abc' is not allowed for event 'event1' in '$.event'. + event: event1 + id: abc + path: $.event + type: https://hivemq.com/edge/api/model/IllegalFunctionValidationError + InvalidFieldLengthValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + actualLength: + type: integer + format: int32 + description: The actual length of the field value. + example: 10 + expectedMinimumLength: + type: integer + format: int32 + description: The minimum length expected for the field value. + minimum: 0 + example: 5 + expectedMaximumLength: + type: integer + format: int32 + description: The maximum length expected for the field value. + minimum: 0 + example: 20 + path: + type: string + format: json-path + description: The invalid json path. + example: $.field + value: + type: string + description: The invalid value. + example: function transform() { return 'Hello, World!'; } + required: + - actualLength + - expectedMinimumLength + - expectedMaximumLength + - path + - value + example: + general: + detail: The length of script field '$.transform' 48 must be between 0 and 20. + actualLength: 48 + minimumLength: 0 + maximumLength: 20 + path: $.transform + value: function transform() { return 'Hello, World!'; } + type: https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError + InvalidFieldValueValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + path: + type: string + format: json-path + description: The invalid json path. + example: $.action.pipeline[1].field + value: + type: string + description: The invalid value. + example: functionDoesNotExist + required: + - path + example: + general: + detail: Referenced function does not exist. + path: $.action.pipeline[1].field + value: functionDoesNotExist + type: https://hivemq.com/edge/api/model/InvalidFieldValueValidationError + InvalidFunctionOrderValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + function: + type: string + description: The function. + example: transform + path: + type: string + format: json-path + description: The json path. + example: $.path + previousFunction: + type: string + description: The previous function. + example: init + required: + - function + - path + - previousFunction + example: + general: + detail: The operation at '$.path' with the functionId 'transform' must be after a 'init' operation. + function: transform + path: $.path + previousFunction: init + type: https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError + InvalidIdentifierValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + path: + type: string + format: json-path + description: The invalid identifier path. + example: $.id + value: + type: string + description: The invalid identifier value. + example: invalidId + required: + - path + - value + example: + general: + detail: Identifier script 'id' must begin with a letter and may only consist of lowercase letters, uppercase letters, numbers, periods, hyphens, and underscores. + path: $.id + value: invalidId + type: https://hivemq.com/edge/api/model/InvalidIdentifierValidationError + InvalidSchemaVersionValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + id: + type: string + description: The schema id. + example: abc + version: + type: string + description: The schema version. + example: '2' + required: + - id + - version + example: + general: + detail: The referenced schema with id 'abc' and version '2' was not found. + id: abc + version: '2' + type: https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError + MissingFieldValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + path: + type: string + format: json-path + description: The missing path. + example: $.id + required: + - path + example: + general: + detail: Required field '$.id' is missing. + path: $.id + type: https://hivemq.com/edge/api/model/MissingFieldValidationError + UnknownVariableValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + path: + type: string + description: The json path of the field. + example: $.path + variables: + type: array + items: + type: string + description: The unknown variables. + example: + - a + - b + - c + required: + - path + - variables + example: + general: + detail: 'Field ''$.path'' contains unknown variables: [a, b, c].' + path: $.path + variables: + - a + - b + - c + type: https://hivemq.com/edge/api/model/UnknownVariableValidationError + UnsupportedFieldValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + actualValue: + type: string + description: The actual value. + expectedValue: + type: string + description: The expected value. + path: + type: string + format: json-path + description: The json path. + example: $.id + required: + - actualValue + - expectedValue + - path + example: + general: + detail: Unsupported type 'String' for field '$.id'. Expected type is 'Object'. + actualValue: String + expectedValue: Object + path: $.id + type: https://hivemq.com/edge/api/model/UnsupportedFieldValidationError + BehaviorPolicyValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - oneOf: + - $ref: '#/components/schemas/IllegalEventTransitionValidationError' + - $ref: '#/components/schemas/IllegalFunctionValidationError' + - $ref: '#/components/schemas/InvalidSchemaVersionValidationError' + - $ref: '#/components/schemas/AtLeastOneFieldMissingValidationError' + - $ref: '#/components/schemas/EmptyFieldValidationError' + - $ref: '#/components/schemas/InvalidFieldLengthValidationError' + - $ref: '#/components/schemas/InvalidFieldValueValidationError' + - $ref: '#/components/schemas/InvalidIdentifierValidationError' + - $ref: '#/components/schemas/MissingFieldValidationError' + - $ref: '#/components/schemas/UnsupportedFieldValidationError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError: '#/components/schemas/AtLeastOneFieldMissingValidationError' + https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' + https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError: '#/components/schemas/IllegalEventTransitionValidationError' + https://hivemq.com/edge/api/model/IllegalFunctionValidationError: '#/components/schemas/IllegalFunctionValidationError' + https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' + https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' + https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' + https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError: '#/components/schemas/InvalidSchemaVersionValidationError' + https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' + https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' + BehaviorPolicyInvalidErrors: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + childErrors: + type: array + description: List of child validation errors. + items: + $ref: '#/components/schemas/BehaviorPolicyValidationError' + required: + - childErrors + example: + general: + status: 400 + title: Behavior Policy Invalid + detail: Behavior policy is invalid due to validation errors. + type: https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors + childErrors: + - detail: The transition from state 'state1' to state 'state2' on event 'event1' in '$.path' is not defined for behavior 'id1'. + fromState: state1 + toState: state2 + path: $.path + id: id1 + type: https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError + BehaviorPolicyNotFoundError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The data policy id. + example: abc + required: + - id + example: + general: + status: 404 + title: Behavior Policy Not Found + detail: Behavior policy with ID 'abc' is not found. + id: abc + type: https://hivemq.com/edge/api/model/BehaviorPolicyNotFoundError + BehaviorPolicyRejectedError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 400 + title: Behavior Policy Rejected + detail: Behavior policy is rejected. + type: https://hivemq.com/edge/api/model/BehaviorPolicyRejectedError + BehaviorPolicyUpdateFailureError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The ID of the policy that failed to update. + example: abc + required: + - id + example: + general: + status: 400 + title: Behavior Policy Update Failed + detail: Behavior policy with ID 'abc' update failed. + id: abc + type: https://hivemq.com/edge/api/model/BehaviorPolicyUpdateFailureError + ClientDisconnectedError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The client id. + example: abc + required: + - id + example: + general: + status: 404 + title: Client Disconnected + detail: Client with ID 'abc' is disconnected. + id: abc + type: https://hivemq.com/edge/api/model/ClientDisconnectedError + ClientNotFoundError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The client id. + example: abc + required: + - id + example: + general: + status: 404 + title: Client Not Found + detail: Client with ID 'abc' is not found. + id: abc + type: https://hivemq.com/edge/api/model/ClientNotFoundError + DataPolicyAlreadyPresentError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The data policy id. + example: abc + required: + - id + example: + general: + status: 409 + title: Data Policy Already Present + detail: The given data policy 'abc' is already present. + id: abc + type: https://hivemq.com/edge/api/model/DataPolicyAlreadyPresentError + DataPolicyCreationFailureError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 400 + title: Data Policy Creation Failed + detail: 'Data policy creation failed: The policy was rejected.' + type: https://hivemq.com/edge/api/model/DataPolicyCreationFailureError + DataPolicyValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - oneOf: + - $ref: '#/components/schemas/AtMostOneFunctionValidationError' + - $ref: '#/components/schemas/FunctionMustBePairedValidationError' + - $ref: '#/components/schemas/InvalidFunctionOrderValidationError' + - $ref: '#/components/schemas/InvalidSchemaVersionValidationError' + - $ref: '#/components/schemas/UnknownVariableValidationError' + - $ref: '#/components/schemas/EmptyFieldValidationError' + - $ref: '#/components/schemas/InvalidFieldLengthValidationError' + - $ref: '#/components/schemas/InvalidFieldValueValidationError' + - $ref: '#/components/schemas/InvalidIdentifierValidationError' + - $ref: '#/components/schemas/MissingFieldValidationError' + - $ref: '#/components/schemas/UnsupportedFieldValidationError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError: '#/components/schemas/AtMostOneFunctionValidationError' + https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' + https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError: '#/components/schemas/FunctionMustBePairedValidationError' + https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' + https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' + https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError: '#/components/schemas/InvalidFunctionOrderValidationError' + https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' + https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError: '#/components/schemas/InvalidSchemaVersionValidationError' + https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' + https://hivemq.com/edge/api/model/UnknownVariableValidationError: '#/components/schemas/UnknownVariableValidationError' + https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' + DataPolicyInvalidErrors: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + childErrors: + type: array + description: List of child validation errors. + items: + $ref: '#/components/schemas/DataPolicyValidationError' + required: + - childErrors + example: + general: + status: 400 + title: Data Policy Invalid + detail: Data policy is invalid due to validation errors. + type: https://hivemq.com/edge/api/model/DataPolicyInvalidErrors + childErrors: + - detail: The pipeline must contain at most one 'function1' function, but 3 were found at ['$.path1', '$.path2', '$.path3']. + function: function1 + occurrences: 3 + paths: + - $.path1 + - $.path2 + - $.path3 + type: https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError + DataPolicyNotFoundError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The data policy id. + example: abc + required: + - id + example: + general: + status: 404 + title: Data Policy Not Found + detail: Data policy with ID 'abc' is not found. + id: abc + type: https://hivemq.com/edge/api/model/DataPolicyNotFoundError + DataPolicyRejectedError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 400 + title: Data Policy Rejected + detail: Data policy is rejected. + type: https://hivemq.com/edge/api/model/DataPolicyRejectedError + DataPolicyUpdateFailureError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The ID of the policy that failed to update. + example: abc + required: + - id + example: + general: + status: 400 + title: Data Policy Update Failed + detail: Data policy with ID 'abc' update failed. + id: abc + type: https://hivemq.com/edge/api/model/DataPolicyUpdateFailureError + PolicyIdMismatchError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + actualId: + type: string + description: The actual id. + example: id1 + expectedId: + type: string + description: The expected id. + example: id2 + required: + - actualId + - expectedId + example: + general: + status: 400 + title: Policy ID Mismatch + detail: The policy ID 'id1' in the request parameter does not match the policy ID 'id2' in the policy request body. + id: abc + type: https://hivemq.com/edge/api/model/PolicyIdMismatchError + PolicyInsufficientStorageError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The policy id. + example: abc + required: + - id + example: + general: + status: 507 + title: Policy Insufficient Storage + detail: Policy with ID '123' could not be added because of insufficient server storage. + id: abc + type: https://hivemq.com/edge/api/model/PolicyInsufficientStorageError + PolicyNotFoundError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The policy id. + example: abc + required: + - id + example: + general: + status: 404 + title: Policy Not Found + detail: Policy with ID 'abc' is not found. + id: abc + type: https://hivemq.com/edge/api/model/PolicyNotFoundError + SchemaAlreadyPresentError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The schema id. + example: abc + required: + - id + example: + general: + status: 409 + title: Schema Already Present + detail: The given schema is already present as the latest version for the schema id 'abc'. + id: abc + type: https://hivemq.com/edge/api/model/SchemaAlreadyPresentError + SchemaEtagMismatchError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The schema id. + example: abc + eTag: + type: string + description: The eTag. + example: 33a64df551425fcc55e4d42a148795d9f25f89d4 + required: + - id + example: + general: + status: 412 + title: Schema eTag Mismatch + detail: Schema with id 'abc' does not match the given etag '33a64df551425fcc55e4d42a148795d9f25f89d4'. + id: abc + eTag: 33a64df551425fcc55e4d42a148795d9f25f89d4 + type: https://hivemq.com/edge/api/model/SchemaEtagMismatchError + SchemaInsufficientStorageError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The policy id. + example: abc + required: + - id + example: + general: + status: 507 + title: Schema Insufficient Storage + detail: Schema with ID '123' could not be added because of insufficient server storage. + id: abc + type: https://hivemq.com/edge/api/model/SchemaInsufficientStorageError + SchemaValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - oneOf: + - $ref: '#/components/schemas/EmptyFieldValidationError' + - $ref: '#/components/schemas/InvalidFieldLengthValidationError' + - $ref: '#/components/schemas/InvalidFieldValueValidationError' + - $ref: '#/components/schemas/InvalidIdentifierValidationError' + - $ref: '#/components/schemas/MissingFieldValidationError' + - $ref: '#/components/schemas/UnsupportedFieldValidationError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' + https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' + https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' + https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' + https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' + https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' + SchemaInvalidErrors: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + childErrors: + type: array + description: List of child validation errors. + items: + $ref: '#/components/schemas/SchemaValidationError' + required: + - childErrors + example: + general: + status: 400 + title: Schema Invalid + detail: Schema is invalid due to validation errors. + type: https://hivemq.com/edge/api/model/SchemaInvalidErrors + childErrors: + - detail: The length of script field '$.id' 1025 must be between 0 and 1024. + paths: $.id + value: aaa...aaa + actualLength: 1025 + expectedMinimumLength: 0 + expectedMaximumLength: 1024 + type: https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError + SchemaNotFoundError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The schema ID. + example: abc + required: + - id + example: + general: + status: 404 + title: Schema Not Found + detail: Schema with ID 'abc' is not found. + id: abc + type: https://hivemq.com/edge/api/model/SchemaNotFoundError + SchemaParsingFailureError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + alias: + type: string + description: The schema alias. + example: abc + required: + - alias + example: + general: + status: 400 + title: Schema Parsing Failure + detail: The given schema 'abc' could not be parsed. + alias: abc + type: https://hivemq.com/edge/api/model/SchemaParsingFailureError + SchemaReferencedError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The schema ID. + example: abc + required: + - id + example: + general: + status: 400 + title: Schema Referenced + detail: Schema with ID 'abc' is referenced. + id: abc + type: https://hivemq.com/edge/api/model/SchemaReferencedError + ScriptAlreadyPresentError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The script id. + example: abc + required: + - id + example: + general: + status: 409 + title: Script Already Present + detail: The given script 'abc' is already present. + id: abc + type: https://hivemq.com/edge/api/model/ScriptAlreadyPresentError + ScriptCreationFailureError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 400 + title: Script Creation Failure + detail: The given script could not be created. + type: https://hivemq.com/edge/api/model/ScriptCreationFailureError + ScriptEtagMismatchError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The script id. + example: abc + eTag: + type: string + description: The eTag. + example: 33a64df551425fcc55e4d42a148795d9f25f89d4 + required: + - id + example: + general: + status: 412 + title: Script eTag Mismatch + detail: Script with id 'abc' does not match the given etag '33a64df551425fcc55e4d42a148795d9f25f89d4'. + id: abc + eTag: 33a64df551425fcc55e4d42a148795d9f25f89d4 + type: https://hivemq.com/edge/api/model/ScriptEtagMismatchError + ScriptInsufficientStorageError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The policy id. + example: abc + required: + - id + example: + general: + status: 507 + title: Script Insufficient Storage + detail: Script with ID '123' could not be added because of insufficient server storage. + id: abc + type: https://hivemq.com/edge/api/model/ScriptInsufficientStorageError + ScriptValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - oneOf: + - $ref: '#/components/schemas/InvalidFieldLengthValidationError' + - $ref: '#/components/schemas/InvalidFieldValueValidationError' + - $ref: '#/components/schemas/InvalidIdentifierValidationError' + - $ref: '#/components/schemas/MissingFieldValidationError' + - $ref: '#/components/schemas/UnsupportedFieldValidationError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' + https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' + https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' + https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' + https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' + ScriptInvalidErrors: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + childErrors: + type: array + description: List of child validation errors. + items: + $ref: '#/components/schemas/ScriptValidationError' + required: + - childErrors + example: + general: + status: 400 + title: Script Invalid + detail: Script is invalid due to validation errors. + type: https://hivemq.com/edge/api/model/ScriptInvalidErrors + childErrors: + - detail: The length of script field '$.id' 1025 must be between 0 and 1024. + paths: $.id + value: aaa...aaa + actualLength: 1025 + expectedMinimumLength: 0 + expectedMaximumLength: 1024 + type: https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError + ScriptNotFoundError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The script ID. + example: abc + required: + - id + example: + general: + status: 404 + title: Script Not Found + detail: Script with ID 'abc' is not found. + id: abc + type: https://hivemq.com/edge/api/model/ScriptNotFoundError + ScriptParsingFailureError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 400 + title: Script Parsing Failure + detail: The given script 'abc' could not be parsed. + type: https://hivemq.com/edge/api/model/ScriptParsingFailureError + ScriptReferencedError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The script ID. + example: abc + required: + - id + example: + general: + status: 400 + title: Script Referenced + detail: Script with ID 'abc' is referenced. + id: abc + type: https://hivemq.com/edge/api/model/ScriptReferencedError + ScriptSanitationFailureError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 400 + title: Script Sanitation Failure + detail: The given script could not be sanitized. + type: https://hivemq.com/edge/api/model/ScriptSanitationFailureError + TopicFilterMismatchError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + path: + type: string + description: The json path of the topic filter. + example: $.filter + required: + - path + example: + general: + status: 400 + title: Topic Filter Mismatch + detail: The topic filter '$.filter' mismatches. + type: https://hivemq.com/edge/api/model/TopicFilterMismatchError + InsufficientStorageError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 507 + title: Insufficient Storage + detail: Insufficient Storage. + type: https://hivemq.com/edge/api/model/InsufficientStorageError + InternalServerError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 500 + title: Internal Server Error + detail: An unexpected error occurred, check the logs. + type: https://hivemq.com/edge/api/model/InternalServerError + creation: + status: 500 + title: Internal Server Error + detail: 'An unexpected error occurred: Exception during creation of the Json Schema for functions.' + type: https://hivemq.com/edge/api/model/InternalServerError + InvalidQueryParameterError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + parameter: + type: string + description: The query parameter. + required: + - parameter + example: + general: + status: 400 + title: Query Parameter is Invalid + detail: 'Query parameter ''a'' is invalid: ''a'' could not be parsed.' + parameter: a + type: https://hivemq.com/edge/api/model/InvalidQueryParameterError + PreconditionFailedError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 412 + title: Precondition Failed + detail: 'A precondition required for fulfilling the request was not fulfilled: Policy does not match the given etag ''abc''.' + type: https://hivemq.com/edge/api/model/PreconditionFailedError + RequestBodyMissingError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 400 + title: Required Request Body Missing + detail: Required request body is missing. + type: https://hivemq.com/edge/api/model/RequestBodyMissingError + RequestBodyParameterMissingError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + parameter: + type: string + description: The the missing request body parameter. + required: + - parameter + example: + general: + status: 400 + title: Required Request Body Parameter Missing + detail: Required request body parameter 'a' is missing. + parameter: a + type: https://hivemq.com/edge/api/model/RequestBodyParameterMissingError + TemporaryNotAvailableError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 503 + title: Endpoint Temporarily not Available + detail: The endpoint is temporarily not available, please try again later. + type: https://hivemq.com/edge/api/model/TemporaryNotAvailableError + UrlParameterMissingError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + parameter: + type: string + description: The name of the missing parameter. + required: + - parameter + example: + general: + status: 400 + title: Required URL Parameter Missing + detail: Required URL parameter 'a' is missing. + parameter: a + type: https://hivemq.com/edge/api/model/UrlParameterMissingError + JsonNode: + type: object + description: The arguments of the fsm derived from the behavior policy. + FsmStateInformationItem: + type: object + description: List of result items that are returned by this endpoint + properties: + arguments: + $ref: '#/components/schemas/JsonNode' + behaviorId: + type: string + description: The unique identifier of the policy. + firstSetAt: + type: string + description: The timestamp when this state was set the first time. + policyId: + type: string + description: The unique identifier of the policy. + stateName: type: string description: The name of the fsm state. stateType: @@ -5153,8 +6602,6 @@ components: description: List of result items that are returned by this endpoint items: $ref: '#/components/schemas/DataPolicy' - Errors: - type: object PolicyType: description: The type of policy in Data Hub type: string diff --git a/ext/hivemq-edge-openapi-2025.9.yaml b/ext/hivemq-edge-openapi-2025.9.yaml index 6a9eaf3983..562119c64c 100644 --- a/ext/hivemq-edge-openapi-2025.9.yaml +++ b/ext/hivemq-edge-openapi-2025.9.yaml @@ -352,23 +352,12 @@ paths: schema: $ref: '#/components/schemas/BehaviorPolicyList' description: Success - '400': - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/InvalidQueryParameterError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' - description: URL parameter missing '503': content: application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable + $ref: '#/components/schemas/ProblemDetails' + description: Temporarily not available summary: Get all policies tags: - Data Hub - Behavior Policies @@ -455,43 +444,32 @@ paths: content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/BehaviorPolicyCreationFailureError' - - $ref: '#/components/schemas/BehaviorPolicyInvalidErrors' - - $ref: '#/components/schemas/BehaviorPolicyRejectedError' - - $ref: '#/components/schemas/RequestBodyMissingError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError: '#/components/schemas/BehaviorPolicyCreationFailureError' - https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors: '#/components/schemas/BehaviorPolicyInvalidErrors' - https://hivemq.com/edge/api/model/BehaviorPolicyRejectedError: '#/components/schemas/BehaviorPolicyRejectedError' - https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' + $ref: '#/components/schemas/ProblemDetails' description: Policy creation failed '409': content: application/json: schema: - $ref: '#/components/schemas/BehaviorPolicyAlreadyPresentError' - description: Behavior policy already present + $ref: '#/components/schemas/ProblemDetails' + description: Already exists '500': content: application/json: schema: - $ref: '#/components/schemas/InternalServerError' - description: Internal server error + $ref: '#/components/schemas/ProblemDetails' + description: Internal error '503': content: application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable + $ref: '#/components/schemas/ProblemDetails' + description: Temporarily unavailable '507': content: application/json: schema: - $ref: '#/components/schemas/PolicyInsufficientStorageError' - description: Insufficient storage + $ref: '#/components/schemas/ProblemDetails' + description: Insufficient storage error summary: Create a new policy tags: - Data Hub - Behavior Policies @@ -523,37 +501,32 @@ paths: content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + $ref: '#/components/schemas/ProblemDetails' description: URL parameter missing '404': content: application/json: schema: - $ref: '#/components/schemas/PolicyNotFoundError' - description: Behavior policy not found + $ref: '#/components/schemas/ProblemDetails' + description: Policy not found '412': content: application/json: schema: - $ref: '#/components/schemas/PreconditionFailedError' + $ref: '#/components/schemas/ProblemDetails' description: Precondition failed '500': content: application/json: schema: - $ref: '#/components/schemas/InternalServerError' - description: Internal server error + $ref: '#/components/schemas/ProblemDetails' + description: Internal error '503': content: application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable + $ref: '#/components/schemas/ProblemDetails' + description: Temporarily not available summary: Delete a behavior policy tags: - Data Hub - Behavior Policies @@ -623,31 +596,14 @@ paths: content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' - description: Bad request + $ref: '#/components/schemas/ProblemDetails' + description: Invalid query parameter '404': content: application/json: schema: - $ref: '#/components/schemas/BehaviorPolicyNotFoundError' + $ref: '#/components/schemas/ProblemDetails' description: Policy not found - '500': - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerError' - description: Internal server error - '503': - content: - application/json: - schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable summary: Get a policy tags: - Data Hub - Behavior Policies @@ -750,54 +706,39 @@ paths: content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/RequestBodyMissingError' - - $ref: '#/components/schemas/UrlParameterMissingError' - - $ref: '#/components/schemas/BehaviorPolicyCreationFailureError' - - $ref: '#/components/schemas/BehaviorPolicyInvalidErrors' - - $ref: '#/components/schemas/BehaviorPolicyUpdateFailureError' - - $ref: '#/components/schemas/PolicyIdMismatchError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' - https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError: '#/components/schemas/BehaviorPolicyCreationFailureError' - https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors: '#/components/schemas/BehaviorPolicyInvalidErrors' - https://hivemq.com/edge/api/model/BehaviorPolicyUpdateFailureError: '#/components/schemas/BehaviorPolicyUpdateFailureError' - https://hivemq.com/edge/api/model/PolicyIdMismatchError: '#/components/schemas/PolicyIdMismatchError' - description: Behavior policy creation failed + $ref: '#/components/schemas/ProblemDetails' + description: Policy creation failed '404': content: application/json: schema: - $ref: '#/components/schemas/BehaviorPolicyNotFoundError' - description: Data policy not found + $ref: '#/components/schemas/ProblemDetails' + description: Policy not found '412': content: application/json: schema: - $ref: '#/components/schemas/PreconditionFailedError' + $ref: '#/components/schemas/ProblemDetails' description: Precondition failed '500': content: application/json: schema: - $ref: '#/components/schemas/InternalServerError' - description: Internal server error + $ref: '#/components/schemas/ProblemDetails' + description: Internal error '503': content: application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable + $ref: '#/components/schemas/ProblemDetails' + description: Temporarily unavailable '507': content: application/json: schema: - $ref: '#/components/schemas/PolicyInsufficientStorageError' - description: Insufficient storage - summary: Update an existing behavior policy + $ref: '#/components/schemas/ProblemDetails' + description: Insufficient storage error + summary: Update an existing policy tags: - Data Hub - Behavior Policies /api/v1/data-hub/behavior-validation/states/{clientId}: @@ -843,32 +784,20 @@ paths: content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + $ref: '#/components/schemas/ProblemDetails' description: URL parameter missing '404': content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/ClientDisconnectedError' - - $ref: '#/components/schemas/ClientNotFoundError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/ClientDisconnectedError: '#/components/schemas/ClientDisconnectedError' - https://hivemq.com/edge/api/model/ClientNotFoundError: '#/components/schemas/ClientNotFoundError' - description: Client error + $ref: '#/components/schemas/ProblemDetails' + description: Client is disconnected '500': content: application/json: schema: - $ref: '#/components/schemas/InternalServerError' - description: Internal server error + $ref: '#/components/schemas/ProblemDetails' + description: Internal Server error summary: Get the state of a client tags: - Data Hub - State @@ -1119,18 +1048,25 @@ paths: content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/InvalidQueryParameterError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' + $ref: '#/components/schemas/ProblemDetails' description: URL parameter missing + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: DataPolicy not found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: Internal server error '503': content: application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' + $ref: '#/components/schemas/ProblemDetails' description: Request resource temporary unavailable summary: Get all data policies tags: @@ -1216,42 +1152,31 @@ paths: content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/RequestBodyMissingError' - - $ref: '#/components/schemas/DataPolicyCreationFailureError' - - $ref: '#/components/schemas/DataPolicyInvalidErrors' - - $ref: '#/components/schemas/DataPolicyRejectedError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' - https://hivemq.com/edge/api/model/DataPolicyCreationFailureError: '#/components/schemas/DataPolicyCreationFailureError' - https://hivemq.com/edge/api/model/DataPolicyInvalidErrors: '#/components/schemas/DataPolicyInvalidErrors' - https://hivemq.com/edge/api/model/DataPolicyRejectedError: '#/components/schemas/DataPolicyRejectedError' - description: Data policy creation failed + $ref: '#/components/schemas/ProblemDetails' + description: DataPolicy creation failed '409': content: application/json: schema: - $ref: '#/components/schemas/DataPolicyAlreadyPresentError' - description: Data policy already present + $ref: '#/components/schemas/ProblemDetails' + description: DataPolicy already present '500': content: application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error '503': content: application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' + $ref: '#/components/schemas/ProblemDetails' description: Request resource temporary unavailable '507': content: application/json: schema: - $ref: '#/components/schemas/PolicyInsufficientStorageError' + $ref: '#/components/schemas/ProblemDetails' description: Insufficient storage summary: Create a new data policy tags: @@ -1284,36 +1209,25 @@ paths: content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + $ref: '#/components/schemas/ProblemDetails' description: URL parameter missing '404': content: application/json: schema: - $ref: '#/components/schemas/PolicyNotFoundError' - description: Data policy not found - '412': - content: - application/json: - schema: - $ref: '#/components/schemas/PreconditionFailedError' - description: Precondition failed + $ref: '#/components/schemas/ProblemDetails' + description: DataPolicy not found '500': content: application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error '503': content: application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' + $ref: '#/components/schemas/ProblemDetails' description: Request resource temporary unavailable summary: Delete a data policy tags: @@ -1382,32 +1296,31 @@ paths: '400': content: application/json: + examples: + param-missing: + description: Example response when a required parameter is missing. + summary: Required URL parameter missing + value: + errors: + - title: Required parameter missing + detail: Required URL parameter 'parameterName' is missing schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + $ref: '#/components/schemas/ProblemDetails' description: Bad request '404': content: application/json: + examples: + not-found: + description: Policy not found + summary: Not found + value: + errors: + - title: Resource not found + detail: Resource with id 'my-resource-id' not found schema: - $ref: '#/components/schemas/PolicyNotFoundError' + $ref: '#/components/schemas/ProblemDetails' description: Resource not found - '500': - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerError' - description: Internal server error - '503': - content: - application/json: - schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable summary: Get a data policy tags: - Data Hub - Data Policies @@ -1509,54 +1422,31 @@ paths: content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/RequestBodyMissingError' - - $ref: '#/components/schemas/UrlParameterMissingError' - - $ref: '#/components/schemas/DataPolicyCreationFailureError' - - $ref: '#/components/schemas/DataPolicyInvalidErrors' - - $ref: '#/components/schemas/DataPolicyUpdateFailureError' - - $ref: '#/components/schemas/PolicyIdMismatchError' - - $ref: '#/components/schemas/TopicFilterMismatchError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' - https://hivemq.com/edge/api/model/DataPolicyCreationFailureError: '#/components/schemas/DataPolicyCreationFailureError' - https://hivemq.com/edge/api/model/DataPolicyInvalidErrors: '#/components/schemas/DataPolicyInvalidErrors' - https://hivemq.com/edge/api/model/DataPolicyUpdateFailureError: '#/components/schemas/DataPolicyUpdateFailureError' - https://hivemq.com/edge/api/model/PolicyIdMismatchError: '#/components/schemas/PolicyIdMismatchError' - https://hivemq.com/edge/api/model/TopicFilterMismatchError: '#/components/schemas/TopicFilterMismatchError' - description: Data policy creation failed + $ref: '#/components/schemas/ProblemDetails' + description: DataPolicy creation failed '404': content: application/json: schema: - $ref: '#/components/schemas/DataPolicyNotFoundError' - description: Data policy not found - '412': - content: - application/json: - schema: - $ref: '#/components/schemas/PreconditionFailedError' - description: Precondition failed + $ref: '#/components/schemas/ProblemDetails' + description: DataPolicy not found '500': content: application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error '503': content: application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' + $ref: '#/components/schemas/ProblemDetails' description: Request resource temporary unavailable '507': content: application/json: schema: - $ref: '#/components/schemas/PolicyInsufficientStorageError' + $ref: '#/components/schemas/ProblemDetails' description: Insufficient storage summary: Update an existing data policy tags: @@ -1644,14 +1534,13 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/Errors' description: Internal server error summary: Get all FSMs as a JSON Schema tags: - Data Hub - FSM /api/v1/data-hub/functions: get: - deprecated: true description: This endpoints provides the means to get information on the available Functions for the HiveMQ Data Hub. The information is provided in form of a Json Schema. operationId: getFunctions responses: @@ -1806,31 +1695,11 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error summary: Get all functions as a JSON Schema tags: - Data Hub - Functions - /api/v1/data-hub/function-specs: - get: - description: This endpoints provides the means to get information on the available Functions for the HiveMQ Data Hub. - operationId: getFunctionSpecs - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/FunctionSpecsList' - description: Success - '500': - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerError' - description: Internal server error - summary: Get all functions as a list of function specifications - tags: - - Data Hub - Functions /api/v1/data-hub/schemas: get: description: |- @@ -1961,22 +1830,11 @@ paths: schema: $ref: '#/components/schemas/SchemaList' description: Success - '400': - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/InvalidQueryParameterError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' - description: URL parameter missing '503': content: application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' + $ref: '#/components/schemas/ProblemDetails' description: Request resource temporary unavailable summary: Get all schemas tags: @@ -2025,46 +1883,31 @@ paths: content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/RequestBodyParameterMissingError' - - $ref: '#/components/schemas/SchemaInvalidErrors' - - $ref: '#/components/schemas/SchemaParsingFailureError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/RequestBodyParameterMissingError: '#/components/schemas/RequestBodyParameterMissingError' - https://hivemq.com/edge/api/model/SchemaInvalidErrors: '#/components/schemas/SchemaInvalidErrors' - https://hivemq.com/edge/api/model/SchemaParsingFailureError: '#/components/schemas/SchemaParsingFailureError' - description: Schema creation failed + $ref: '#/components/schemas/ProblemDetails' + description: Schema could not be validatetd '409': content: application/json: schema: - $ref: '#/components/schemas/SchemaAlreadyPresentError' - description: Schema is already present + $ref: '#/components/schemas/ProblemDetails' + description: Schema already exists '412': content: application/json: schema: - $ref: '#/components/schemas/SchemaEtagMismatchError' - description: Schema doesn't match etag + $ref: '#/components/schemas/ProblemDetails' + description: Mismatch between schema and etag '500': content: application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error - '503': - content: - application/json: - schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable '507': content: application/json: schema: - $ref: '#/components/schemas/SchemaInsufficientStorageError' + $ref: '#/components/schemas/ProblemDetails' description: Insufficient storage summary: Create a new schema tags: @@ -2097,38 +1940,31 @@ paths: content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - - $ref: '#/components/schemas/SchemaReferencedError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' - https://hivemq.com/edge/api/model/SchemaReferencedError: '#/components/schemas/SchemaReferencedError' - description: URL parameter missing + $ref: '#/components/schemas/ProblemDetails' + description: Schema referenced '404': content: application/json: schema: - $ref: '#/components/schemas/SchemaNotFoundError' + $ref: '#/components/schemas/ProblemDetails' description: Schema not found '412': content: application/json: schema: - $ref: '#/components/schemas/SchemaEtagMismatchError' - description: Schema doesn't match etag + $ref: '#/components/schemas/ProblemDetails' + description: Mismatch between schema and etag '500': content: application/json: schema: - $ref: '#/components/schemas/InternalServerError' - description: Internal Server error + $ref: '#/components/schemas/ProblemDetails' + description: Internal server error '503': content: application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' + $ref: '#/components/schemas/ProblemDetails' description: Request resource temporary unavailable summary: Delete all versions of the schema tags: @@ -2176,31 +2012,20 @@ paths: content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' - description: URL parameter missing + $ref: '#/components/schemas/ProblemDetails' + description: A url parameter is missing '404': content: application/json: schema: - $ref: '#/components/schemas/SchemaNotFoundError' + $ref: '#/components/schemas/ProblemDetails' description: Schema not found '500': content: application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error - '503': - content: - application/json: - schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable summary: Get a schema tags: - Data Hub - Schemas @@ -2321,23 +2146,12 @@ paths: schema: $ref: '#/components/schemas/ScriptList' description: Success - '400': - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/InvalidQueryParameterError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' - description: URL parameter missing '503': content: application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable + $ref: '#/components/schemas/ProblemDetails' + description: Temporary not available summary: Get all scripts tags: - Data Hub - Scripts @@ -2385,50 +2199,37 @@ paths: content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/RequestBodyParameterMissingError' - - $ref: '#/components/schemas/ScriptCreationFailureError' - - $ref: '#/components/schemas/ScriptInvalidErrors' - - $ref: '#/components/schemas/ScriptParsingFailureError' - - $ref: '#/components/schemas/ScriptSanitationFailureError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/RequestBodyParameterMissingError: '#/components/schemas/RequestBodyParameterMissingError' - https://hivemq.com/edge/api/model/ScriptCreationFailureError: '#/components/schemas/ScriptCreationFailureError' - https://hivemq.com/edge/api/model/ScriptInvalidErrors: '#/components/schemas/ScriptInvalidErrors' - https://hivemq.com/edge/api/model/ScriptParsingFailureError: '#/components/schemas/ScriptParsingFailureError' - https://hivemq.com/edge/api/model/ScriptSanitationFailureError: '#/components/schemas/ScriptSanitationFailureError' - description: Script creation failed + $ref: '#/components/schemas/ProblemDetails' + description: Script is invalid '409': content: application/json: schema: - $ref: '#/components/schemas/ScriptAlreadyPresentError' + $ref: '#/components/schemas/ProblemDetails' description: Script is already present '412': content: application/json: schema: - $ref: '#/components/schemas/ScriptEtagMismatchError' + $ref: '#/components/schemas/ProblemDetails' description: Script doesn't match etag '500': content: application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error '503': content: application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable + $ref: '#/components/schemas/ProblemDetails' + description: Temporary not available '507': content: application/json: schema: - $ref: '#/components/schemas/ScriptInsufficientStorageError' + $ref: '#/components/schemas/ProblemDetails' description: Insufficient storage summary: Create a new script tags: @@ -2458,39 +2259,32 @@ paths: content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - - $ref: '#/components/schemas/ScriptReferencedError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' - https://hivemq.com/edge/api/model/ScriptReferencedError: '#/components/schemas/ScriptReferencedError' - description: URL parameter missing + $ref: '#/components/schemas/ProblemDetails' + description: Script is referenced '404': content: application/json: schema: - $ref: '#/components/schemas/ScriptNotFoundError' + $ref: '#/components/schemas/ProblemDetails' description: Script not found '412': content: application/json: schema: - $ref: '#/components/schemas/ScriptEtagMismatchError' + $ref: '#/components/schemas/ProblemDetails' description: Script doesn't match etag '500': content: application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal Server error '503': content: application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable + $ref: '#/components/schemas/ProblemDetails' + description: Temporary not available summary: Delete a script tags: - Data Hub - Scripts @@ -2533,31 +2327,26 @@ paths: content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + $ref: '#/components/schemas/ProblemDetails' description: URL parameter missing '404': content: application/json: schema: - $ref: '#/components/schemas/ScriptNotFoundError' + $ref: '#/components/schemas/ProblemDetails' description: Script not found '500': content: application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal Server error '503': content: application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable + $ref: '#/components/schemas/ProblemDetails' + description: Temporary not available summary: Get a script tags: - Data Hub - Scripts @@ -4672,7 +4461,6 @@ components: detail: type: string errors: - deprecated: true type: array items: $ref: '#/components/schemas/Error' @@ -4837,1259 +4625,6 @@ components: description: List of result items that are returned by this endpoint items: $ref: '#/components/schemas/BehaviorPolicy' - ApiError: - allOf: - - $ref: '#/components/schemas/ProblemDetails' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/BehaviorPolicyAlreadyPresentError: '#/components/schemas/BehaviorPolicyAlreadyPresentError' - https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError: '#/components/schemas/BehaviorPolicyCreationFailureError' - https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors: '#/components/schemas/BehaviorPolicyInvalidErrors' - https://hivemq.com/edge/api/model/BehaviorPolicyNotFoundError: '#/components/schemas/BehaviorPolicyNotFoundError' - https://hivemq.com/edge/api/model/BehaviorPolicyRejectedError: '#/components/schemas/BehaviorPolicyRejectedError' - https://hivemq.com/edge/api/model/BehaviorPolicyUpdateFailureError: '#/components/schemas/BehaviorPolicyUpdateFailureError' - https://hivemq.com/edge/api/model/ClientDisconnectedError: '#/components/schemas/ClientDisconnectedError' - https://hivemq.com/edge/api/model/ClientNotFoundError: '#/components/schemas/ClientNotFoundError' - https://hivemq.com/edge/api/model/DataPolicyAlreadyPresentError: '#/components/schemas/DataPolicyAlreadyPresentError' - https://hivemq.com/edge/api/model/DataPolicyCreationFailureError: '#/components/schemas/DataPolicyCreationFailureError' - https://hivemq.com/edge/api/model/DataPolicyInvalidErrors: '#/components/schemas/DataPolicyInvalidErrors' - https://hivemq.com/edge/api/model/DataPolicyNotFoundError: '#/components/schemas/DataPolicyNotFoundError' - https://hivemq.com/edge/api/model/DataPolicyRejectedError: '#/components/schemas/DataPolicyRejectedError' - https://hivemq.com/edge/api/model/DataPolicyUpdateFailureError: '#/components/schemas/DataPolicyUpdateFailureError' - https://hivemq.com/edge/api/model/PolicyIdMismatchError: '#/components/schemas/PolicyIdMismatchError' - https://hivemq.com/edge/api/model/PolicyInsufficientStorageError: '#/components/schemas/PolicyInsufficientStorageError' - https://hivemq.com/edge/api/model/PolicyNotFoundError: '#/components/schemas/PolicyNotFoundError' - https://hivemq.com/edge/api/model/SchemaAlreadyPresentError: '#/components/schemas/SchemaAlreadyPresentError' - https://hivemq.com/edge/api/model/SchemaEtagMismatchError: '#/components/schemas/SchemaEtagMismatchError' - https://hivemq.com/edge/api/model/SchemaInsufficientStorageError: '#/components/schemas/SchemaInsufficientStorageError' - https://hivemq.com/edge/api/model/SchemaInvalidErrors: '#/components/schemas/SchemaInvalidErrors' - https://hivemq.com/edge/api/model/SchemaNotFoundError: '#/components/schemas/SchemaNotFoundError' - https://hivemq.com/edge/api/model/SchemaParsingFailureError: '#/components/schemas/SchemaParsingFailureError' - https://hivemq.com/edge/api/model/SchemaReferencedError: '#/components/schemas/SchemaReferencedError' - https://hivemq.com/edge/api/model/ScriptAlreadyPresentError: '#/components/schemas/ScriptAlreadyPresentError' - https://hivemq.com/edge/api/model/ScriptCreationFailureError: '#/components/schemas/ScriptCreationFailureError' - https://hivemq.com/edge/api/model/ScriptEtagMismatchError: '#/components/schemas/ScriptEtagMismatchError' - https://hivemq.com/edge/api/model/ScriptInsufficientStorageError: '#/components/schemas/ScriptInsufficientStorageError' - https://hivemq.com/edge/api/model/ScriptInvalidErrors: '#/components/schemas/ScriptInvalidErrors' - https://hivemq.com/edge/api/model/ScriptNotFoundError: '#/components/schemas/ScriptNotFoundError' - https://hivemq.com/edge/api/model/ScriptParsingFailureError: '#/components/schemas/ScriptParsingFailureError' - https://hivemq.com/edge/api/model/ScriptReferencedError: '#/components/schemas/ScriptReferencedError' - https://hivemq.com/edge/api/model/ScriptSanitationFailureError: '#/components/schemas/ScriptSanitationFailureError' - https://hivemq.com/edge/api/model/TopicFilterMismatchError: '#/components/schemas/TopicFilterMismatchError' - https://hivemq.com/edge/api/model/InsufficientStorageError: '#/components/schemas/InsufficientStorageError' - https://hivemq.com/edge/api/model/InternalServerError: '#/components/schemas/InternalServerError' - https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' - https://hivemq.com/edge/api/model/PreconditionFailedError: '#/components/schemas/PreconditionFailedError' - https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' - https://hivemq.com/edge/api/model/RequestBodyParameterMissingError: '#/components/schemas/RequestBodyParameterMissingError' - https://hivemq.com/edge/api/model/TemporaryNotAvailableError: '#/components/schemas/TemporaryNotAvailableError' - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' - BehaviorPolicyAlreadyPresentError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The behavior policy id. - example: abc - required: - - id - example: - general: - status: 409 - title: Behavior Policy Already Present - detail: The given behavior policy 'abc' is already present. - id: abc - type: https://hivemq.com/edge/api/model/BehaviorPolicyAlreadyPresentError - BehaviorPolicyCreationFailureError: - allOf: - - $ref: '#/components/schemas/ApiError' - example: - general: - status: 400 - title: Behavior Policy Creation Failed - detail: 'Behavior policy creation failed: The policy was rejected.' - type: https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError - AtLeastOneFieldMissingValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - paths: - type: array - description: The missing json paths. - items: - type: string - format: json-path - description: The json path. - example: - - $.field1 - - $.field2 - required: - - paths - example: - general: - detail: 'At least one of the fields must be present: ''$.field1'', ''$.field2''.' - paths: - - $.field1 - - $.field2 - type: https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError - ValidationError: - type: object - properties: - detail: - type: string - description: Detailed contextual description of the validation error. - type: - type: string - format: uri - description: Type of the validation error. - required: - - detail - - type - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError: '#/components/schemas/AtLeastOneFieldMissingValidationError' - https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError: '#/components/schemas/AtMostOneFunctionValidationError' - https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' - https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError: '#/components/schemas/FunctionMustBePairedValidationError' - https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError: '#/components/schemas/IllegalEventTransitionValidationError' - https://hivemq.com/edge/api/model/IllegalFunctionValidationError: '#/components/schemas/IllegalFunctionValidationError' - https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' - https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' - https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError: '#/components/schemas/InvalidFunctionOrderValidationError' - https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' - https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError: '#/components/schemas/InvalidSchemaVersionValidationError' - https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' - https://hivemq.com/edge/api/model/UnknownVariableValidationError: '#/components/schemas/UnknownVariableValidationError' - https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' - AtMostOneFunctionValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - function: - type: string - description: The function. - example: function1 - occurrences: - type: integer - format: int32 - description: The occurrences of the function. - minimum: 0 - example: 3 - paths: - type: array - items: - type: string - format: json-path - description: The json paths where the function occurs. - example: - - $.path1 - - $.path2 - - $.path3 - required: - - function - - occurrences - - paths - example: - general: - detail: The pipeline must contain at most one 'function1' function, but 3 were found at ['$.path1', '$.path2', '$.path3']. - function: function1 - occurrences: 3 - paths: - - $.path1 - - $.path2 - - $.path3 - type: https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError - EmptyFieldValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - path: - type: string - format: json-path - description: The missing field. - example: $.field - required: - - path - example: - general: - detail: Required field '$.field' is empty. - path: $.field - type: https://hivemq.com/edge/api/model/EmptyFieldValidationError - FunctionMustBePairedValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - existingFunction: - type: string - description: The existing function. - example: function1 - missingFunction: - type: string - description: The missing function. - example: function2 - required: - - existingFunction - - missingFunction - example: - general: - detail: If 'function1' function is present in the pipeline, 'function2' function must be present as well. - existingFunction: function1 - missingFunction: function2 - type: https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError - IllegalEventTransitionValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - event: - type: string - description: The event name. - example: event1 - fromState: - type: string - description: The event from state. - example: state1 - id: - type: string - description: The event id. - example: abc - path: - type: string - description: The path. - example: $.event - toState: - type: string - description: The event to state. - example: state2 - required: - - event - - fromState - - id - - path - - toState - example: - general: - detail: The transition from state 'state1' to state 'state2' on event 'event1' in '$.event' is not defined for behavior 'abc'. - event: event1 - fromState: state1 - toState: state2 - id: abc - path: $.event - type: https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError - IllegalFunctionValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - event: - type: string - description: The event name. - example: event1 - id: - type: string - description: The function id. - example: abc - path: - type: string - format: json-path - description: The json path. - example: $.event - required: - - event - - id - - path - example: - general: - detail: The function 'abc' is not allowed for event 'event1' in '$.event'. - event: event1 - id: abc - path: $.event - type: https://hivemq.com/edge/api/model/IllegalFunctionValidationError - InvalidFieldLengthValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - actualLength: - type: integer - format: int32 - description: The actual length of the field value. - example: 10 - expectedMinimumLength: - type: integer - format: int32 - description: The minimum length expected for the field value. - minimum: 0 - example: 5 - expectedMaximumLength: - type: integer - format: int32 - description: The maximum length expected for the field value. - minimum: 0 - example: 20 - path: - type: string - format: json-path - description: The invalid json path. - example: $.field - value: - type: string - description: The invalid value. - example: function transform() { return 'Hello, World!'; } - required: - - actualLength - - expectedMinimumLength - - expectedMaximumLength - - path - - value - example: - general: - detail: The length of script field '$.transform' 48 must be between 0 and 20. - actualLength: 48 - minimumLength: 0 - maximumLength: 20 - path: $.transform - value: function transform() { return 'Hello, World!'; } - type: https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError - InvalidFieldValueValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - path: - type: string - format: json-path - description: The invalid json path. - example: $.action.pipeline[1].field - value: - type: string - description: The invalid value. - example: functionDoesNotExist - required: - - path - example: - general: - detail: Referenced function does not exist. - path: $.action.pipeline[1].field - value: functionDoesNotExist - type: https://hivemq.com/edge/api/model/InvalidFieldValueValidationError - InvalidFunctionOrderValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - function: - type: string - description: The function. - example: transform - path: - type: string - format: json-path - description: The json path. - example: $.path - previousFunction: - type: string - description: The previous function. - example: init - required: - - function - - path - - previousFunction - example: - general: - detail: The operation at '$.path' with the functionId 'transform' must be after a 'init' operation. - function: transform - path: $.path - previousFunction: init - type: https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError - InvalidIdentifierValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - path: - type: string - format: json-path - description: The invalid identifier path. - example: $.id - value: - type: string - description: The invalid identifier value. - example: invalidId - required: - - path - - value - example: - general: - detail: Identifier script 'id' must begin with a letter and may only consist of lowercase letters, uppercase letters, numbers, periods, hyphens, and underscores. - path: $.id - value: invalidId - type: https://hivemq.com/edge/api/model/InvalidIdentifierValidationError - InvalidSchemaVersionValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - id: - type: string - description: The schema id. - example: abc - version: - type: string - description: The schema version. - example: '2' - required: - - id - - version - example: - general: - detail: The referenced schema with id 'abc' and version '2' was not found. - id: abc - version: '2' - type: https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError - MissingFieldValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - path: - type: string - format: json-path - description: The missing path. - example: $.id - required: - - path - example: - general: - detail: Required field '$.id' is missing. - path: $.id - type: https://hivemq.com/edge/api/model/MissingFieldValidationError - UnknownVariableValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - path: - type: string - description: The json path of the field. - example: $.path - variables: - type: array - items: - type: string - description: The unknown variables. - example: - - a - - b - - c - required: - - path - - variables - example: - general: - detail: 'Field ''$.path'' contains unknown variables: [a, b, c].' - path: $.path - variables: - - a - - b - - c - type: https://hivemq.com/edge/api/model/UnknownVariableValidationError - UnsupportedFieldValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - actualValue: - type: string - description: The actual value. - expectedValue: - type: string - description: The expected value. - path: - type: string - format: json-path - description: The json path. - example: $.id - required: - - actualValue - - expectedValue - - path - example: - general: - detail: Unsupported type 'String' for field '$.id'. Expected type is 'Object'. - actualValue: String - expectedValue: Object - path: $.id - type: https://hivemq.com/edge/api/model/UnsupportedFieldValidationError - BehaviorPolicyValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - oneOf: - - $ref: '#/components/schemas/IllegalEventTransitionValidationError' - - $ref: '#/components/schemas/IllegalFunctionValidationError' - - $ref: '#/components/schemas/InvalidSchemaVersionValidationError' - - $ref: '#/components/schemas/AtLeastOneFieldMissingValidationError' - - $ref: '#/components/schemas/EmptyFieldValidationError' - - $ref: '#/components/schemas/InvalidFieldLengthValidationError' - - $ref: '#/components/schemas/InvalidFieldValueValidationError' - - $ref: '#/components/schemas/InvalidIdentifierValidationError' - - $ref: '#/components/schemas/MissingFieldValidationError' - - $ref: '#/components/schemas/UnsupportedFieldValidationError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError: '#/components/schemas/AtLeastOneFieldMissingValidationError' - https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' - https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError: '#/components/schemas/IllegalEventTransitionValidationError' - https://hivemq.com/edge/api/model/IllegalFunctionValidationError: '#/components/schemas/IllegalFunctionValidationError' - https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' - https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' - https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' - https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError: '#/components/schemas/InvalidSchemaVersionValidationError' - https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' - https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' - BehaviorPolicyInvalidErrors: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - childErrors: - type: array - description: List of child validation errors. - items: - $ref: '#/components/schemas/BehaviorPolicyValidationError' - required: - - childErrors - example: - general: - status: 400 - title: Behavior Policy Invalid - detail: Behavior policy is invalid due to validation errors. - type: https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors - childErrors: - - detail: The transition from state 'state1' to state 'state2' on event 'event1' in '$.path' is not defined for behavior 'id1'. - fromState: state1 - toState: state2 - path: $.path - id: id1 - type: https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError - BehaviorPolicyNotFoundError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The data policy id. - example: abc - required: - - id - example: - general: - status: 404 - title: Behavior Policy Not Found - detail: Behavior policy with ID 'abc' is not found. - id: abc - type: https://hivemq.com/edge/api/model/BehaviorPolicyNotFoundError - BehaviorPolicyRejectedError: - allOf: - - $ref: '#/components/schemas/ApiError' - example: - general: - status: 400 - title: Behavior Policy Rejected - detail: Behavior policy is rejected. - type: https://hivemq.com/edge/api/model/BehaviorPolicyRejectedError - BehaviorPolicyUpdateFailureError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The ID of the policy that failed to update. - example: abc - required: - - id - example: - general: - status: 400 - title: Behavior Policy Update Failed - detail: Behavior policy with ID 'abc' update failed. - id: abc - type: https://hivemq.com/edge/api/model/BehaviorPolicyUpdateFailureError - ClientDisconnectedError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The client id. - example: abc - required: - - id - example: - general: - status: 404 - title: Client Disconnected - detail: Client with ID 'abc' is disconnected. - id: abc - type: https://hivemq.com/edge/api/model/ClientDisconnectedError - ClientNotFoundError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The client id. - example: abc - required: - - id - example: - general: - status: 404 - title: Client Not Found - detail: Client with ID 'abc' is not found. - id: abc - type: https://hivemq.com/edge/api/model/ClientNotFoundError - DataPolicyAlreadyPresentError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The data policy id. - example: abc - required: - - id - example: - general: - status: 409 - title: Data Policy Already Present - detail: The given data policy 'abc' is already present. - id: abc - type: https://hivemq.com/edge/api/model/DataPolicyAlreadyPresentError - DataPolicyCreationFailureError: - allOf: - - $ref: '#/components/schemas/ApiError' - example: - general: - status: 400 - title: Data Policy Creation Failed - detail: 'Data policy creation failed: The policy was rejected.' - type: https://hivemq.com/edge/api/model/DataPolicyCreationFailureError - DataPolicyValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - oneOf: - - $ref: '#/components/schemas/AtMostOneFunctionValidationError' - - $ref: '#/components/schemas/FunctionMustBePairedValidationError' - - $ref: '#/components/schemas/InvalidFunctionOrderValidationError' - - $ref: '#/components/schemas/InvalidSchemaVersionValidationError' - - $ref: '#/components/schemas/UnknownVariableValidationError' - - $ref: '#/components/schemas/EmptyFieldValidationError' - - $ref: '#/components/schemas/InvalidFieldLengthValidationError' - - $ref: '#/components/schemas/InvalidFieldValueValidationError' - - $ref: '#/components/schemas/InvalidIdentifierValidationError' - - $ref: '#/components/schemas/MissingFieldValidationError' - - $ref: '#/components/schemas/UnsupportedFieldValidationError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError: '#/components/schemas/AtMostOneFunctionValidationError' - https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' - https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError: '#/components/schemas/FunctionMustBePairedValidationError' - https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' - https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' - https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError: '#/components/schemas/InvalidFunctionOrderValidationError' - https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' - https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError: '#/components/schemas/InvalidSchemaVersionValidationError' - https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' - https://hivemq.com/edge/api/model/UnknownVariableValidationError: '#/components/schemas/UnknownVariableValidationError' - https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' - DataPolicyInvalidErrors: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - childErrors: - type: array - description: List of child validation errors. - items: - $ref: '#/components/schemas/DataPolicyValidationError' - required: - - childErrors - example: - general: - status: 400 - title: Data Policy Invalid - detail: Data policy is invalid due to validation errors. - type: https://hivemq.com/edge/api/model/DataPolicyInvalidErrors - childErrors: - - detail: The pipeline must contain at most one 'function1' function, but 3 were found at ['$.path1', '$.path2', '$.path3']. - function: function1 - occurrences: 3 - paths: - - $.path1 - - $.path2 - - $.path3 - type: https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError - DataPolicyNotFoundError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The data policy id. - example: abc - required: - - id - example: - general: - status: 404 - title: Data Policy Not Found - detail: Data policy with ID 'abc' is not found. - id: abc - type: https://hivemq.com/edge/api/model/DataPolicyNotFoundError - DataPolicyRejectedError: - allOf: - - $ref: '#/components/schemas/ApiError' - example: - general: - status: 400 - title: Data Policy Rejected - detail: Data policy is rejected. - type: https://hivemq.com/edge/api/model/DataPolicyRejectedError - DataPolicyUpdateFailureError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The ID of the policy that failed to update. - example: abc - required: - - id - example: - general: - status: 400 - title: Data Policy Update Failed - detail: Data policy with ID 'abc' update failed. - id: abc - type: https://hivemq.com/edge/api/model/DataPolicyUpdateFailureError - PolicyIdMismatchError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - actualId: - type: string - description: The actual id. - example: id1 - expectedId: - type: string - description: The expected id. - example: id2 - required: - - actualId - - expectedId - example: - general: - status: 400 - title: Policy ID Mismatch - detail: The policy ID 'id1' in the request parameter does not match the policy ID 'id2' in the policy request body. - id: abc - type: https://hivemq.com/edge/api/model/PolicyIdMismatchError - PolicyInsufficientStorageError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The policy id. - example: abc - required: - - id - example: - general: - status: 507 - title: Policy Insufficient Storage - detail: Policy with ID '123' could not be added because of insufficient server storage. - id: abc - type: https://hivemq.com/edge/api/model/PolicyInsufficientStorageError - PolicyNotFoundError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The policy id. - example: abc - required: - - id - example: - general: - status: 404 - title: Policy Not Found - detail: Policy with ID 'abc' is not found. - id: abc - type: https://hivemq.com/edge/api/model/PolicyNotFoundError - SchemaAlreadyPresentError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The schema id. - example: abc - required: - - id - example: - general: - status: 409 - title: Schema Already Present - detail: The given schema is already present as the latest version for the schema id 'abc'. - id: abc - type: https://hivemq.com/edge/api/model/SchemaAlreadyPresentError - SchemaEtagMismatchError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The schema id. - example: abc - eTag: - type: string - description: The eTag. - example: 33a64df551425fcc55e4d42a148795d9f25f89d4 - required: - - id - example: - general: - status: 412 - title: Schema eTag Mismatch - detail: Schema with id 'abc' does not match the given etag '33a64df551425fcc55e4d42a148795d9f25f89d4'. - id: abc - eTag: 33a64df551425fcc55e4d42a148795d9f25f89d4 - type: https://hivemq.com/edge/api/model/SchemaEtagMismatchError - SchemaInsufficientStorageError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The policy id. - example: abc - required: - - id - example: - general: - status: 507 - title: Schema Insufficient Storage - detail: Schema with ID '123' could not be added because of insufficient server storage. - id: abc - type: https://hivemq.com/edge/api/model/SchemaInsufficientStorageError - SchemaValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - oneOf: - - $ref: '#/components/schemas/EmptyFieldValidationError' - - $ref: '#/components/schemas/InvalidFieldLengthValidationError' - - $ref: '#/components/schemas/InvalidFieldValueValidationError' - - $ref: '#/components/schemas/InvalidIdentifierValidationError' - - $ref: '#/components/schemas/MissingFieldValidationError' - - $ref: '#/components/schemas/UnsupportedFieldValidationError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' - https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' - https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' - https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' - https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' - https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' - SchemaInvalidErrors: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - childErrors: - type: array - description: List of child validation errors. - items: - $ref: '#/components/schemas/SchemaValidationError' - required: - - childErrors - example: - general: - status: 400 - title: Schema Invalid - detail: Schema is invalid due to validation errors. - type: https://hivemq.com/edge/api/model/SchemaInvalidErrors - childErrors: - - detail: The length of script field '$.id' 1025 must be between 0 and 1024. - paths: $.id - value: aaa...aaa - actualLength: 1025 - expectedMinimumLength: 0 - expectedMaximumLength: 1024 - type: https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError - SchemaNotFoundError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The schema ID. - example: abc - required: - - id - example: - general: - status: 404 - title: Schema Not Found - detail: Schema with ID 'abc' is not found. - id: abc - type: https://hivemq.com/edge/api/model/SchemaNotFoundError - SchemaParsingFailureError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - alias: - type: string - description: The schema alias. - example: abc - required: - - alias - example: - general: - status: 400 - title: Schema Parsing Failure - detail: The given schema 'abc' could not be parsed. - alias: abc - type: https://hivemq.com/edge/api/model/SchemaParsingFailureError - SchemaReferencedError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The schema ID. - example: abc - required: - - id - example: - general: - status: 400 - title: Schema Referenced - detail: Schema with ID 'abc' is referenced. - id: abc - type: https://hivemq.com/edge/api/model/SchemaReferencedError - ScriptAlreadyPresentError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The script id. - example: abc - required: - - id - example: - general: - status: 409 - title: Script Already Present - detail: The given script 'abc' is already present. - id: abc - type: https://hivemq.com/edge/api/model/ScriptAlreadyPresentError - ScriptCreationFailureError: - allOf: - - $ref: '#/components/schemas/ApiError' - example: - general: - status: 400 - title: Script Creation Failure - detail: The given script could not be created. - type: https://hivemq.com/edge/api/model/ScriptCreationFailureError - ScriptEtagMismatchError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The script id. - example: abc - eTag: - type: string - description: The eTag. - example: 33a64df551425fcc55e4d42a148795d9f25f89d4 - required: - - id - example: - general: - status: 412 - title: Script eTag Mismatch - detail: Script with id 'abc' does not match the given etag '33a64df551425fcc55e4d42a148795d9f25f89d4'. - id: abc - eTag: 33a64df551425fcc55e4d42a148795d9f25f89d4 - type: https://hivemq.com/edge/api/model/ScriptEtagMismatchError - ScriptInsufficientStorageError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The policy id. - example: abc - required: - - id - example: - general: - status: 507 - title: Script Insufficient Storage - detail: Script with ID '123' could not be added because of insufficient server storage. - id: abc - type: https://hivemq.com/edge/api/model/ScriptInsufficientStorageError - ScriptValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - oneOf: - - $ref: '#/components/schemas/InvalidFieldLengthValidationError' - - $ref: '#/components/schemas/InvalidFieldValueValidationError' - - $ref: '#/components/schemas/InvalidIdentifierValidationError' - - $ref: '#/components/schemas/MissingFieldValidationError' - - $ref: '#/components/schemas/UnsupportedFieldValidationError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' - https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' - https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' - https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' - https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' - ScriptInvalidErrors: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - childErrors: - type: array - description: List of child validation errors. - items: - $ref: '#/components/schemas/ScriptValidationError' - required: - - childErrors - example: - general: - status: 400 - title: Script Invalid - detail: Script is invalid due to validation errors. - type: https://hivemq.com/edge/api/model/ScriptInvalidErrors - childErrors: - - detail: The length of script field '$.id' 1025 must be between 0 and 1024. - paths: $.id - value: aaa...aaa - actualLength: 1025 - expectedMinimumLength: 0 - expectedMaximumLength: 1024 - type: https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError - ScriptNotFoundError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The script ID. - example: abc - required: - - id - example: - general: - status: 404 - title: Script Not Found - detail: Script with ID 'abc' is not found. - id: abc - type: https://hivemq.com/edge/api/model/ScriptNotFoundError - ScriptParsingFailureError: - allOf: - - $ref: '#/components/schemas/ApiError' - example: - general: - status: 400 - title: Script Parsing Failure - detail: The given script 'abc' could not be parsed. - type: https://hivemq.com/edge/api/model/ScriptParsingFailureError - ScriptReferencedError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - id: - type: string - description: The script ID. - example: abc - required: - - id - example: - general: - status: 400 - title: Script Referenced - detail: Script with ID 'abc' is referenced. - id: abc - type: https://hivemq.com/edge/api/model/ScriptReferencedError - ScriptSanitationFailureError: - allOf: - - $ref: '#/components/schemas/ApiError' - example: - general: - status: 400 - title: Script Sanitation Failure - detail: The given script could not be sanitized. - type: https://hivemq.com/edge/api/model/ScriptSanitationFailureError - TopicFilterMismatchError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - path: - type: string - description: The json path of the topic filter. - example: $.filter - required: - - path - example: - general: - status: 400 - title: Topic Filter Mismatch - detail: The topic filter '$.filter' mismatches. - type: https://hivemq.com/edge/api/model/TopicFilterMismatchError - InsufficientStorageError: - allOf: - - $ref: '#/components/schemas/ApiError' - example: - general: - status: 507 - title: Insufficient Storage - detail: Insufficient Storage. - type: https://hivemq.com/edge/api/model/InsufficientStorageError - InternalServerError: - allOf: - - $ref: '#/components/schemas/ApiError' - example: - general: - status: 500 - title: Internal Server Error - detail: An unexpected error occurred, check the logs. - type: https://hivemq.com/edge/api/model/InternalServerError - creation: - status: 500 - title: Internal Server Error - detail: 'An unexpected error occurred: Exception during creation of the Json Schema for functions.' - type: https://hivemq.com/edge/api/model/InternalServerError - InvalidQueryParameterError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - parameter: - type: string - description: The query parameter. - required: - - parameter - example: - general: - status: 400 - title: Query Parameter is Invalid - detail: 'Query parameter ''a'' is invalid: ''a'' could not be parsed.' - parameter: a - type: https://hivemq.com/edge/api/model/InvalidQueryParameterError - PreconditionFailedError: - allOf: - - $ref: '#/components/schemas/ApiError' - example: - general: - status: 412 - title: Precondition Failed - detail: 'A precondition required for fulfilling the request was not fulfilled: Policy does not match the given etag ''abc''.' - type: https://hivemq.com/edge/api/model/PreconditionFailedError - RequestBodyMissingError: - allOf: - - $ref: '#/components/schemas/ApiError' - example: - general: - status: 400 - title: Required Request Body Missing - detail: Required request body is missing. - type: https://hivemq.com/edge/api/model/RequestBodyMissingError - RequestBodyParameterMissingError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - parameter: - type: string - description: The the missing request body parameter. - required: - - parameter - example: - general: - status: 400 - title: Required Request Body Parameter Missing - detail: Required request body parameter 'a' is missing. - parameter: a - type: https://hivemq.com/edge/api/model/RequestBodyParameterMissingError - TemporaryNotAvailableError: - allOf: - - $ref: '#/components/schemas/ApiError' - example: - general: - status: 503 - title: Endpoint Temporarily not Available - detail: The endpoint is temporarily not available, please try again later. - type: https://hivemq.com/edge/api/model/TemporaryNotAvailableError - UrlParameterMissingError: - allOf: - - $ref: '#/components/schemas/ApiError' - - type: object - properties: - parameter: - type: string - description: The name of the missing parameter. - required: - - parameter - example: - general: - status: 400 - title: Required URL Parameter Missing - detail: Required URL parameter 'a' is missing. - parameter: a - type: https://hivemq.com/edge/api/model/UrlParameterMissingError JsonNode: type: object description: The arguments of the fsm derived from the behavior policy. @@ -6211,67 +4746,8 @@ components: description: List of result items that are returned by this endpoint items: $ref: '#/components/schemas/DataPolicy' - BehaviorPolicyTransitionEvent: - type: string - description: Accepted event in transition - enum: - - Event.OnAny - - Connection.OnDisconnect - - Mqtt.OnInboundConnect - - Mqtt.OnInboundDisconnect - - Mqtt.OnInboundPublish - - Mqtt.OnInboundSubscribe - FunctionMetadata: - description: Metadata for operation functions + Errors: type: object - properties: - isTerminal: - type: boolean - description: The function is a terminal element of a pipeline - isDataOnly: - type: boolean - description: The function is only available for Data Policies - hasArguments: - type: boolean - description: The function has extra arguments - inLicenseAllowed: - type: boolean - description: The function can be used with the current user's license - supportedEvents: - type: array - items: - $ref: '#/components/schemas/BehaviorPolicyTransitionEvent' - FunctionSpecs: - description: The configuration of a DataHub operation function - type: object - properties: - functionId: - type: string - description: The unique name of the function - metadata: - $ref: '#/components/schemas/FunctionMetadata' - description: The metadata associated with the function - schema: - $ref: '#/components/schemas/JsonNode' - description: the full JSON-Schema describimng the function and its arguments - uiSchema: - $ref: '#/components/schemas/JsonNode' - description: An optional UI Schema to customise the rendering of the configuraton form - required: - - functionId - - metadata - - schema - FunctionSpecsList: - type: object - description: List of function configurations - properties: - items: - type: array - description: List of function configurations - items: - $ref: '#/components/schemas/FunctionSpecs' - required: - - items PolicySchema: type: object properties: From fb52bf89423918c0ec7b7fad339a76da3aed99a8 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Tue, 9 Sep 2025 08:51:03 +0200 Subject: [PATCH 114/121] feat: Update openapi spec --- ext/hivemq-edge-openapi-2025.15.yaml | 1927 +++++++++++++++++++--- hivemq-edge-openapi/openapi/openapi.yaml | 2 +- 2 files changed, 1688 insertions(+), 241 deletions(-) diff --git a/ext/hivemq-edge-openapi-2025.15.yaml b/ext/hivemq-edge-openapi-2025.15.yaml index bb996cf852..16b9ba5dfb 100644 --- a/ext/hivemq-edge-openapi-2025.15.yaml +++ b/ext/hivemq-edge-openapi-2025.15.yaml @@ -14,7 +14,7 @@ info: ## OpenAPI HiveMQ's REST API provides an OpenAPI 3.0 schema definition that can imported into popular API tooling (e.g. Postman) or can be used to generate client-code for multiple programming languages. title: HiveMQ Edge REST API - version: 2025.14-SNAPSHOT + version: 2025.15-SNAPSHOT x-logo: url: https://www.hivemq.com/img/svg/hivemq-bee.svg tags: @@ -357,12 +357,23 @@ paths: schema: $ref: '#/components/schemas/BehaviorPolicyList' description: Success + '400': + content: + application/problem+json: + schema: + oneOf: + - $ref: '#/components/schemas/InvalidQueryParameterError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' + description: URL parameter missing '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporarily not available + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Get all policies tags: - Data Hub - Behavior Policies @@ -447,34 +458,45 @@ paths: description: Success '400': content: - application/json: - schema: - $ref: '#/components/schemas/ProblemDetails' + application/problem+json: + schema: + oneOf: + - $ref: '#/components/schemas/BehaviorPolicyCreationFailureError' + - $ref: '#/components/schemas/BehaviorPolicyInvalidErrors' + - $ref: '#/components/schemas/BehaviorPolicyRejectedError' + - $ref: '#/components/schemas/RequestBodyMissingError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError: '#/components/schemas/BehaviorPolicyCreationFailureError' + https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors: '#/components/schemas/BehaviorPolicyInvalidErrors' + https://hivemq.com/edge/api/model/BehaviorPolicyRejectedError: '#/components/schemas/BehaviorPolicyRejectedError' + https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' description: Policy creation failed '409': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Already exists + $ref: '#/components/schemas/BehaviorPolicyAlreadyPresentError' + description: Behavior policy already present '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Internal error + $ref: '#/components/schemas/InternalServerError' + description: Internal server error '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporarily unavailable + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable '507': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Insufficient storage error + $ref: '#/components/schemas/PolicyInsufficientStorageError' + description: Insufficient storage summary: Create a new policy tags: - Data Hub - Behavior Policies @@ -504,34 +526,39 @@ paths: description: Success, no response body '400': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Policy not found + $ref: '#/components/schemas/PolicyNotFoundError' + description: Behavior policy not found '412': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/PreconditionFailedError' description: Precondition failed '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Internal error + $ref: '#/components/schemas/InternalServerError' + description: Internal server error '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporarily not available + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Delete a behavior policy tags: - Data Hub - Behavior Policies @@ -599,16 +626,33 @@ paths: description: Success '400': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Invalid query parameter + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + description: Bad request '404': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/BehaviorPolicyNotFoundError' description: Policy not found + '500': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/InternalServerError' + description: Internal server error + '503': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Get a policy tags: - Data Hub - Behavior Policies @@ -709,41 +753,56 @@ paths: description: Success '400': content: - application/json: - schema: - $ref: '#/components/schemas/ProblemDetails' - description: Policy creation failed + application/problem+json: + schema: + oneOf: + - $ref: '#/components/schemas/RequestBodyMissingError' + - $ref: '#/components/schemas/UrlParameterMissingError' + - $ref: '#/components/schemas/BehaviorPolicyCreationFailureError' + - $ref: '#/components/schemas/BehaviorPolicyInvalidErrors' + - $ref: '#/components/schemas/BehaviorPolicyUpdateFailureError' + - $ref: '#/components/schemas/PolicyIdMismatchError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError: '#/components/schemas/BehaviorPolicyCreationFailureError' + https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors: '#/components/schemas/BehaviorPolicyInvalidErrors' + https://hivemq.com/edge/api/model/BehaviorPolicyUpdateFailureError: '#/components/schemas/BehaviorPolicyUpdateFailureError' + https://hivemq.com/edge/api/model/PolicyIdMismatchError: '#/components/schemas/PolicyIdMismatchError' + description: Behavior policy creation failed '404': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Policy not found + $ref: '#/components/schemas/BehaviorPolicyNotFoundError' + description: Data policy not found '412': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/PreconditionFailedError' description: Precondition failed '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Internal error + $ref: '#/components/schemas/InternalServerError' + description: Internal server error '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporarily unavailable + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable '507': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Insufficient storage error - summary: Update an existing policy + $ref: '#/components/schemas/PolicyInsufficientStorageError' + description: Insufficient storage + summary: Update an existing behavior policy tags: - Data Hub - Behavior Policies /api/v1/data-hub/behavior-validation/states/{clientId}: @@ -787,22 +846,34 @@ paths: description: Success '400': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' description: URL parameter missing '404': content: - application/json: - schema: - $ref: '#/components/schemas/ProblemDetails' - description: Client is disconnected + application/problem+json: + schema: + oneOf: + - $ref: '#/components/schemas/ClientDisconnectedError' + - $ref: '#/components/schemas/ClientNotFoundError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/ClientDisconnectedError: '#/components/schemas/ClientDisconnectedError' + https://hivemq.com/edge/api/model/ClientNotFoundError: '#/components/schemas/ClientNotFoundError' + description: Client error '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Internal Server error + $ref: '#/components/schemas/InternalServerError' + description: Internal server error summary: Get the state of a client tags: - Data Hub - State @@ -1051,27 +1122,20 @@ paths: description: Success '400': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + oneOf: + - $ref: '#/components/schemas/InvalidQueryParameterError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' description: URL parameter missing - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/ProblemDetails' - description: DataPolicy not found - '500': - content: - application/json: - schema: - $ref: '#/components/schemas/ProblemDetails' - description: Internal server error '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable summary: Get all data policies tags: @@ -1155,33 +1219,44 @@ paths: description: Success '400': content: - application/json: - schema: - $ref: '#/components/schemas/ProblemDetails' - description: DataPolicy creation failed + application/problem+json: + schema: + oneOf: + - $ref: '#/components/schemas/RequestBodyMissingError' + - $ref: '#/components/schemas/DataPolicyCreationFailureError' + - $ref: '#/components/schemas/DataPolicyInvalidErrors' + - $ref: '#/components/schemas/DataPolicyRejectedError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' + https://hivemq.com/edge/api/model/DataPolicyCreationFailureError: '#/components/schemas/DataPolicyCreationFailureError' + https://hivemq.com/edge/api/model/DataPolicyInvalidErrors: '#/components/schemas/DataPolicyInvalidErrors' + https://hivemq.com/edge/api/model/DataPolicyRejectedError: '#/components/schemas/DataPolicyRejectedError' + description: Data policy creation failed '409': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: DataPolicy already present + $ref: '#/components/schemas/DataPolicyAlreadyPresentError' + description: Data policy already present '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable '507': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/PolicyInsufficientStorageError' description: Insufficient storage summary: Create a new data policy tags: @@ -1212,27 +1287,38 @@ paths: description: Success, no response body '400': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: DataPolicy not found + $ref: '#/components/schemas/PolicyNotFoundError' + description: Data policy not found + '412': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/PreconditionFailedError' + description: Precondition failed '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable summary: Delete a data policy tags: @@ -1300,32 +1386,33 @@ paths: description: Success '400': content: - application/json: - examples: - param-missing: - description: Example response when a required parameter is missing. - summary: Required URL parameter missing - value: - errors: - - title: Required parameter missing - detail: Required URL parameter 'parameterName' is missing + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' description: Bad request '404': content: - application/json: - examples: - not-found: - description: Policy not found - summary: Not found - value: - errors: - - title: Resource not found - detail: Resource with id 'my-resource-id' not found + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/PolicyNotFoundError' description: Resource not found + '500': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/InternalServerError' + description: Internal server error + '503': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Get a data policy tags: - Data Hub - Data Policies @@ -1425,33 +1512,56 @@ paths: description: Success '400': content: - application/json: - schema: - $ref: '#/components/schemas/ProblemDetails' - description: DataPolicy creation failed + application/problem+json: + schema: + oneOf: + - $ref: '#/components/schemas/RequestBodyMissingError' + - $ref: '#/components/schemas/UrlParameterMissingError' + - $ref: '#/components/schemas/DataPolicyCreationFailureError' + - $ref: '#/components/schemas/DataPolicyInvalidErrors' + - $ref: '#/components/schemas/DataPolicyUpdateFailureError' + - $ref: '#/components/schemas/PolicyIdMismatchError' + - $ref: '#/components/schemas/TopicFilterMismatchError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + https://hivemq.com/edge/api/model/DataPolicyCreationFailureError: '#/components/schemas/DataPolicyCreationFailureError' + https://hivemq.com/edge/api/model/DataPolicyInvalidErrors: '#/components/schemas/DataPolicyInvalidErrors' + https://hivemq.com/edge/api/model/DataPolicyUpdateFailureError: '#/components/schemas/DataPolicyUpdateFailureError' + https://hivemq.com/edge/api/model/PolicyIdMismatchError: '#/components/schemas/PolicyIdMismatchError' + https://hivemq.com/edge/api/model/TopicFilterMismatchError: '#/components/schemas/TopicFilterMismatchError' + description: Data policy creation failed '404': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: DataPolicy not found + $ref: '#/components/schemas/DataPolicyNotFoundError' + description: Data policy not found + '412': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/PreconditionFailedError' + description: Precondition failed '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable '507': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/PolicyInsufficientStorageError' description: Insufficient storage summary: Update an existing data policy tags: @@ -1537,9 +1647,9 @@ paths: description: Success '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/Errors' + $ref: '#/components/schemas/InternalServerError' description: Internal server error summary: Get all FSMs as a JSON Schema tags: @@ -1699,9 +1809,9 @@ paths: description: Success '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error summary: Get all functions as a JSON Schema tags: @@ -1719,9 +1829,9 @@ paths: description: Success '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error summary: Get all interpolation variables tags: @@ -1739,9 +1849,9 @@ paths: description: Success '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error summary: Get all functions as a list of function specifications tags: @@ -1876,11 +1986,22 @@ paths: schema: $ref: '#/components/schemas/SchemaList' description: Success + '400': + content: + application/problem+json: + schema: + oneOf: + - $ref: '#/components/schemas/InvalidQueryParameterError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' + description: URL parameter missing '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable summary: Get all schemas tags: @@ -1927,33 +2048,48 @@ paths: description: Success '400': content: - application/json: - schema: - $ref: '#/components/schemas/ProblemDetails' - description: Schema could not be validatetd + application/problem+json: + schema: + oneOf: + - $ref: '#/components/schemas/RequestBodyParameterMissingError' + - $ref: '#/components/schemas/SchemaInvalidErrors' + - $ref: '#/components/schemas/SchemaParsingFailureError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/RequestBodyParameterMissingError: '#/components/schemas/RequestBodyParameterMissingError' + https://hivemq.com/edge/api/model/SchemaInvalidErrors: '#/components/schemas/SchemaInvalidErrors' + https://hivemq.com/edge/api/model/SchemaParsingFailureError: '#/components/schemas/SchemaParsingFailureError' + description: Schema creation failed '409': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Schema already exists + $ref: '#/components/schemas/SchemaAlreadyPresentError' + description: Schema is already present '412': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Mismatch between schema and etag + $ref: '#/components/schemas/SchemaEtagMismatchError' + description: Schema doesn't match etag '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error + '503': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable '507': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/SchemaInsufficientStorageError' description: Insufficient storage summary: Create a new schema tags: @@ -1984,33 +2120,40 @@ paths: description: Success, no response body '400': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Schema referenced + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + - $ref: '#/components/schemas/SchemaReferencedError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + https://hivemq.com/edge/api/model/SchemaReferencedError: '#/components/schemas/SchemaReferencedError' + description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/SchemaNotFoundError' description: Schema not found '412': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Mismatch between schema and etag + $ref: '#/components/schemas/SchemaEtagMismatchError' + description: Schema doesn't match etag '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Internal server error + $ref: '#/components/schemas/InternalServerError' + description: Internal Server error '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable summary: Delete all versions of the schema tags: @@ -2056,22 +2199,33 @@ paths: description: Success '400': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: A url parameter is missing + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/SchemaNotFoundError' description: Schema not found '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error + '503': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Get a schema tags: - Data Hub - Schemas @@ -2192,12 +2346,23 @@ paths: schema: $ref: '#/components/schemas/ScriptList' description: Success + '400': + content: + application/problem+json: + schema: + oneOf: + - $ref: '#/components/schemas/InvalidQueryParameterError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' + description: URL parameter missing '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporary not available + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Get all scripts tags: - Data Hub - Scripts @@ -2243,39 +2408,52 @@ paths: description: Success '400': content: - application/json: - schema: - $ref: '#/components/schemas/ProblemDetails' - description: Script is invalid + application/problem+json: + schema: + oneOf: + - $ref: '#/components/schemas/RequestBodyParameterMissingError' + - $ref: '#/components/schemas/ScriptCreationFailureError' + - $ref: '#/components/schemas/ScriptInvalidErrors' + - $ref: '#/components/schemas/ScriptParsingFailureError' + - $ref: '#/components/schemas/ScriptSanitationFailureError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/RequestBodyParameterMissingError: '#/components/schemas/RequestBodyParameterMissingError' + https://hivemq.com/edge/api/model/ScriptCreationFailureError: '#/components/schemas/ScriptCreationFailureError' + https://hivemq.com/edge/api/model/ScriptInvalidErrors: '#/components/schemas/ScriptInvalidErrors' + https://hivemq.com/edge/api/model/ScriptParsingFailureError: '#/components/schemas/ScriptParsingFailureError' + https://hivemq.com/edge/api/model/ScriptSanitationFailureError: '#/components/schemas/ScriptSanitationFailureError' + description: Script creation failed '409': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/ScriptAlreadyPresentError' description: Script is already present '412': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/ScriptEtagMismatchError' description: Script doesn't match etag '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporary not available + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable '507': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/ScriptInsufficientStorageError' description: Insufficient storage summary: Create a new script tags: @@ -2303,34 +2481,41 @@ paths: description: Success, no response body '400': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Script is referenced + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + - $ref: '#/components/schemas/ScriptReferencedError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + https://hivemq.com/edge/api/model/ScriptReferencedError: '#/components/schemas/ScriptReferencedError' + description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/ScriptNotFoundError' description: Script not found '412': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/ScriptEtagMismatchError' description: Script doesn't match etag '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal Server error '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporary not available + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Delete a script tags: - Data Hub - Scripts @@ -2371,28 +2556,33 @@ paths: description: Success '400': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/ScriptNotFoundError' description: Script not found '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal Server error '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporary not available + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Get a script tags: - Data Hub - Scripts @@ -4916,6 +5106,7 @@ components: detail: type: string errors: + deprecated: true type: array items: $ref: '#/components/schemas/Error' @@ -5080,25 +5271,1283 @@ components: description: List of result items that are returned by this endpoint items: $ref: '#/components/schemas/BehaviorPolicy' - JsonNode: - type: object - description: The arguments of the fsm derived from the behavior policy. - FsmStateInformationItem: - type: object - description: List of result items that are returned by this endpoint - properties: - arguments: - $ref: '#/components/schemas/JsonNode' - behaviorId: - type: string - description: The unique identifier of the policy. - firstSetAt: - type: string - description: The timestamp when this state was set the first time. - policyId: - type: string - description: The unique identifier of the policy. - stateName: + ApiProblemDetails: + allOf: + - $ref: '#/components/schemas/ProblemDetails' + - type: object + required: + - detail + - status + - type + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/BehaviorPolicyAlreadyPresentError: '#/components/schemas/BehaviorPolicyAlreadyPresentError' + https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError: '#/components/schemas/BehaviorPolicyCreationFailureError' + https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors: '#/components/schemas/BehaviorPolicyInvalidErrors' + https://hivemq.com/edge/api/model/BehaviorPolicyNotFoundError: '#/components/schemas/BehaviorPolicyNotFoundError' + https://hivemq.com/edge/api/model/BehaviorPolicyRejectedError: '#/components/schemas/BehaviorPolicyRejectedError' + https://hivemq.com/edge/api/model/BehaviorPolicyUpdateFailureError: '#/components/schemas/BehaviorPolicyUpdateFailureError' + https://hivemq.com/edge/api/model/ClientDisconnectedError: '#/components/schemas/ClientDisconnectedError' + https://hivemq.com/edge/api/model/ClientNotFoundError: '#/components/schemas/ClientNotFoundError' + https://hivemq.com/edge/api/model/DataPolicyAlreadyPresentError: '#/components/schemas/DataPolicyAlreadyPresentError' + https://hivemq.com/edge/api/model/DataPolicyCreationFailureError: '#/components/schemas/DataPolicyCreationFailureError' + https://hivemq.com/edge/api/model/DataPolicyInvalidErrors: '#/components/schemas/DataPolicyInvalidErrors' + https://hivemq.com/edge/api/model/DataPolicyNotFoundError: '#/components/schemas/DataPolicyNotFoundError' + https://hivemq.com/edge/api/model/DataPolicyRejectedError: '#/components/schemas/DataPolicyRejectedError' + https://hivemq.com/edge/api/model/DataPolicyUpdateFailureError: '#/components/schemas/DataPolicyUpdateFailureError' + https://hivemq.com/edge/api/model/PolicyIdMismatchError: '#/components/schemas/PolicyIdMismatchError' + https://hivemq.com/edge/api/model/PolicyInsufficientStorageError: '#/components/schemas/PolicyInsufficientStorageError' + https://hivemq.com/edge/api/model/PolicyNotFoundError: '#/components/schemas/PolicyNotFoundError' + https://hivemq.com/edge/api/model/SchemaAlreadyPresentError: '#/components/schemas/SchemaAlreadyPresentError' + https://hivemq.com/edge/api/model/SchemaEtagMismatchError: '#/components/schemas/SchemaEtagMismatchError' + https://hivemq.com/edge/api/model/SchemaInsufficientStorageError: '#/components/schemas/SchemaInsufficientStorageError' + https://hivemq.com/edge/api/model/SchemaInvalidErrors: '#/components/schemas/SchemaInvalidErrors' + https://hivemq.com/edge/api/model/SchemaNotFoundError: '#/components/schemas/SchemaNotFoundError' + https://hivemq.com/edge/api/model/SchemaParsingFailureError: '#/components/schemas/SchemaParsingFailureError' + https://hivemq.com/edge/api/model/SchemaReferencedError: '#/components/schemas/SchemaReferencedError' + https://hivemq.com/edge/api/model/ScriptAlreadyPresentError: '#/components/schemas/ScriptAlreadyPresentError' + https://hivemq.com/edge/api/model/ScriptCreationFailureError: '#/components/schemas/ScriptCreationFailureError' + https://hivemq.com/edge/api/model/ScriptEtagMismatchError: '#/components/schemas/ScriptEtagMismatchError' + https://hivemq.com/edge/api/model/ScriptInsufficientStorageError: '#/components/schemas/ScriptInsufficientStorageError' + https://hivemq.com/edge/api/model/ScriptInvalidErrors: '#/components/schemas/ScriptInvalidErrors' + https://hivemq.com/edge/api/model/ScriptNotFoundError: '#/components/schemas/ScriptNotFoundError' + https://hivemq.com/edge/api/model/ScriptParsingFailureError: '#/components/schemas/ScriptParsingFailureError' + https://hivemq.com/edge/api/model/ScriptReferencedError: '#/components/schemas/ScriptReferencedError' + https://hivemq.com/edge/api/model/ScriptSanitationFailureError: '#/components/schemas/ScriptSanitationFailureError' + https://hivemq.com/edge/api/model/TopicFilterMismatchError: '#/components/schemas/TopicFilterMismatchError' + https://hivemq.com/edge/api/model/InsufficientStorageError: '#/components/schemas/InsufficientStorageError' + https://hivemq.com/edge/api/model/InternalServerError: '#/components/schemas/InternalServerError' + https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' + https://hivemq.com/edge/api/model/PreconditionFailedError: '#/components/schemas/PreconditionFailedError' + https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' + https://hivemq.com/edge/api/model/RequestBodyParameterMissingError: '#/components/schemas/RequestBodyParameterMissingError' + https://hivemq.com/edge/api/model/TemporaryNotAvailableError: '#/components/schemas/TemporaryNotAvailableError' + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + BehaviorPolicyAlreadyPresentError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The behavior policy id. + example: abc + required: + - id + example: + general: + status: 409 + title: Behavior Policy Already Present + detail: The given behavior policy 'abc' is already present. + id: abc + type: https://hivemq.com/edge/api/model/BehaviorPolicyAlreadyPresentError + BehaviorPolicyCreationFailureError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 400 + title: Behavior Policy Creation Failed + detail: 'Behavior policy creation failed: The policy was rejected.' + type: https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError + AtLeastOneFieldMissingValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + paths: + type: array + description: The missing json paths. + items: + type: string + format: json-path + description: The json path. + example: + - $.field1 + - $.field2 + required: + - paths + example: + general: + detail: 'At least one of the fields must be present: ''$.field1'', ''$.field2''.' + paths: + - $.field1 + - $.field2 + type: https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError + ValidationError: + type: object + properties: + detail: + type: string + description: Detailed contextual description of the validation error. + type: + type: string + format: uri + description: Type of the validation error. + required: + - detail + - type + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError: '#/components/schemas/AtLeastOneFieldMissingValidationError' + https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError: '#/components/schemas/AtMostOneFunctionValidationError' + https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' + https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError: '#/components/schemas/FunctionMustBePairedValidationError' + https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError: '#/components/schemas/IllegalEventTransitionValidationError' + https://hivemq.com/edge/api/model/IllegalFunctionValidationError: '#/components/schemas/IllegalFunctionValidationError' + https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' + https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' + https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError: '#/components/schemas/InvalidFunctionOrderValidationError' + https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' + https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError: '#/components/schemas/InvalidSchemaVersionValidationError' + https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' + https://hivemq.com/edge/api/model/UnknownVariableValidationError: '#/components/schemas/UnknownVariableValidationError' + https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' + AtMostOneFunctionValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + function: + type: string + description: The function. + example: function1 + occurrences: + type: integer + format: int32 + description: The occurrences of the function. + minimum: 0 + example: 3 + paths: + type: array + items: + type: string + format: json-path + description: The json paths where the function occurs. + example: + - $.path1 + - $.path2 + - $.path3 + required: + - function + - occurrences + - paths + example: + general: + detail: The pipeline must contain at most one 'function1' function, but 3 were found at ['$.path1', '$.path2', '$.path3']. + function: function1 + occurrences: 3 + paths: + - $.path1 + - $.path2 + - $.path3 + type: https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError + EmptyFieldValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + path: + type: string + format: json-path + description: The missing field. + example: $.field + required: + - path + example: + general: + detail: Required field '$.field' is empty. + path: $.field + type: https://hivemq.com/edge/api/model/EmptyFieldValidationError + FunctionMustBePairedValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + existingFunction: + type: string + description: The existing function. + example: function1 + missingFunction: + type: string + description: The missing function. + example: function2 + required: + - existingFunction + - missingFunction + example: + general: + detail: If 'function1' function is present in the pipeline, 'function2' function must be present as well. + existingFunction: function1 + missingFunction: function2 + type: https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError + IllegalEventTransitionValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + event: + type: string + description: The event name. + example: event1 + fromState: + type: string + description: The event from state. + example: state1 + id: + type: string + description: The event id. + example: abc + path: + type: string + description: The path. + example: $.event + toState: + type: string + description: The event to state. + example: state2 + required: + - event + - fromState + - id + - path + - toState + example: + general: + detail: The transition from state 'state1' to state 'state2' on event 'event1' in '$.event' is not defined for behavior 'abc'. + event: event1 + fromState: state1 + toState: state2 + id: abc + path: $.event + type: https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError + IllegalFunctionValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + event: + type: string + description: The event name. + example: event1 + id: + type: string + description: The function id. + example: abc + path: + type: string + format: json-path + description: The json path. + example: $.event + required: + - event + - id + - path + example: + general: + detail: The function 'abc' is not allowed for event 'event1' in '$.event'. + event: event1 + id: abc + path: $.event + type: https://hivemq.com/edge/api/model/IllegalFunctionValidationError + InvalidFieldLengthValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + actualLength: + type: integer + format: int32 + description: The actual length of the field value. + example: 10 + expectedMinimumLength: + type: integer + format: int32 + description: The minimum length expected for the field value. + minimum: 0 + example: 5 + expectedMaximumLength: + type: integer + format: int32 + description: The maximum length expected for the field value. + minimum: 0 + example: 20 + path: + type: string + format: json-path + description: The invalid json path. + example: $.field + value: + type: string + description: The invalid value. + example: function transform() { return 'Hello, World!'; } + required: + - actualLength + - expectedMinimumLength + - expectedMaximumLength + - path + - value + example: + general: + detail: The length of script field '$.transform' 48 must be between 0 and 20. + actualLength: 48 + minimumLength: 0 + maximumLength: 20 + path: $.transform + value: function transform() { return 'Hello, World!'; } + type: https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError + InvalidFieldValueValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + path: + type: string + format: json-path + description: The invalid json path. + example: $.action.pipeline[1].field + value: + type: string + description: The invalid value. + example: functionDoesNotExist + required: + - path + example: + general: + detail: Referenced function does not exist. + path: $.action.pipeline[1].field + value: functionDoesNotExist + type: https://hivemq.com/edge/api/model/InvalidFieldValueValidationError + InvalidFunctionOrderValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + function: + type: string + description: The function. + example: transform + path: + type: string + format: json-path + description: The json path. + example: $.path + previousFunction: + type: string + description: The previous function. + example: init + required: + - function + - path + - previousFunction + example: + general: + detail: The operation at '$.path' with the functionId 'transform' must be after a 'init' operation. + function: transform + path: $.path + previousFunction: init + type: https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError + InvalidIdentifierValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + path: + type: string + format: json-path + description: The invalid identifier path. + example: $.id + value: + type: string + description: The invalid identifier value. + example: invalidId + required: + - path + - value + example: + general: + detail: Identifier script 'id' must begin with a letter and may only consist of lowercase letters, uppercase letters, numbers, periods, hyphens, and underscores. + path: $.id + value: invalidId + type: https://hivemq.com/edge/api/model/InvalidIdentifierValidationError + InvalidSchemaVersionValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + id: + type: string + description: The schema id. + example: abc + version: + type: string + description: The schema version. + example: '2' + required: + - id + - version + example: + general: + detail: The referenced schema with id 'abc' and version '2' was not found. + id: abc + version: '2' + type: https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError + MissingFieldValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + path: + type: string + format: json-path + description: The missing path. + example: $.id + required: + - path + example: + general: + detail: Required field '$.id' is missing. + path: $.id + type: https://hivemq.com/edge/api/model/MissingFieldValidationError + UnknownVariableValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + path: + type: string + description: The json path of the field. + example: $.path + variables: + type: array + items: + type: string + description: The unknown variables. + example: + - a + - b + - c + required: + - path + - variables + example: + general: + detail: 'Field ''$.path'' contains unknown variables: [a, b, c].' + path: $.path + variables: + - a + - b + - c + type: https://hivemq.com/edge/api/model/UnknownVariableValidationError + UnsupportedFieldValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + actualValue: + type: string + description: The actual value. + expectedValue: + type: string + description: The expected value. + path: + type: string + format: json-path + description: The json path. + example: $.id + required: + - actualValue + - expectedValue + - path + example: + general: + detail: Unsupported type 'String' for field '$.id'. Expected type is 'Object'. + actualValue: String + expectedValue: Object + path: $.id + type: https://hivemq.com/edge/api/model/UnsupportedFieldValidationError + BehaviorPolicyValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - oneOf: + - $ref: '#/components/schemas/IllegalEventTransitionValidationError' + - $ref: '#/components/schemas/IllegalFunctionValidationError' + - $ref: '#/components/schemas/InvalidSchemaVersionValidationError' + - $ref: '#/components/schemas/AtLeastOneFieldMissingValidationError' + - $ref: '#/components/schemas/EmptyFieldValidationError' + - $ref: '#/components/schemas/InvalidFieldLengthValidationError' + - $ref: '#/components/schemas/InvalidFieldValueValidationError' + - $ref: '#/components/schemas/InvalidIdentifierValidationError' + - $ref: '#/components/schemas/MissingFieldValidationError' + - $ref: '#/components/schemas/UnsupportedFieldValidationError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError: '#/components/schemas/AtLeastOneFieldMissingValidationError' + https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' + https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError: '#/components/schemas/IllegalEventTransitionValidationError' + https://hivemq.com/edge/api/model/IllegalFunctionValidationError: '#/components/schemas/IllegalFunctionValidationError' + https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' + https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' + https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' + https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError: '#/components/schemas/InvalidSchemaVersionValidationError' + https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' + https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' + BehaviorPolicyInvalidErrors: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + childErrors: + type: array + description: List of child validation errors. + items: + $ref: '#/components/schemas/BehaviorPolicyValidationError' + required: + - childErrors + example: + general: + status: 400 + title: Behavior Policy Invalid + detail: Behavior policy is invalid due to validation errors. + type: https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors + childErrors: + - detail: The transition from state 'state1' to state 'state2' on event 'event1' in '$.path' is not defined for behavior 'id1'. + fromState: state1 + toState: state2 + path: $.path + id: id1 + type: https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError + BehaviorPolicyNotFoundError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The data policy id. + example: abc + required: + - id + example: + general: + status: 404 + title: Behavior Policy Not Found + detail: Behavior policy with ID 'abc' is not found. + id: abc + type: https://hivemq.com/edge/api/model/BehaviorPolicyNotFoundError + BehaviorPolicyRejectedError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 400 + title: Behavior Policy Rejected + detail: Behavior policy is rejected. + type: https://hivemq.com/edge/api/model/BehaviorPolicyRejectedError + BehaviorPolicyUpdateFailureError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The ID of the policy that failed to update. + example: abc + required: + - id + example: + general: + status: 400 + title: Behavior Policy Update Failed + detail: Behavior policy with ID 'abc' update failed. + id: abc + type: https://hivemq.com/edge/api/model/BehaviorPolicyUpdateFailureError + ClientDisconnectedError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The client id. + example: abc + required: + - id + example: + general: + status: 404 + title: Client Disconnected + detail: Client with ID 'abc' is disconnected. + id: abc + type: https://hivemq.com/edge/api/model/ClientDisconnectedError + ClientNotFoundError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The client id. + example: abc + required: + - id + example: + general: + status: 404 + title: Client Not Found + detail: Client with ID 'abc' is not found. + id: abc + type: https://hivemq.com/edge/api/model/ClientNotFoundError + DataPolicyAlreadyPresentError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The data policy id. + example: abc + required: + - id + example: + general: + status: 409 + title: Data Policy Already Present + detail: The given data policy 'abc' is already present. + id: abc + type: https://hivemq.com/edge/api/model/DataPolicyAlreadyPresentError + DataPolicyCreationFailureError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 400 + title: Data Policy Creation Failed + detail: 'Data policy creation failed: The policy was rejected.' + type: https://hivemq.com/edge/api/model/DataPolicyCreationFailureError + DataPolicyValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - oneOf: + - $ref: '#/components/schemas/AtMostOneFunctionValidationError' + - $ref: '#/components/schemas/FunctionMustBePairedValidationError' + - $ref: '#/components/schemas/InvalidFunctionOrderValidationError' + - $ref: '#/components/schemas/InvalidSchemaVersionValidationError' + - $ref: '#/components/schemas/UnknownVariableValidationError' + - $ref: '#/components/schemas/EmptyFieldValidationError' + - $ref: '#/components/schemas/InvalidFieldLengthValidationError' + - $ref: '#/components/schemas/InvalidFieldValueValidationError' + - $ref: '#/components/schemas/InvalidIdentifierValidationError' + - $ref: '#/components/schemas/MissingFieldValidationError' + - $ref: '#/components/schemas/UnsupportedFieldValidationError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError: '#/components/schemas/AtMostOneFunctionValidationError' + https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' + https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError: '#/components/schemas/FunctionMustBePairedValidationError' + https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' + https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' + https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError: '#/components/schemas/InvalidFunctionOrderValidationError' + https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' + https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError: '#/components/schemas/InvalidSchemaVersionValidationError' + https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' + https://hivemq.com/edge/api/model/UnknownVariableValidationError: '#/components/schemas/UnknownVariableValidationError' + https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' + DataPolicyInvalidErrors: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + childErrors: + type: array + description: List of child validation errors. + items: + $ref: '#/components/schemas/DataPolicyValidationError' + required: + - childErrors + example: + general: + status: 400 + title: Data Policy Invalid + detail: Data policy is invalid due to validation errors. + type: https://hivemq.com/edge/api/model/DataPolicyInvalidErrors + childErrors: + - detail: The pipeline must contain at most one 'function1' function, but 3 were found at ['$.path1', '$.path2', '$.path3']. + function: function1 + occurrences: 3 + paths: + - $.path1 + - $.path2 + - $.path3 + type: https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError + DataPolicyNotFoundError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The data policy id. + example: abc + required: + - id + example: + general: + status: 404 + title: Data Policy Not Found + detail: Data policy with ID 'abc' is not found. + id: abc + type: https://hivemq.com/edge/api/model/DataPolicyNotFoundError + DataPolicyRejectedError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 400 + title: Data Policy Rejected + detail: Data policy is rejected. + type: https://hivemq.com/edge/api/model/DataPolicyRejectedError + DataPolicyUpdateFailureError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The ID of the policy that failed to update. + example: abc + required: + - id + example: + general: + status: 400 + title: Data Policy Update Failed + detail: Data policy with ID 'abc' update failed. + id: abc + type: https://hivemq.com/edge/api/model/DataPolicyUpdateFailureError + PolicyIdMismatchError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + actualId: + type: string + description: The actual id. + example: id1 + expectedId: + type: string + description: The expected id. + example: id2 + required: + - actualId + - expectedId + example: + general: + status: 400 + title: Policy ID Mismatch + detail: The policy ID 'id1' in the request parameter does not match the policy ID 'id2' in the policy request body. + id: abc + type: https://hivemq.com/edge/api/model/PolicyIdMismatchError + PolicyInsufficientStorageError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The policy id. + example: abc + required: + - id + example: + general: + status: 507 + title: Policy Insufficient Storage + detail: Policy with ID '123' could not be added because of insufficient server storage. + id: abc + type: https://hivemq.com/edge/api/model/PolicyInsufficientStorageError + PolicyNotFoundError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The policy id. + example: abc + required: + - id + example: + general: + status: 404 + title: Policy Not Found + detail: Policy with ID 'abc' is not found. + id: abc + type: https://hivemq.com/edge/api/model/PolicyNotFoundError + SchemaAlreadyPresentError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The schema id. + example: abc + required: + - id + example: + general: + status: 409 + title: Schema Already Present + detail: The given schema is already present as the latest version for the schema id 'abc'. + id: abc + type: https://hivemq.com/edge/api/model/SchemaAlreadyPresentError + SchemaEtagMismatchError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The schema id. + example: abc + eTag: + type: string + description: The eTag. + example: 33a64df551425fcc55e4d42a148795d9f25f89d4 + required: + - id + example: + general: + status: 412 + title: Schema eTag Mismatch + detail: Schema with id 'abc' does not match the given etag '33a64df551425fcc55e4d42a148795d9f25f89d4'. + id: abc + eTag: 33a64df551425fcc55e4d42a148795d9f25f89d4 + type: https://hivemq.com/edge/api/model/SchemaEtagMismatchError + SchemaInsufficientStorageError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The policy id. + example: abc + required: + - id + example: + general: + status: 507 + title: Schema Insufficient Storage + detail: Schema with ID '123' could not be added because of insufficient server storage. + id: abc + type: https://hivemq.com/edge/api/model/SchemaInsufficientStorageError + SchemaValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - oneOf: + - $ref: '#/components/schemas/EmptyFieldValidationError' + - $ref: '#/components/schemas/InvalidFieldLengthValidationError' + - $ref: '#/components/schemas/InvalidFieldValueValidationError' + - $ref: '#/components/schemas/InvalidIdentifierValidationError' + - $ref: '#/components/schemas/MissingFieldValidationError' + - $ref: '#/components/schemas/UnsupportedFieldValidationError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' + https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' + https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' + https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' + https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' + https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' + SchemaInvalidErrors: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + childErrors: + type: array + description: List of child validation errors. + items: + $ref: '#/components/schemas/SchemaValidationError' + required: + - childErrors + example: + general: + status: 400 + title: Schema Invalid + detail: Schema is invalid due to validation errors. + type: https://hivemq.com/edge/api/model/SchemaInvalidErrors + childErrors: + - detail: The length of script field '$.id' 1025 must be between 0 and 1024. + paths: $.id + value: aaa...aaa + actualLength: 1025 + expectedMinimumLength: 0 + expectedMaximumLength: 1024 + type: https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError + SchemaNotFoundError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The schema ID. + example: abc + required: + - id + example: + general: + status: 404 + title: Schema Not Found + detail: Schema with ID 'abc' is not found. + id: abc + type: https://hivemq.com/edge/api/model/SchemaNotFoundError + SchemaParsingFailureError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + alias: + type: string + description: The schema alias. + example: abc + required: + - alias + example: + general: + status: 400 + title: Schema Parsing Failure + detail: The given schema 'abc' could not be parsed. + alias: abc + type: https://hivemq.com/edge/api/model/SchemaParsingFailureError + SchemaReferencedError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The schema ID. + example: abc + required: + - id + example: + general: + status: 400 + title: Schema Referenced + detail: Schema with ID 'abc' is referenced. + id: abc + type: https://hivemq.com/edge/api/model/SchemaReferencedError + ScriptAlreadyPresentError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The script id. + example: abc + required: + - id + example: + general: + status: 409 + title: Script Already Present + detail: The given script 'abc' is already present. + id: abc + type: https://hivemq.com/edge/api/model/ScriptAlreadyPresentError + ScriptCreationFailureError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 400 + title: Script Creation Failure + detail: The given script could not be created. + type: https://hivemq.com/edge/api/model/ScriptCreationFailureError + ScriptEtagMismatchError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The script id. + example: abc + eTag: + type: string + description: The eTag. + example: 33a64df551425fcc55e4d42a148795d9f25f89d4 + required: + - id + example: + general: + status: 412 + title: Script eTag Mismatch + detail: Script with id 'abc' does not match the given etag '33a64df551425fcc55e4d42a148795d9f25f89d4'. + id: abc + eTag: 33a64df551425fcc55e4d42a148795d9f25f89d4 + type: https://hivemq.com/edge/api/model/ScriptEtagMismatchError + ScriptInsufficientStorageError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The policy id. + example: abc + required: + - id + example: + general: + status: 507 + title: Script Insufficient Storage + detail: Script with ID '123' could not be added because of insufficient server storage. + id: abc + type: https://hivemq.com/edge/api/model/ScriptInsufficientStorageError + ScriptValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - oneOf: + - $ref: '#/components/schemas/InvalidFieldLengthValidationError' + - $ref: '#/components/schemas/InvalidFieldValueValidationError' + - $ref: '#/components/schemas/InvalidIdentifierValidationError' + - $ref: '#/components/schemas/MissingFieldValidationError' + - $ref: '#/components/schemas/UnsupportedFieldValidationError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' + https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' + https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' + https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' + https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' + ScriptInvalidErrors: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + childErrors: + type: array + description: List of child validation errors. + items: + $ref: '#/components/schemas/ScriptValidationError' + required: + - childErrors + example: + general: + status: 400 + title: Script Invalid + detail: Script is invalid due to validation errors. + type: https://hivemq.com/edge/api/model/ScriptInvalidErrors + childErrors: + - detail: The length of script field '$.id' 1025 must be between 0 and 1024. + paths: $.id + value: aaa...aaa + actualLength: 1025 + expectedMinimumLength: 0 + expectedMaximumLength: 1024 + type: https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError + ScriptNotFoundError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The script ID. + example: abc + required: + - id + example: + general: + status: 404 + title: Script Not Found + detail: Script with ID 'abc' is not found. + id: abc + type: https://hivemq.com/edge/api/model/ScriptNotFoundError + ScriptParsingFailureError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 400 + title: Script Parsing Failure + detail: The given script 'abc' could not be parsed. + type: https://hivemq.com/edge/api/model/ScriptParsingFailureError + ScriptReferencedError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The script ID. + example: abc + required: + - id + example: + general: + status: 400 + title: Script Referenced + detail: Script with ID 'abc' is referenced. + id: abc + type: https://hivemq.com/edge/api/model/ScriptReferencedError + ScriptSanitationFailureError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 400 + title: Script Sanitation Failure + detail: The given script could not be sanitized. + type: https://hivemq.com/edge/api/model/ScriptSanitationFailureError + TopicFilterMismatchError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + path: + type: string + description: The json path of the topic filter. + example: $.filter + required: + - path + example: + general: + status: 400 + title: Topic Filter Mismatch + detail: The topic filter '$.filter' mismatches. + type: https://hivemq.com/edge/api/model/TopicFilterMismatchError + InsufficientStorageError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 507 + title: Insufficient Storage + detail: Insufficient Storage. + type: https://hivemq.com/edge/api/model/InsufficientStorageError + InternalServerError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 500 + title: Internal Server Error + detail: An unexpected error occurred, check the logs. + type: https://hivemq.com/edge/api/model/InternalServerError + creation: + status: 500 + title: Internal Server Error + detail: 'An unexpected error occurred: Exception during creation of the Json Schema for functions.' + type: https://hivemq.com/edge/api/model/InternalServerError + InvalidQueryParameterError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + parameter: + type: string + description: The query parameter. + required: + - parameter + example: + general: + status: 400 + title: Query Parameter is Invalid + detail: 'Query parameter ''a'' is invalid: ''a'' could not be parsed.' + parameter: a + type: https://hivemq.com/edge/api/model/InvalidQueryParameterError + PreconditionFailedError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 412 + title: Precondition Failed + detail: 'A precondition required for fulfilling the request was not fulfilled: Policy does not match the given etag ''abc''.' + type: https://hivemq.com/edge/api/model/PreconditionFailedError + RequestBodyMissingError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 400 + title: Required Request Body Missing + detail: Required request body is missing. + type: https://hivemq.com/edge/api/model/RequestBodyMissingError + RequestBodyParameterMissingError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + parameter: + type: string + description: The the missing request body parameter. + required: + - parameter + example: + general: + status: 400 + title: Required Request Body Parameter Missing + detail: Required request body parameter 'a' is missing. + parameter: a + type: https://hivemq.com/edge/api/model/RequestBodyParameterMissingError + TemporaryNotAvailableError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 503 + title: Endpoint Temporarily not Available + detail: The endpoint is temporarily not available, please try again later. + type: https://hivemq.com/edge/api/model/TemporaryNotAvailableError + UrlParameterMissingError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + parameter: + type: string + description: The name of the missing parameter. + required: + - parameter + example: + general: + status: 400 + title: Required URL Parameter Missing + detail: Required URL parameter 'a' is missing. + parameter: a + type: https://hivemq.com/edge/api/model/UrlParameterMissingError + JsonNode: + type: object + description: The arguments of the fsm derived from the behavior policy. + FsmStateInformationItem: + type: object + description: List of result items that are returned by this endpoint + properties: + arguments: + $ref: '#/components/schemas/JsonNode' + behaviorId: + type: string + description: The unique identifier of the policy. + firstSetAt: + type: string + description: The timestamp when this state was set the first time. + policyId: + type: string + description: The unique identifier of the policy. + stateName: type: string description: The name of the fsm state. stateType: @@ -5201,8 +6650,6 @@ components: description: List of result items that are returned by this endpoint items: $ref: '#/components/schemas/DataPolicy' - Errors: - type: object PolicyType: description: The type of policy in Data Hub type: string diff --git a/hivemq-edge-openapi/openapi/openapi.yaml b/hivemq-edge-openapi/openapi/openapi.yaml index f2e902c9f4..96cf32c3d5 100644 --- a/hivemq-edge-openapi/openapi/openapi.yaml +++ b/hivemq-edge-openapi/openapi/openapi.yaml @@ -30,7 +30,7 @@ info: imported into popular API tooling (e.g. Postman) or can be used to generate client-code for multiple programming languages. title: HiveMQ Edge REST API - version: 2025.12-SNAPSHOT + version: 2025.15-SNAPSHOT x-logo: url: https://www.hivemq.com/img/svg/hivemq-bee.svg tags: From 32a6dbf42327157c4979ffa53a1e326e02a2d157 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Thu, 2 Oct 2025 11:44:05 +0200 Subject: [PATCH 115/121] fix: Reorg the openapi spec --- ext/hivemq-edge-openapi-2025.17.yaml | 1925 +++++++++++++++-- ext/openAPI/openapi-datahub.yaml | 159 -- .../schemas/errors/ApiProblemDetails.yaml | 0 .../AtMostOneFunctionValidationError.yaml | 0 .../BehaviorPolicyAlreadyPresentError.yaml | 0 .../BehaviorPolicyCreationFailureError.yaml | 0 .../datahub/BehaviorPolicyInvalidErrors.yaml | 0 .../datahub/BehaviorPolicyNotFoundError.yaml | 0 .../datahub/BehaviorPolicyRejectedError.yaml | 0 .../BehaviorPolicyUpdateFailureError.yaml | 0 .../BehaviorPolicyValidationError.yaml | 0 .../datahub/ClientDisconnectedError.yaml | 0 .../errors/datahub/ClientNotFoundError.yaml | 0 .../DataPolicyAlreadyPresentError.yaml | 0 .../DataPolicyCreationFailureError.yaml | 0 .../datahub/DataPolicyInvalidErrors.yaml | 0 .../datahub/DataPolicyNotFoundError.yaml | 0 .../datahub/DataPolicyRejectedError.yaml | 0 .../datahub/DataPolicyUpdateFailureError.yaml | 0 .../datahub/DataPolicyValidationError.yaml | 0 .../FunctionMustBePairedValidationError.yaml | 0 ...IllegalEventTransitionValidationError.yaml | 0 .../IllegalFunctionValidationError.yaml | 0 .../InvalidFunctionOrderValidationError.yaml | 0 .../InvalidSchemaVersionValidationError.yaml | 0 .../errors/datahub/PolicyIdMismatchError.yaml | 0 .../PolicyInsufficientStorageError.yaml | 0 .../errors/datahub/PolicyNotFoundError.yaml | 0 .../datahub/SchemaAlreadyPresentError.yaml | 0 .../datahub/SchemaEtagMismatchError.yaml | 0 .../SchemaInsufficientStorageError.yaml | 0 .../errors/datahub/SchemaInvalidErrors.yaml | 0 .../errors/datahub/SchemaNotFoundError.yaml | 0 .../datahub/SchemaParsingFailureError.yaml | 0 .../errors/datahub/SchemaReferencedError.yaml | 0 .../errors/datahub/SchemaValidationError.yaml | 0 .../datahub/ScriptAlreadyPresentError.yaml | 0 .../datahub/ScriptCreationFailureError.yaml | 0 .../datahub/ScriptEtagMismatchError.yaml | 0 .../ScriptInsufficientStorageError.yaml | 0 .../errors/datahub/ScriptInvalidErrors.yaml | 0 .../errors/datahub/ScriptNotFoundError.yaml | 0 .../datahub/ScriptParsingFailureError.yaml | 0 .../errors/datahub/ScriptReferencedError.yaml | 0 .../datahub/ScriptSanitationFailureError.yaml | 0 .../errors/datahub/ScriptValidationError.yaml | 0 .../datahub/TopicFilterMismatchError.yaml | 0 .../UnknownVariableValidationError.yaml | 0 .../errors/http/InsufficientStorageError.yaml | 0 .../errors/http/InternalServerError.yaml | 0 .../http/InvalidQueryParameterError.yaml | 0 .../errors/http/PreconditionFailedError.yaml | 0 .../errors/http/RequestBodyMissingError.yaml | 0 .../RequestBodyParameterMissingError.yaml | 0 .../http/TemporaryNotAvailableError.yaml | 0 .../errors/http/UrlParameterMissingError.yaml | 0 ...AtLeastOneFieldMissingValidationError.yaml | 0 .../validation/EmptyFieldValidationError.yaml | 0 .../InvalidFieldLengthValidationError.yaml | 0 .../InvalidFieldValueValidationError.yaml | 0 .../InvalidIdentifierValidationError.yaml | 0 .../MissingFieldValidationError.yaml | 0 .../UnsupportedFieldValidationError.yaml | 0 .../errors/validation/ValidationError.yaml | 0 .../openapi}/templates/Java/README.md | 0 .../Java/typeInfoAnnotation.mustache | 0 hivemq-edge/build.gradle.kts | 2 +- 67 files changed, 1687 insertions(+), 399 deletions(-) delete mode 100644 ext/openAPI/openapi-datahub.yaml rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/ApiProblemDetails.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/datahub/AtMostOneFunctionValidationError.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/datahub/BehaviorPolicyAlreadyPresentError.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/datahub/BehaviorPolicyCreationFailureError.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/datahub/BehaviorPolicyInvalidErrors.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/datahub/BehaviorPolicyNotFoundError.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/datahub/BehaviorPolicyRejectedError.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/datahub/BehaviorPolicyUpdateFailureError.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/datahub/BehaviorPolicyValidationError.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/datahub/ClientDisconnectedError.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/datahub/ClientNotFoundError.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/datahub/DataPolicyAlreadyPresentError.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/datahub/DataPolicyCreationFailureError.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/datahub/DataPolicyInvalidErrors.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/datahub/DataPolicyNotFoundError.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/datahub/DataPolicyRejectedError.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/datahub/DataPolicyUpdateFailureError.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/datahub/DataPolicyValidationError.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/datahub/FunctionMustBePairedValidationError.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/datahub/IllegalEventTransitionValidationError.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/datahub/IllegalFunctionValidationError.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/datahub/InvalidFunctionOrderValidationError.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/datahub/InvalidSchemaVersionValidationError.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/datahub/PolicyIdMismatchError.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/datahub/PolicyInsufficientStorageError.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/datahub/PolicyNotFoundError.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/datahub/SchemaAlreadyPresentError.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/datahub/SchemaEtagMismatchError.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/datahub/SchemaInsufficientStorageError.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/datahub/SchemaInvalidErrors.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/datahub/SchemaNotFoundError.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/datahub/SchemaParsingFailureError.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/datahub/SchemaReferencedError.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/datahub/SchemaValidationError.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/datahub/ScriptAlreadyPresentError.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/datahub/ScriptCreationFailureError.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/datahub/ScriptEtagMismatchError.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/datahub/ScriptInsufficientStorageError.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/datahub/ScriptInvalidErrors.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/datahub/ScriptNotFoundError.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/datahub/ScriptParsingFailureError.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/datahub/ScriptReferencedError.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/datahub/ScriptSanitationFailureError.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/datahub/ScriptValidationError.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/datahub/TopicFilterMismatchError.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/datahub/UnknownVariableValidationError.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/http/InsufficientStorageError.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/http/InternalServerError.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/http/InvalidQueryParameterError.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/http/PreconditionFailedError.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/http/RequestBodyMissingError.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/http/RequestBodyParameterMissingError.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/http/TemporaryNotAvailableError.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/http/UrlParameterMissingError.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/validation/AtLeastOneFieldMissingValidationError.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/validation/EmptyFieldValidationError.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/validation/InvalidFieldLengthValidationError.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/validation/InvalidFieldValueValidationError.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/validation/InvalidIdentifierValidationError.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/validation/MissingFieldValidationError.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/validation/UnsupportedFieldValidationError.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/components/schemas/errors/validation/ValidationError.yaml (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/templates/Java/README.md (100%) rename {ext/openAPI => hivemq-edge-openapi/openapi}/templates/Java/typeInfoAnnotation.mustache (100%) diff --git a/ext/hivemq-edge-openapi-2025.17.yaml b/ext/hivemq-edge-openapi-2025.17.yaml index 456f960aba..34f1b8f06f 100644 --- a/ext/hivemq-edge-openapi-2025.17.yaml +++ b/ext/hivemq-edge-openapi-2025.17.yaml @@ -357,12 +357,23 @@ paths: schema: $ref: '#/components/schemas/BehaviorPolicyList' description: Success + '400': + content: + application/problem+json: + schema: + oneOf: + - $ref: '#/components/schemas/InvalidQueryParameterError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' + description: URL parameter missing '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporarily not available + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Get all policies tags: - Data Hub - Behavior Policies @@ -447,34 +458,45 @@ paths: description: Success '400': content: - application/json: - schema: - $ref: '#/components/schemas/ProblemDetails' + application/problem+json: + schema: + oneOf: + - $ref: '#/components/schemas/BehaviorPolicyCreationFailureError' + - $ref: '#/components/schemas/BehaviorPolicyInvalidErrors' + - $ref: '#/components/schemas/BehaviorPolicyRejectedError' + - $ref: '#/components/schemas/RequestBodyMissingError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError: '#/components/schemas/BehaviorPolicyCreationFailureError' + https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors: '#/components/schemas/BehaviorPolicyInvalidErrors' + https://hivemq.com/edge/api/model/BehaviorPolicyRejectedError: '#/components/schemas/BehaviorPolicyRejectedError' + https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' description: Policy creation failed '409': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Already exists + $ref: '#/components/schemas/BehaviorPolicyAlreadyPresentError' + description: Behavior policy already present '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Internal error + $ref: '#/components/schemas/InternalServerError' + description: Internal server error '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporarily unavailable + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable '507': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Insufficient storage error + $ref: '#/components/schemas/PolicyInsufficientStorageError' + description: Insufficient storage summary: Create a new policy tags: - Data Hub - Behavior Policies @@ -504,34 +526,39 @@ paths: description: Success, no response body '400': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Policy not found + $ref: '#/components/schemas/PolicyNotFoundError' + description: Behavior policy not found '412': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/PreconditionFailedError' description: Precondition failed '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Internal error + $ref: '#/components/schemas/InternalServerError' + description: Internal server error '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporarily not available + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Delete a behavior policy tags: - Data Hub - Behavior Policies @@ -599,16 +626,33 @@ paths: description: Success '400': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Invalid query parameter + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + description: Bad request '404': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/BehaviorPolicyNotFoundError' description: Policy not found + '500': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/InternalServerError' + description: Internal server error + '503': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Get a policy tags: - Data Hub - Behavior Policies @@ -709,41 +753,56 @@ paths: description: Success '400': content: - application/json: - schema: - $ref: '#/components/schemas/ProblemDetails' - description: Policy creation failed + application/problem+json: + schema: + oneOf: + - $ref: '#/components/schemas/RequestBodyMissingError' + - $ref: '#/components/schemas/UrlParameterMissingError' + - $ref: '#/components/schemas/BehaviorPolicyCreationFailureError' + - $ref: '#/components/schemas/BehaviorPolicyInvalidErrors' + - $ref: '#/components/schemas/BehaviorPolicyUpdateFailureError' + - $ref: '#/components/schemas/PolicyIdMismatchError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError: '#/components/schemas/BehaviorPolicyCreationFailureError' + https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors: '#/components/schemas/BehaviorPolicyInvalidErrors' + https://hivemq.com/edge/api/model/BehaviorPolicyUpdateFailureError: '#/components/schemas/BehaviorPolicyUpdateFailureError' + https://hivemq.com/edge/api/model/PolicyIdMismatchError: '#/components/schemas/PolicyIdMismatchError' + description: Behavior policy creation failed '404': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Policy not found + $ref: '#/components/schemas/BehaviorPolicyNotFoundError' + description: Data policy not found '412': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/PreconditionFailedError' description: Precondition failed '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Internal error + $ref: '#/components/schemas/InternalServerError' + description: Internal server error '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporarily unavailable + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable '507': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Insufficient storage error - summary: Update an existing policy + $ref: '#/components/schemas/PolicyInsufficientStorageError' + description: Insufficient storage + summary: Update an existing behavior policy tags: - Data Hub - Behavior Policies /api/v1/data-hub/behavior-validation/states/{clientId}: @@ -787,22 +846,34 @@ paths: description: Success '400': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' description: URL parameter missing '404': content: - application/json: - schema: - $ref: '#/components/schemas/ProblemDetails' - description: Client is disconnected + application/problem+json: + schema: + oneOf: + - $ref: '#/components/schemas/ClientDisconnectedError' + - $ref: '#/components/schemas/ClientNotFoundError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/ClientDisconnectedError: '#/components/schemas/ClientDisconnectedError' + https://hivemq.com/edge/api/model/ClientNotFoundError: '#/components/schemas/ClientNotFoundError' + description: Client error '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Internal Server error + $ref: '#/components/schemas/InternalServerError' + description: Internal server error summary: Get the state of a client tags: - Data Hub - State @@ -1051,27 +1122,20 @@ paths: description: Success '400': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + oneOf: + - $ref: '#/components/schemas/InvalidQueryParameterError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' description: URL parameter missing - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/ProblemDetails' - description: DataPolicy not found - '500': - content: - application/json: - schema: - $ref: '#/components/schemas/ProblemDetails' - description: Internal server error '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable summary: Get all data policies tags: @@ -1155,33 +1219,44 @@ paths: description: Success '400': content: - application/json: - schema: - $ref: '#/components/schemas/ProblemDetails' - description: DataPolicy creation failed + application/problem+json: + schema: + oneOf: + - $ref: '#/components/schemas/RequestBodyMissingError' + - $ref: '#/components/schemas/DataPolicyCreationFailureError' + - $ref: '#/components/schemas/DataPolicyInvalidErrors' + - $ref: '#/components/schemas/DataPolicyRejectedError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' + https://hivemq.com/edge/api/model/DataPolicyCreationFailureError: '#/components/schemas/DataPolicyCreationFailureError' + https://hivemq.com/edge/api/model/DataPolicyInvalidErrors: '#/components/schemas/DataPolicyInvalidErrors' + https://hivemq.com/edge/api/model/DataPolicyRejectedError: '#/components/schemas/DataPolicyRejectedError' + description: Data policy creation failed '409': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: DataPolicy already present + $ref: '#/components/schemas/DataPolicyAlreadyPresentError' + description: Data policy already present '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable '507': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/PolicyInsufficientStorageError' description: Insufficient storage summary: Create a new data policy tags: @@ -1212,27 +1287,38 @@ paths: description: Success, no response body '400': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: DataPolicy not found + $ref: '#/components/schemas/PolicyNotFoundError' + description: Data policy not found + '412': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/PreconditionFailedError' + description: Precondition failed '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable summary: Delete a data policy tags: @@ -1300,32 +1386,33 @@ paths: description: Success '400': content: - application/json: - examples: - param-missing: - description: Example response when a required parameter is missing. - summary: Required URL parameter missing - value: - errors: - - title: Required parameter missing - detail: Required URL parameter 'parameterName' is missing + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' description: Bad request '404': content: - application/json: - examples: - not-found: - description: Policy not found - summary: Not found - value: - errors: - - title: Resource not found - detail: Resource with id 'my-resource-id' not found + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/PolicyNotFoundError' description: Resource not found + '500': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/InternalServerError' + description: Internal server error + '503': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Get a data policy tags: - Data Hub - Data Policies @@ -1425,33 +1512,56 @@ paths: description: Success '400': content: - application/json: - schema: - $ref: '#/components/schemas/ProblemDetails' - description: DataPolicy creation failed + application/problem+json: + schema: + oneOf: + - $ref: '#/components/schemas/RequestBodyMissingError' + - $ref: '#/components/schemas/UrlParameterMissingError' + - $ref: '#/components/schemas/DataPolicyCreationFailureError' + - $ref: '#/components/schemas/DataPolicyInvalidErrors' + - $ref: '#/components/schemas/DataPolicyUpdateFailureError' + - $ref: '#/components/schemas/PolicyIdMismatchError' + - $ref: '#/components/schemas/TopicFilterMismatchError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + https://hivemq.com/edge/api/model/DataPolicyCreationFailureError: '#/components/schemas/DataPolicyCreationFailureError' + https://hivemq.com/edge/api/model/DataPolicyInvalidErrors: '#/components/schemas/DataPolicyInvalidErrors' + https://hivemq.com/edge/api/model/DataPolicyUpdateFailureError: '#/components/schemas/DataPolicyUpdateFailureError' + https://hivemq.com/edge/api/model/PolicyIdMismatchError: '#/components/schemas/PolicyIdMismatchError' + https://hivemq.com/edge/api/model/TopicFilterMismatchError: '#/components/schemas/TopicFilterMismatchError' + description: Data policy creation failed '404': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: DataPolicy not found + $ref: '#/components/schemas/DataPolicyNotFoundError' + description: Data policy not found + '412': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/PreconditionFailedError' + description: Precondition failed '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable '507': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/PolicyInsufficientStorageError' description: Insufficient storage summary: Update an existing data policy tags: @@ -1537,9 +1647,9 @@ paths: description: Success '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/Errors' + $ref: '#/components/schemas/InternalServerError' description: Internal server error summary: Get all FSMs as a JSON Schema tags: @@ -1699,9 +1809,9 @@ paths: description: Success '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error summary: Get all functions as a JSON Schema tags: @@ -1719,9 +1829,9 @@ paths: description: Success '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error summary: Get all interpolation variables tags: @@ -1739,9 +1849,9 @@ paths: description: Success '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error summary: Get all functions as a list of function specifications tags: @@ -1876,11 +1986,22 @@ paths: schema: $ref: '#/components/schemas/SchemaList' description: Success + '400': + content: + application/problem+json: + schema: + oneOf: + - $ref: '#/components/schemas/InvalidQueryParameterError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' + description: URL parameter missing '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable summary: Get all schemas tags: @@ -1927,33 +2048,48 @@ paths: description: Success '400': content: - application/json: - schema: - $ref: '#/components/schemas/ProblemDetails' - description: Schema could not be validatetd + application/problem+json: + schema: + oneOf: + - $ref: '#/components/schemas/RequestBodyParameterMissingError' + - $ref: '#/components/schemas/SchemaInvalidErrors' + - $ref: '#/components/schemas/SchemaParsingFailureError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/RequestBodyParameterMissingError: '#/components/schemas/RequestBodyParameterMissingError' + https://hivemq.com/edge/api/model/SchemaInvalidErrors: '#/components/schemas/SchemaInvalidErrors' + https://hivemq.com/edge/api/model/SchemaParsingFailureError: '#/components/schemas/SchemaParsingFailureError' + description: Schema creation failed '409': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Schema already exists + $ref: '#/components/schemas/SchemaAlreadyPresentError' + description: Schema is already present '412': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Mismatch between schema and etag + $ref: '#/components/schemas/SchemaEtagMismatchError' + description: Schema doesn't match etag '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error + '503': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable '507': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/SchemaInsufficientStorageError' description: Insufficient storage summary: Create a new schema tags: @@ -1984,33 +2120,40 @@ paths: description: Success, no response body '400': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Schema referenced + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + - $ref: '#/components/schemas/SchemaReferencedError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + https://hivemq.com/edge/api/model/SchemaReferencedError: '#/components/schemas/SchemaReferencedError' + description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/SchemaNotFoundError' description: Schema not found '412': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Mismatch between schema and etag + $ref: '#/components/schemas/SchemaEtagMismatchError' + description: Schema doesn't match etag '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Internal server error + $ref: '#/components/schemas/InternalServerError' + description: Internal Server error '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable summary: Delete all versions of the schema tags: @@ -2056,22 +2199,33 @@ paths: description: Success '400': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: A url parameter is missing + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/SchemaNotFoundError' description: Schema not found '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error + '503': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Get a schema tags: - Data Hub - Schemas @@ -2192,12 +2346,23 @@ paths: schema: $ref: '#/components/schemas/ScriptList' description: Success + '400': + content: + application/problem+json: + schema: + oneOf: + - $ref: '#/components/schemas/InvalidQueryParameterError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' + description: URL parameter missing '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporary not available + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Get all scripts tags: - Data Hub - Scripts @@ -2243,39 +2408,52 @@ paths: description: Success '400': content: - application/json: - schema: - $ref: '#/components/schemas/ProblemDetails' - description: Script is invalid + application/problem+json: + schema: + oneOf: + - $ref: '#/components/schemas/RequestBodyParameterMissingError' + - $ref: '#/components/schemas/ScriptCreationFailureError' + - $ref: '#/components/schemas/ScriptInvalidErrors' + - $ref: '#/components/schemas/ScriptParsingFailureError' + - $ref: '#/components/schemas/ScriptSanitationFailureError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/RequestBodyParameterMissingError: '#/components/schemas/RequestBodyParameterMissingError' + https://hivemq.com/edge/api/model/ScriptCreationFailureError: '#/components/schemas/ScriptCreationFailureError' + https://hivemq.com/edge/api/model/ScriptInvalidErrors: '#/components/schemas/ScriptInvalidErrors' + https://hivemq.com/edge/api/model/ScriptParsingFailureError: '#/components/schemas/ScriptParsingFailureError' + https://hivemq.com/edge/api/model/ScriptSanitationFailureError: '#/components/schemas/ScriptSanitationFailureError' + description: Script creation failed '409': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/ScriptAlreadyPresentError' description: Script is already present '412': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/ScriptEtagMismatchError' description: Script doesn't match etag '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporary not available + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable '507': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/ScriptInsufficientStorageError' description: Insufficient storage summary: Create a new script tags: @@ -2303,34 +2481,41 @@ paths: description: Success, no response body '400': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Script is referenced + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + - $ref: '#/components/schemas/ScriptReferencedError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + https://hivemq.com/edge/api/model/ScriptReferencedError: '#/components/schemas/ScriptReferencedError' + description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/ScriptNotFoundError' description: Script not found '412': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/ScriptEtagMismatchError' description: Script doesn't match etag '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal Server error '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporary not available + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Delete a script tags: - Data Hub - Scripts @@ -2371,28 +2556,33 @@ paths: description: Success '400': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/ScriptNotFoundError' description: Script not found '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal Server error '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporary not available + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Get a script tags: - Data Hub - Scripts @@ -4916,6 +5106,7 @@ components: detail: type: string errors: + deprecated: true type: array items: $ref: '#/components/schemas/Error' @@ -5080,25 +5271,1283 @@ components: description: List of result items that are returned by this endpoint items: $ref: '#/components/schemas/BehaviorPolicy' - JsonNode: - type: object - description: The arguments of the fsm derived from the behavior policy. - FsmStateInformationItem: - type: object - description: List of result items that are returned by this endpoint - properties: - arguments: - $ref: '#/components/schemas/JsonNode' - behaviorId: - type: string - description: The unique identifier of the policy. - firstSetAt: - type: string - description: The timestamp when this state was set the first time. - policyId: - type: string - description: The unique identifier of the policy. - stateName: + ApiProblemDetails: + allOf: + - $ref: '#/components/schemas/ProblemDetails' + - type: object + required: + - detail + - status + - type + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/BehaviorPolicyAlreadyPresentError: '#/components/schemas/BehaviorPolicyAlreadyPresentError' + https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError: '#/components/schemas/BehaviorPolicyCreationFailureError' + https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors: '#/components/schemas/BehaviorPolicyInvalidErrors' + https://hivemq.com/edge/api/model/BehaviorPolicyNotFoundError: '#/components/schemas/BehaviorPolicyNotFoundError' + https://hivemq.com/edge/api/model/BehaviorPolicyRejectedError: '#/components/schemas/BehaviorPolicyRejectedError' + https://hivemq.com/edge/api/model/BehaviorPolicyUpdateFailureError: '#/components/schemas/BehaviorPolicyUpdateFailureError' + https://hivemq.com/edge/api/model/ClientDisconnectedError: '#/components/schemas/ClientDisconnectedError' + https://hivemq.com/edge/api/model/ClientNotFoundError: '#/components/schemas/ClientNotFoundError' + https://hivemq.com/edge/api/model/DataPolicyAlreadyPresentError: '#/components/schemas/DataPolicyAlreadyPresentError' + https://hivemq.com/edge/api/model/DataPolicyCreationFailureError: '#/components/schemas/DataPolicyCreationFailureError' + https://hivemq.com/edge/api/model/DataPolicyInvalidErrors: '#/components/schemas/DataPolicyInvalidErrors' + https://hivemq.com/edge/api/model/DataPolicyNotFoundError: '#/components/schemas/DataPolicyNotFoundError' + https://hivemq.com/edge/api/model/DataPolicyRejectedError: '#/components/schemas/DataPolicyRejectedError' + https://hivemq.com/edge/api/model/DataPolicyUpdateFailureError: '#/components/schemas/DataPolicyUpdateFailureError' + https://hivemq.com/edge/api/model/PolicyIdMismatchError: '#/components/schemas/PolicyIdMismatchError' + https://hivemq.com/edge/api/model/PolicyInsufficientStorageError: '#/components/schemas/PolicyInsufficientStorageError' + https://hivemq.com/edge/api/model/PolicyNotFoundError: '#/components/schemas/PolicyNotFoundError' + https://hivemq.com/edge/api/model/SchemaAlreadyPresentError: '#/components/schemas/SchemaAlreadyPresentError' + https://hivemq.com/edge/api/model/SchemaEtagMismatchError: '#/components/schemas/SchemaEtagMismatchError' + https://hivemq.com/edge/api/model/SchemaInsufficientStorageError: '#/components/schemas/SchemaInsufficientStorageError' + https://hivemq.com/edge/api/model/SchemaInvalidErrors: '#/components/schemas/SchemaInvalidErrors' + https://hivemq.com/edge/api/model/SchemaNotFoundError: '#/components/schemas/SchemaNotFoundError' + https://hivemq.com/edge/api/model/SchemaParsingFailureError: '#/components/schemas/SchemaParsingFailureError' + https://hivemq.com/edge/api/model/SchemaReferencedError: '#/components/schemas/SchemaReferencedError' + https://hivemq.com/edge/api/model/ScriptAlreadyPresentError: '#/components/schemas/ScriptAlreadyPresentError' + https://hivemq.com/edge/api/model/ScriptCreationFailureError: '#/components/schemas/ScriptCreationFailureError' + https://hivemq.com/edge/api/model/ScriptEtagMismatchError: '#/components/schemas/ScriptEtagMismatchError' + https://hivemq.com/edge/api/model/ScriptInsufficientStorageError: '#/components/schemas/ScriptInsufficientStorageError' + https://hivemq.com/edge/api/model/ScriptInvalidErrors: '#/components/schemas/ScriptInvalidErrors' + https://hivemq.com/edge/api/model/ScriptNotFoundError: '#/components/schemas/ScriptNotFoundError' + https://hivemq.com/edge/api/model/ScriptParsingFailureError: '#/components/schemas/ScriptParsingFailureError' + https://hivemq.com/edge/api/model/ScriptReferencedError: '#/components/schemas/ScriptReferencedError' + https://hivemq.com/edge/api/model/ScriptSanitationFailureError: '#/components/schemas/ScriptSanitationFailureError' + https://hivemq.com/edge/api/model/TopicFilterMismatchError: '#/components/schemas/TopicFilterMismatchError' + https://hivemq.com/edge/api/model/InsufficientStorageError: '#/components/schemas/InsufficientStorageError' + https://hivemq.com/edge/api/model/InternalServerError: '#/components/schemas/InternalServerError' + https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' + https://hivemq.com/edge/api/model/PreconditionFailedError: '#/components/schemas/PreconditionFailedError' + https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' + https://hivemq.com/edge/api/model/RequestBodyParameterMissingError: '#/components/schemas/RequestBodyParameterMissingError' + https://hivemq.com/edge/api/model/TemporaryNotAvailableError: '#/components/schemas/TemporaryNotAvailableError' + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + BehaviorPolicyAlreadyPresentError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The behavior policy id. + example: abc + required: + - id + example: + general: + status: 409 + title: Behavior Policy Already Present + detail: The given behavior policy 'abc' is already present. + id: abc + type: https://hivemq.com/edge/api/model/BehaviorPolicyAlreadyPresentError + BehaviorPolicyCreationFailureError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 400 + title: Behavior Policy Creation Failed + detail: 'Behavior policy creation failed: The policy was rejected.' + type: https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError + AtLeastOneFieldMissingValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + paths: + type: array + description: The missing json paths. + items: + type: string + format: json-path + description: The json path. + example: + - $.field1 + - $.field2 + required: + - paths + example: + general: + detail: 'At least one of the fields must be present: ''$.field1'', ''$.field2''.' + paths: + - $.field1 + - $.field2 + type: https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError + ValidationError: + type: object + properties: + detail: + type: string + description: Detailed contextual description of the validation error. + type: + type: string + format: uri + description: Type of the validation error. + required: + - detail + - type + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError: '#/components/schemas/AtLeastOneFieldMissingValidationError' + https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError: '#/components/schemas/AtMostOneFunctionValidationError' + https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' + https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError: '#/components/schemas/FunctionMustBePairedValidationError' + https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError: '#/components/schemas/IllegalEventTransitionValidationError' + https://hivemq.com/edge/api/model/IllegalFunctionValidationError: '#/components/schemas/IllegalFunctionValidationError' + https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' + https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' + https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError: '#/components/schemas/InvalidFunctionOrderValidationError' + https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' + https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError: '#/components/schemas/InvalidSchemaVersionValidationError' + https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' + https://hivemq.com/edge/api/model/UnknownVariableValidationError: '#/components/schemas/UnknownVariableValidationError' + https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' + AtMostOneFunctionValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + function: + type: string + description: The function. + example: function1 + occurrences: + type: integer + format: int32 + description: The occurrences of the function. + minimum: 0 + example: 3 + paths: + type: array + items: + type: string + format: json-path + description: The json paths where the function occurs. + example: + - $.path1 + - $.path2 + - $.path3 + required: + - function + - occurrences + - paths + example: + general: + detail: The pipeline must contain at most one 'function1' function, but 3 were found at ['$.path1', '$.path2', '$.path3']. + function: function1 + occurrences: 3 + paths: + - $.path1 + - $.path2 + - $.path3 + type: https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError + EmptyFieldValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + path: + type: string + format: json-path + description: The missing field. + example: $.field + required: + - path + example: + general: + detail: Required field '$.field' is empty. + path: $.field + type: https://hivemq.com/edge/api/model/EmptyFieldValidationError + FunctionMustBePairedValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + existingFunction: + type: string + description: The existing function. + example: function1 + missingFunction: + type: string + description: The missing function. + example: function2 + required: + - existingFunction + - missingFunction + example: + general: + detail: If 'function1' function is present in the pipeline, 'function2' function must be present as well. + existingFunction: function1 + missingFunction: function2 + type: https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError + IllegalEventTransitionValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + event: + type: string + description: The event name. + example: event1 + fromState: + type: string + description: The event from state. + example: state1 + id: + type: string + description: The event id. + example: abc + path: + type: string + description: The path. + example: $.event + toState: + type: string + description: The event to state. + example: state2 + required: + - event + - fromState + - id + - path + - toState + example: + general: + detail: The transition from state 'state1' to state 'state2' on event 'event1' in '$.event' is not defined for behavior 'abc'. + event: event1 + fromState: state1 + toState: state2 + id: abc + path: $.event + type: https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError + IllegalFunctionValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + event: + type: string + description: The event name. + example: event1 + id: + type: string + description: The function id. + example: abc + path: + type: string + format: json-path + description: The json path. + example: $.event + required: + - event + - id + - path + example: + general: + detail: The function 'abc' is not allowed for event 'event1' in '$.event'. + event: event1 + id: abc + path: $.event + type: https://hivemq.com/edge/api/model/IllegalFunctionValidationError + InvalidFieldLengthValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + actualLength: + type: integer + format: int32 + description: The actual length of the field value. + example: 10 + expectedMinimumLength: + type: integer + format: int32 + description: The minimum length expected for the field value. + minimum: 0 + example: 5 + expectedMaximumLength: + type: integer + format: int32 + description: The maximum length expected for the field value. + minimum: 0 + example: 20 + path: + type: string + format: json-path + description: The invalid json path. + example: $.field + value: + type: string + description: The invalid value. + example: function transform() { return 'Hello, World!'; } + required: + - actualLength + - expectedMinimumLength + - expectedMaximumLength + - path + - value + example: + general: + detail: The length of script field '$.transform' 48 must be between 0 and 20. + actualLength: 48 + minimumLength: 0 + maximumLength: 20 + path: $.transform + value: function transform() { return 'Hello, World!'; } + type: https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError + InvalidFieldValueValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + path: + type: string + format: json-path + description: The invalid json path. + example: $.action.pipeline[1].field + value: + type: string + description: The invalid value. + example: functionDoesNotExist + required: + - path + example: + general: + detail: Referenced function does not exist. + path: $.action.pipeline[1].field + value: functionDoesNotExist + type: https://hivemq.com/edge/api/model/InvalidFieldValueValidationError + InvalidFunctionOrderValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + function: + type: string + description: The function. + example: transform + path: + type: string + format: json-path + description: The json path. + example: $.path + previousFunction: + type: string + description: The previous function. + example: init + required: + - function + - path + - previousFunction + example: + general: + detail: The operation at '$.path' with the functionId 'transform' must be after a 'init' operation. + function: transform + path: $.path + previousFunction: init + type: https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError + InvalidIdentifierValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + path: + type: string + format: json-path + description: The invalid identifier path. + example: $.id + value: + type: string + description: The invalid identifier value. + example: invalidId + required: + - path + - value + example: + general: + detail: Identifier script 'id' must begin with a letter and may only consist of lowercase letters, uppercase letters, numbers, periods, hyphens, and underscores. + path: $.id + value: invalidId + type: https://hivemq.com/edge/api/model/InvalidIdentifierValidationError + InvalidSchemaVersionValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + id: + type: string + description: The schema id. + example: abc + version: + type: string + description: The schema version. + example: '2' + required: + - id + - version + example: + general: + detail: The referenced schema with id 'abc' and version '2' was not found. + id: abc + version: '2' + type: https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError + MissingFieldValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + path: + type: string + format: json-path + description: The missing path. + example: $.id + required: + - path + example: + general: + detail: Required field '$.id' is missing. + path: $.id + type: https://hivemq.com/edge/api/model/MissingFieldValidationError + UnknownVariableValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + path: + type: string + description: The json path of the field. + example: $.path + variables: + type: array + items: + type: string + description: The unknown variables. + example: + - a + - b + - c + required: + - path + - variables + example: + general: + detail: 'Field ''$.path'' contains unknown variables: [a, b, c].' + path: $.path + variables: + - a + - b + - c + type: https://hivemq.com/edge/api/model/UnknownVariableValidationError + UnsupportedFieldValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + actualValue: + type: string + description: The actual value. + expectedValue: + type: string + description: The expected value. + path: + type: string + format: json-path + description: The json path. + example: $.id + required: + - actualValue + - expectedValue + - path + example: + general: + detail: Unsupported type 'String' for field '$.id'. Expected type is 'Object'. + actualValue: String + expectedValue: Object + path: $.id + type: https://hivemq.com/edge/api/model/UnsupportedFieldValidationError + BehaviorPolicyValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - oneOf: + - $ref: '#/components/schemas/IllegalEventTransitionValidationError' + - $ref: '#/components/schemas/IllegalFunctionValidationError' + - $ref: '#/components/schemas/InvalidSchemaVersionValidationError' + - $ref: '#/components/schemas/AtLeastOneFieldMissingValidationError' + - $ref: '#/components/schemas/EmptyFieldValidationError' + - $ref: '#/components/schemas/InvalidFieldLengthValidationError' + - $ref: '#/components/schemas/InvalidFieldValueValidationError' + - $ref: '#/components/schemas/InvalidIdentifierValidationError' + - $ref: '#/components/schemas/MissingFieldValidationError' + - $ref: '#/components/schemas/UnsupportedFieldValidationError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError: '#/components/schemas/AtLeastOneFieldMissingValidationError' + https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' + https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError: '#/components/schemas/IllegalEventTransitionValidationError' + https://hivemq.com/edge/api/model/IllegalFunctionValidationError: '#/components/schemas/IllegalFunctionValidationError' + https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' + https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' + https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' + https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError: '#/components/schemas/InvalidSchemaVersionValidationError' + https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' + https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' + BehaviorPolicyInvalidErrors: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + childErrors: + type: array + description: List of child validation errors. + items: + $ref: '#/components/schemas/BehaviorPolicyValidationError' + required: + - childErrors + example: + general: + status: 400 + title: Behavior Policy Invalid + detail: Behavior policy is invalid due to validation errors. + type: https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors + childErrors: + - detail: The transition from state 'state1' to state 'state2' on event 'event1' in '$.path' is not defined for behavior 'id1'. + fromState: state1 + toState: state2 + path: $.path + id: id1 + type: https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError + BehaviorPolicyNotFoundError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The data policy id. + example: abc + required: + - id + example: + general: + status: 404 + title: Behavior Policy Not Found + detail: Behavior policy with ID 'abc' is not found. + id: abc + type: https://hivemq.com/edge/api/model/BehaviorPolicyNotFoundError + BehaviorPolicyRejectedError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 400 + title: Behavior Policy Rejected + detail: Behavior policy is rejected. + type: https://hivemq.com/edge/api/model/BehaviorPolicyRejectedError + BehaviorPolicyUpdateFailureError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The ID of the policy that failed to update. + example: abc + required: + - id + example: + general: + status: 400 + title: Behavior Policy Update Failed + detail: Behavior policy with ID 'abc' update failed. + id: abc + type: https://hivemq.com/edge/api/model/BehaviorPolicyUpdateFailureError + ClientDisconnectedError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The client id. + example: abc + required: + - id + example: + general: + status: 404 + title: Client Disconnected + detail: Client with ID 'abc' is disconnected. + id: abc + type: https://hivemq.com/edge/api/model/ClientDisconnectedError + ClientNotFoundError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The client id. + example: abc + required: + - id + example: + general: + status: 404 + title: Client Not Found + detail: Client with ID 'abc' is not found. + id: abc + type: https://hivemq.com/edge/api/model/ClientNotFoundError + DataPolicyAlreadyPresentError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The data policy id. + example: abc + required: + - id + example: + general: + status: 409 + title: Data Policy Already Present + detail: The given data policy 'abc' is already present. + id: abc + type: https://hivemq.com/edge/api/model/DataPolicyAlreadyPresentError + DataPolicyCreationFailureError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 400 + title: Data Policy Creation Failed + detail: 'Data policy creation failed: The policy was rejected.' + type: https://hivemq.com/edge/api/model/DataPolicyCreationFailureError + DataPolicyValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - oneOf: + - $ref: '#/components/schemas/AtMostOneFunctionValidationError' + - $ref: '#/components/schemas/FunctionMustBePairedValidationError' + - $ref: '#/components/schemas/InvalidFunctionOrderValidationError' + - $ref: '#/components/schemas/InvalidSchemaVersionValidationError' + - $ref: '#/components/schemas/UnknownVariableValidationError' + - $ref: '#/components/schemas/EmptyFieldValidationError' + - $ref: '#/components/schemas/InvalidFieldLengthValidationError' + - $ref: '#/components/schemas/InvalidFieldValueValidationError' + - $ref: '#/components/schemas/InvalidIdentifierValidationError' + - $ref: '#/components/schemas/MissingFieldValidationError' + - $ref: '#/components/schemas/UnsupportedFieldValidationError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError: '#/components/schemas/AtMostOneFunctionValidationError' + https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' + https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError: '#/components/schemas/FunctionMustBePairedValidationError' + https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' + https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' + https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError: '#/components/schemas/InvalidFunctionOrderValidationError' + https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' + https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError: '#/components/schemas/InvalidSchemaVersionValidationError' + https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' + https://hivemq.com/edge/api/model/UnknownVariableValidationError: '#/components/schemas/UnknownVariableValidationError' + https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' + DataPolicyInvalidErrors: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + childErrors: + type: array + description: List of child validation errors. + items: + $ref: '#/components/schemas/DataPolicyValidationError' + required: + - childErrors + example: + general: + status: 400 + title: Data Policy Invalid + detail: Data policy is invalid due to validation errors. + type: https://hivemq.com/edge/api/model/DataPolicyInvalidErrors + childErrors: + - detail: The pipeline must contain at most one 'function1' function, but 3 were found at ['$.path1', '$.path2', '$.path3']. + function: function1 + occurrences: 3 + paths: + - $.path1 + - $.path2 + - $.path3 + type: https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError + DataPolicyNotFoundError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The data policy id. + example: abc + required: + - id + example: + general: + status: 404 + title: Data Policy Not Found + detail: Data policy with ID 'abc' is not found. + id: abc + type: https://hivemq.com/edge/api/model/DataPolicyNotFoundError + DataPolicyRejectedError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 400 + title: Data Policy Rejected + detail: Data policy is rejected. + type: https://hivemq.com/edge/api/model/DataPolicyRejectedError + DataPolicyUpdateFailureError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The ID of the policy that failed to update. + example: abc + required: + - id + example: + general: + status: 400 + title: Data Policy Update Failed + detail: Data policy with ID 'abc' update failed. + id: abc + type: https://hivemq.com/edge/api/model/DataPolicyUpdateFailureError + PolicyIdMismatchError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + actualId: + type: string + description: The actual id. + example: id1 + expectedId: + type: string + description: The expected id. + example: id2 + required: + - actualId + - expectedId + example: + general: + status: 400 + title: Policy ID Mismatch + detail: The policy ID 'id1' in the request parameter does not match the policy ID 'id2' in the policy request body. + id: abc + type: https://hivemq.com/edge/api/model/PolicyIdMismatchError + PolicyInsufficientStorageError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The policy id. + example: abc + required: + - id + example: + general: + status: 507 + title: Policy Insufficient Storage + detail: Policy with ID '123' could not be added because of insufficient server storage. + id: abc + type: https://hivemq.com/edge/api/model/PolicyInsufficientStorageError + PolicyNotFoundError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The policy id. + example: abc + required: + - id + example: + general: + status: 404 + title: Policy Not Found + detail: Policy with ID 'abc' is not found. + id: abc + type: https://hivemq.com/edge/api/model/PolicyNotFoundError + SchemaAlreadyPresentError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The schema id. + example: abc + required: + - id + example: + general: + status: 409 + title: Schema Already Present + detail: The given schema is already present as the latest version for the schema id 'abc'. + id: abc + type: https://hivemq.com/edge/api/model/SchemaAlreadyPresentError + SchemaEtagMismatchError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The schema id. + example: abc + eTag: + type: string + description: The eTag. + example: 33a64df551425fcc55e4d42a148795d9f25f89d4 + required: + - id + example: + general: + status: 412 + title: Schema eTag Mismatch + detail: Schema with id 'abc' does not match the given etag '33a64df551425fcc55e4d42a148795d9f25f89d4'. + id: abc + eTag: 33a64df551425fcc55e4d42a148795d9f25f89d4 + type: https://hivemq.com/edge/api/model/SchemaEtagMismatchError + SchemaInsufficientStorageError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The policy id. + example: abc + required: + - id + example: + general: + status: 507 + title: Schema Insufficient Storage + detail: Schema with ID '123' could not be added because of insufficient server storage. + id: abc + type: https://hivemq.com/edge/api/model/SchemaInsufficientStorageError + SchemaValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - oneOf: + - $ref: '#/components/schemas/EmptyFieldValidationError' + - $ref: '#/components/schemas/InvalidFieldLengthValidationError' + - $ref: '#/components/schemas/InvalidFieldValueValidationError' + - $ref: '#/components/schemas/InvalidIdentifierValidationError' + - $ref: '#/components/schemas/MissingFieldValidationError' + - $ref: '#/components/schemas/UnsupportedFieldValidationError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' + https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' + https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' + https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' + https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' + https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' + SchemaInvalidErrors: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + childErrors: + type: array + description: List of child validation errors. + items: + $ref: '#/components/schemas/SchemaValidationError' + required: + - childErrors + example: + general: + status: 400 + title: Schema Invalid + detail: Schema is invalid due to validation errors. + type: https://hivemq.com/edge/api/model/SchemaInvalidErrors + childErrors: + - detail: The length of script field '$.id' 1025 must be between 0 and 1024. + paths: $.id + value: aaa...aaa + actualLength: 1025 + expectedMinimumLength: 0 + expectedMaximumLength: 1024 + type: https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError + SchemaNotFoundError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The schema ID. + example: abc + required: + - id + example: + general: + status: 404 + title: Schema Not Found + detail: Schema with ID 'abc' is not found. + id: abc + type: https://hivemq.com/edge/api/model/SchemaNotFoundError + SchemaParsingFailureError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + alias: + type: string + description: The schema alias. + example: abc + required: + - alias + example: + general: + status: 400 + title: Schema Parsing Failure + detail: The given schema 'abc' could not be parsed. + alias: abc + type: https://hivemq.com/edge/api/model/SchemaParsingFailureError + SchemaReferencedError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The schema ID. + example: abc + required: + - id + example: + general: + status: 400 + title: Schema Referenced + detail: Schema with ID 'abc' is referenced. + id: abc + type: https://hivemq.com/edge/api/model/SchemaReferencedError + ScriptAlreadyPresentError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The script id. + example: abc + required: + - id + example: + general: + status: 409 + title: Script Already Present + detail: The given script 'abc' is already present. + id: abc + type: https://hivemq.com/edge/api/model/ScriptAlreadyPresentError + ScriptCreationFailureError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 400 + title: Script Creation Failure + detail: The given script could not be created. + type: https://hivemq.com/edge/api/model/ScriptCreationFailureError + ScriptEtagMismatchError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The script id. + example: abc + eTag: + type: string + description: The eTag. + example: 33a64df551425fcc55e4d42a148795d9f25f89d4 + required: + - id + example: + general: + status: 412 + title: Script eTag Mismatch + detail: Script with id 'abc' does not match the given etag '33a64df551425fcc55e4d42a148795d9f25f89d4'. + id: abc + eTag: 33a64df551425fcc55e4d42a148795d9f25f89d4 + type: https://hivemq.com/edge/api/model/ScriptEtagMismatchError + ScriptInsufficientStorageError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The policy id. + example: abc + required: + - id + example: + general: + status: 507 + title: Script Insufficient Storage + detail: Script with ID '123' could not be added because of insufficient server storage. + id: abc + type: https://hivemq.com/edge/api/model/ScriptInsufficientStorageError + ScriptValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - oneOf: + - $ref: '#/components/schemas/InvalidFieldLengthValidationError' + - $ref: '#/components/schemas/InvalidFieldValueValidationError' + - $ref: '#/components/schemas/InvalidIdentifierValidationError' + - $ref: '#/components/schemas/MissingFieldValidationError' + - $ref: '#/components/schemas/UnsupportedFieldValidationError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' + https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' + https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' + https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' + https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' + ScriptInvalidErrors: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + childErrors: + type: array + description: List of child validation errors. + items: + $ref: '#/components/schemas/ScriptValidationError' + required: + - childErrors + example: + general: + status: 400 + title: Script Invalid + detail: Script is invalid due to validation errors. + type: https://hivemq.com/edge/api/model/ScriptInvalidErrors + childErrors: + - detail: The length of script field '$.id' 1025 must be between 0 and 1024. + paths: $.id + value: aaa...aaa + actualLength: 1025 + expectedMinimumLength: 0 + expectedMaximumLength: 1024 + type: https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError + ScriptNotFoundError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The script ID. + example: abc + required: + - id + example: + general: + status: 404 + title: Script Not Found + detail: Script with ID 'abc' is not found. + id: abc + type: https://hivemq.com/edge/api/model/ScriptNotFoundError + ScriptParsingFailureError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 400 + title: Script Parsing Failure + detail: The given script 'abc' could not be parsed. + type: https://hivemq.com/edge/api/model/ScriptParsingFailureError + ScriptReferencedError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The script ID. + example: abc + required: + - id + example: + general: + status: 400 + title: Script Referenced + detail: Script with ID 'abc' is referenced. + id: abc + type: https://hivemq.com/edge/api/model/ScriptReferencedError + ScriptSanitationFailureError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 400 + title: Script Sanitation Failure + detail: The given script could not be sanitized. + type: https://hivemq.com/edge/api/model/ScriptSanitationFailureError + TopicFilterMismatchError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + path: + type: string + description: The json path of the topic filter. + example: $.filter + required: + - path + example: + general: + status: 400 + title: Topic Filter Mismatch + detail: The topic filter '$.filter' mismatches. + type: https://hivemq.com/edge/api/model/TopicFilterMismatchError + InsufficientStorageError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 507 + title: Insufficient Storage + detail: Insufficient Storage. + type: https://hivemq.com/edge/api/model/InsufficientStorageError + InternalServerError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 500 + title: Internal Server Error + detail: An unexpected error occurred, check the logs. + type: https://hivemq.com/edge/api/model/InternalServerError + creation: + status: 500 + title: Internal Server Error + detail: 'An unexpected error occurred: Exception during creation of the Json Schema for functions.' + type: https://hivemq.com/edge/api/model/InternalServerError + InvalidQueryParameterError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + parameter: + type: string + description: The query parameter. + required: + - parameter + example: + general: + status: 400 + title: Query Parameter is Invalid + detail: 'Query parameter ''a'' is invalid: ''a'' could not be parsed.' + parameter: a + type: https://hivemq.com/edge/api/model/InvalidQueryParameterError + PreconditionFailedError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 412 + title: Precondition Failed + detail: 'A precondition required for fulfilling the request was not fulfilled: Policy does not match the given etag ''abc''.' + type: https://hivemq.com/edge/api/model/PreconditionFailedError + RequestBodyMissingError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 400 + title: Required Request Body Missing + detail: Required request body is missing. + type: https://hivemq.com/edge/api/model/RequestBodyMissingError + RequestBodyParameterMissingError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + parameter: + type: string + description: The the missing request body parameter. + required: + - parameter + example: + general: + status: 400 + title: Required Request Body Parameter Missing + detail: Required request body parameter 'a' is missing. + parameter: a + type: https://hivemq.com/edge/api/model/RequestBodyParameterMissingError + TemporaryNotAvailableError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 503 + title: Endpoint Temporarily not Available + detail: The endpoint is temporarily not available, please try again later. + type: https://hivemq.com/edge/api/model/TemporaryNotAvailableError + UrlParameterMissingError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + parameter: + type: string + description: The name of the missing parameter. + required: + - parameter + example: + general: + status: 400 + title: Required URL Parameter Missing + detail: Required URL parameter 'a' is missing. + parameter: a + type: https://hivemq.com/edge/api/model/UrlParameterMissingError + JsonNode: + type: object + description: The arguments of the fsm derived from the behavior policy. + FsmStateInformationItem: + type: object + description: List of result items that are returned by this endpoint + properties: + arguments: + $ref: '#/components/schemas/JsonNode' + behaviorId: + type: string + description: The unique identifier of the policy. + firstSetAt: + type: string + description: The timestamp when this state was set the first time. + policyId: + type: string + description: The unique identifier of the policy. + stateName: type: string description: The name of the fsm state. stateType: @@ -5201,8 +6650,6 @@ components: description: List of result items that are returned by this endpoint items: $ref: '#/components/schemas/DataPolicy' - Errors: - type: object PolicyType: description: The type of policy in Data Hub type: string diff --git a/ext/openAPI/openapi-datahub.yaml b/ext/openAPI/openapi-datahub.yaml deleted file mode 100644 index cb19957ec1..0000000000 --- a/ext/openAPI/openapi-datahub.yaml +++ /dev/null @@ -1,159 +0,0 @@ -openapi: 3.0.1 -info: - contact: - url: https://www.hivemq.com - description: > - # Introduction - - The HiveMQ Data Hub provides mechanisms to define how MQTT data and MQTT client behavior are handled in the HiveMQ broker. - - - Data Validation in the HiveMQ Data Hub allows you to implement declarative policies that check whether your data sources are sending data in the data format you expect. - - - Behavior Validation gives you the ability to model the behavior of your MQTT clients throughout the entire lifecycle of the client. - - ## Errors - - Conventional HTTP response codes are used to indicate the success or failure - of an API request. Codes in the 2xx range generally indicate success. Codes - in the 4xx range indicate an error that failed given the information - provided (e.g., a required parameter was omitted). Codes in the 5xx range - indicate an error on the server side. - - - For all errors a JSON response with additional details is returned in the - format [Problem JSON](https://tools.ietf.org/html/rfc7807). - - ## OpenAPI - - HiveMQ's REST API provides an OpenAPI 3.0 schema definition that can - imported into popular API tooling (e.g. Postman) or can be used to generate - client-code for multiple programming languages. - title: HiveMQ Data Hub REST API - version: 2025.10-SNAPSHOT - x-logo: - url: https://www.hivemq.com/img/svg/hivemq-bee.svg -tags: - - description: >- - This resource bundles endpoints for the available Finite State Machines - (FSMs) for Behavior Policies for the HiveMQ Data Hub. Currently this is - limited to getting the available FSMs. - name: Data Hub - FSM - - description: >- - This resource bundles endpoints for the available Functions for the HiveMQ - Data Hub. Currently this is limited to getting the available Functions. - name: Data Hub - Functions - - description: >- - Policies describe how you want the HiveMQ broker to validate the behavior - of MQTT clients. - - Each policy has four sections: - - - - Matching: Specifies which clients the policy engine validates. - - - Deserialization: Specifies deserializers for different message payloads. - - - Behavior: Specifies the behavior that is considered valid for matched - clients. - - - onTransitions: Specifies custom actions that are executed when a client - transitions to a different state within the specified behavior model that - is valid for that client. - - These endpoints can be used to create, update, delete, and list behavior - policies. - - - For more information on all capabilities the HiveMQ Data Hub offers, see - the [HiveMQ - documentation](https://docs.hivemq.com/hivemq/latest/data-hub/index.html). - name: Data Hub - Behavior Policies - - description: >- - Data Policies describe how you want the HiveMQ broker to apply schemas to - incoming MQTT message payload data and act on the validation results. - - Each policy has four sections: - - - - Matching: Specifies which packets the policy engine validates. - - - Validation: Specifies how the packets are validated. For example, based - on a JSON Schema. - - - OnSuccess: Defines which actions are executed when the outcome of a - validation is successful. - - - OnFailure: Defines which actions are executed when the validation fails. - - - These endpoints can be used to create, update, delete, and list data - policies. - - - For more information on all capabilities the HiveMQ Data Hub offers, see - the [HiveMQ - documentation](https://docs.hivemq.com/hivemq/latest/data-hub/index.html). - name: Data Hub - Data Policies - - description: >- - A schema defines the expected structure and format of incoming MQTT - message payload data. - - - This endpoint can be used to create, get, and delete schemas. - - - Schemas can be enforced with the use of a policy. - - - Currently, the following schema definitions are supported: - - - - [JSON Schema](https://json-schema.org/) - - - [Protocol Buffers (Protobuf)](https://protobuf.dev/) - - - For more information on how to define and use a schema in HiveMQ, see - [Schemas](https://docs.hivemq.com/hivemq/latest/data-hub/schemas.html). - name: Data Hub - Schemas - - description: >- - A script represents custom logic that can be executed in response to MQTT - messages. - - - This endpoint can be used to create, get, and delete scripts. - - - For more information on how to define and use a script in HiveMQ, see - [Scripts](https://docs.hivemq.com/hivemq/latest/data-hub/scripts.html). - name: Data Hub - Scripts - - description: >+ - These endpoints can be used to retrieve states of clients for the Data - Hub. - - name: Data Hub - State -paths: - /api/v1/data-hub/behavior-validation/policies: - $ref: paths/api_v1_data-hub_behavior-validation_policies.yaml - /api/v1/data-hub/behavior-validation/policies/{policyId}: - $ref: paths/api_v1_data-hub_behavior-validation_policies_{policyId}.yaml - /api/v1/data-hub/behavior-validation/states/{clientId}: - $ref: paths/api_v1_data-hub_behavior-validation_states_{clientId}.yaml - /api/v1/data-hub/data-validation/policies: - $ref: paths/api_v1_data-hub_data-validation_policies.yaml - /api/v1/data-hub/data-validation/policies/{policyId}: - $ref: paths/api_v1_data-hub_data-validation_policies_{policyId}.yaml - /api/v1/data-hub/fsm: - $ref: paths/api_v1_data-hub_fsm.yaml - /api/v1/data-hub/functions: - $ref: paths/api_v1_data-hub_functions.yaml - /api/v1/data-hub/function-specs: - $ref: paths/api_v1_data-hub_function-specs.yaml - /api/v1/data-hub/schemas: - $ref: paths/api_v1_data-hub_schemas.yaml - /api/v1/data-hub/schemas/{schemaId}: - $ref: paths/api_v1_data-hub_schemas_{schemaId}.yaml - /api/v1/data-hub/scripts: - $ref: paths/api_v1_data-hub_scripts.yaml - /api/v1/data-hub/scripts/{scriptId}: - $ref: paths/api_v1_data-hub_scripts_{scriptId}.yaml diff --git a/ext/openAPI/components/schemas/errors/ApiProblemDetails.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/ApiProblemDetails.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/ApiProblemDetails.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/ApiProblemDetails.yaml diff --git a/ext/openAPI/components/schemas/errors/datahub/AtMostOneFunctionValidationError.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/datahub/AtMostOneFunctionValidationError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/datahub/AtMostOneFunctionValidationError.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/datahub/AtMostOneFunctionValidationError.yaml diff --git a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyAlreadyPresentError.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/datahub/BehaviorPolicyAlreadyPresentError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyAlreadyPresentError.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/datahub/BehaviorPolicyAlreadyPresentError.yaml diff --git a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyCreationFailureError.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/datahub/BehaviorPolicyCreationFailureError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyCreationFailureError.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/datahub/BehaviorPolicyCreationFailureError.yaml diff --git a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyInvalidErrors.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/datahub/BehaviorPolicyInvalidErrors.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyInvalidErrors.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/datahub/BehaviorPolicyInvalidErrors.yaml diff --git a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyNotFoundError.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/datahub/BehaviorPolicyNotFoundError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyNotFoundError.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/datahub/BehaviorPolicyNotFoundError.yaml diff --git a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyRejectedError.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/datahub/BehaviorPolicyRejectedError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyRejectedError.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/datahub/BehaviorPolicyRejectedError.yaml diff --git a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyUpdateFailureError.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/datahub/BehaviorPolicyUpdateFailureError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyUpdateFailureError.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/datahub/BehaviorPolicyUpdateFailureError.yaml diff --git a/ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyValidationError.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/datahub/BehaviorPolicyValidationError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/datahub/BehaviorPolicyValidationError.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/datahub/BehaviorPolicyValidationError.yaml diff --git a/ext/openAPI/components/schemas/errors/datahub/ClientDisconnectedError.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/datahub/ClientDisconnectedError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/datahub/ClientDisconnectedError.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/datahub/ClientDisconnectedError.yaml diff --git a/ext/openAPI/components/schemas/errors/datahub/ClientNotFoundError.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/datahub/ClientNotFoundError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/datahub/ClientNotFoundError.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/datahub/ClientNotFoundError.yaml diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyAlreadyPresentError.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/datahub/DataPolicyAlreadyPresentError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/datahub/DataPolicyAlreadyPresentError.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/datahub/DataPolicyAlreadyPresentError.yaml diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyCreationFailureError.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/datahub/DataPolicyCreationFailureError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/datahub/DataPolicyCreationFailureError.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/datahub/DataPolicyCreationFailureError.yaml diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyInvalidErrors.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/datahub/DataPolicyInvalidErrors.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/datahub/DataPolicyInvalidErrors.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/datahub/DataPolicyInvalidErrors.yaml diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyNotFoundError.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/datahub/DataPolicyNotFoundError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/datahub/DataPolicyNotFoundError.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/datahub/DataPolicyNotFoundError.yaml diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyRejectedError.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/datahub/DataPolicyRejectedError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/datahub/DataPolicyRejectedError.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/datahub/DataPolicyRejectedError.yaml diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyUpdateFailureError.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/datahub/DataPolicyUpdateFailureError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/datahub/DataPolicyUpdateFailureError.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/datahub/DataPolicyUpdateFailureError.yaml diff --git a/ext/openAPI/components/schemas/errors/datahub/DataPolicyValidationError.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/datahub/DataPolicyValidationError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/datahub/DataPolicyValidationError.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/datahub/DataPolicyValidationError.yaml diff --git a/ext/openAPI/components/schemas/errors/datahub/FunctionMustBePairedValidationError.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/datahub/FunctionMustBePairedValidationError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/datahub/FunctionMustBePairedValidationError.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/datahub/FunctionMustBePairedValidationError.yaml diff --git a/ext/openAPI/components/schemas/errors/datahub/IllegalEventTransitionValidationError.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/datahub/IllegalEventTransitionValidationError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/datahub/IllegalEventTransitionValidationError.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/datahub/IllegalEventTransitionValidationError.yaml diff --git a/ext/openAPI/components/schemas/errors/datahub/IllegalFunctionValidationError.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/datahub/IllegalFunctionValidationError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/datahub/IllegalFunctionValidationError.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/datahub/IllegalFunctionValidationError.yaml diff --git a/ext/openAPI/components/schemas/errors/datahub/InvalidFunctionOrderValidationError.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/datahub/InvalidFunctionOrderValidationError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/datahub/InvalidFunctionOrderValidationError.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/datahub/InvalidFunctionOrderValidationError.yaml diff --git a/ext/openAPI/components/schemas/errors/datahub/InvalidSchemaVersionValidationError.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/datahub/InvalidSchemaVersionValidationError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/datahub/InvalidSchemaVersionValidationError.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/datahub/InvalidSchemaVersionValidationError.yaml diff --git a/ext/openAPI/components/schemas/errors/datahub/PolicyIdMismatchError.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/datahub/PolicyIdMismatchError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/datahub/PolicyIdMismatchError.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/datahub/PolicyIdMismatchError.yaml diff --git a/ext/openAPI/components/schemas/errors/datahub/PolicyInsufficientStorageError.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/datahub/PolicyInsufficientStorageError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/datahub/PolicyInsufficientStorageError.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/datahub/PolicyInsufficientStorageError.yaml diff --git a/ext/openAPI/components/schemas/errors/datahub/PolicyNotFoundError.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/datahub/PolicyNotFoundError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/datahub/PolicyNotFoundError.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/datahub/PolicyNotFoundError.yaml diff --git a/ext/openAPI/components/schemas/errors/datahub/SchemaAlreadyPresentError.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/datahub/SchemaAlreadyPresentError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/datahub/SchemaAlreadyPresentError.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/datahub/SchemaAlreadyPresentError.yaml diff --git a/ext/openAPI/components/schemas/errors/datahub/SchemaEtagMismatchError.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/datahub/SchemaEtagMismatchError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/datahub/SchemaEtagMismatchError.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/datahub/SchemaEtagMismatchError.yaml diff --git a/ext/openAPI/components/schemas/errors/datahub/SchemaInsufficientStorageError.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/datahub/SchemaInsufficientStorageError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/datahub/SchemaInsufficientStorageError.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/datahub/SchemaInsufficientStorageError.yaml diff --git a/ext/openAPI/components/schemas/errors/datahub/SchemaInvalidErrors.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/datahub/SchemaInvalidErrors.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/datahub/SchemaInvalidErrors.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/datahub/SchemaInvalidErrors.yaml diff --git a/ext/openAPI/components/schemas/errors/datahub/SchemaNotFoundError.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/datahub/SchemaNotFoundError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/datahub/SchemaNotFoundError.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/datahub/SchemaNotFoundError.yaml diff --git a/ext/openAPI/components/schemas/errors/datahub/SchemaParsingFailureError.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/datahub/SchemaParsingFailureError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/datahub/SchemaParsingFailureError.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/datahub/SchemaParsingFailureError.yaml diff --git a/ext/openAPI/components/schemas/errors/datahub/SchemaReferencedError.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/datahub/SchemaReferencedError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/datahub/SchemaReferencedError.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/datahub/SchemaReferencedError.yaml diff --git a/ext/openAPI/components/schemas/errors/datahub/SchemaValidationError.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/datahub/SchemaValidationError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/datahub/SchemaValidationError.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/datahub/SchemaValidationError.yaml diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptAlreadyPresentError.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/datahub/ScriptAlreadyPresentError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/datahub/ScriptAlreadyPresentError.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/datahub/ScriptAlreadyPresentError.yaml diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptCreationFailureError.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/datahub/ScriptCreationFailureError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/datahub/ScriptCreationFailureError.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/datahub/ScriptCreationFailureError.yaml diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptEtagMismatchError.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/datahub/ScriptEtagMismatchError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/datahub/ScriptEtagMismatchError.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/datahub/ScriptEtagMismatchError.yaml diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptInsufficientStorageError.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/datahub/ScriptInsufficientStorageError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/datahub/ScriptInsufficientStorageError.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/datahub/ScriptInsufficientStorageError.yaml diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptInvalidErrors.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/datahub/ScriptInvalidErrors.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/datahub/ScriptInvalidErrors.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/datahub/ScriptInvalidErrors.yaml diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptNotFoundError.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/datahub/ScriptNotFoundError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/datahub/ScriptNotFoundError.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/datahub/ScriptNotFoundError.yaml diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptParsingFailureError.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/datahub/ScriptParsingFailureError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/datahub/ScriptParsingFailureError.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/datahub/ScriptParsingFailureError.yaml diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptReferencedError.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/datahub/ScriptReferencedError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/datahub/ScriptReferencedError.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/datahub/ScriptReferencedError.yaml diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptSanitationFailureError.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/datahub/ScriptSanitationFailureError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/datahub/ScriptSanitationFailureError.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/datahub/ScriptSanitationFailureError.yaml diff --git a/ext/openAPI/components/schemas/errors/datahub/ScriptValidationError.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/datahub/ScriptValidationError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/datahub/ScriptValidationError.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/datahub/ScriptValidationError.yaml diff --git a/ext/openAPI/components/schemas/errors/datahub/TopicFilterMismatchError.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/datahub/TopicFilterMismatchError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/datahub/TopicFilterMismatchError.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/datahub/TopicFilterMismatchError.yaml diff --git a/ext/openAPI/components/schemas/errors/datahub/UnknownVariableValidationError.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/datahub/UnknownVariableValidationError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/datahub/UnknownVariableValidationError.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/datahub/UnknownVariableValidationError.yaml diff --git a/ext/openAPI/components/schemas/errors/http/InsufficientStorageError.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/http/InsufficientStorageError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/http/InsufficientStorageError.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/http/InsufficientStorageError.yaml diff --git a/ext/openAPI/components/schemas/errors/http/InternalServerError.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/http/InternalServerError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/http/InternalServerError.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/http/InternalServerError.yaml diff --git a/ext/openAPI/components/schemas/errors/http/InvalidQueryParameterError.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/http/InvalidQueryParameterError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/http/InvalidQueryParameterError.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/http/InvalidQueryParameterError.yaml diff --git a/ext/openAPI/components/schemas/errors/http/PreconditionFailedError.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/http/PreconditionFailedError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/http/PreconditionFailedError.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/http/PreconditionFailedError.yaml diff --git a/ext/openAPI/components/schemas/errors/http/RequestBodyMissingError.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/http/RequestBodyMissingError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/http/RequestBodyMissingError.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/http/RequestBodyMissingError.yaml diff --git a/ext/openAPI/components/schemas/errors/http/RequestBodyParameterMissingError.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/http/RequestBodyParameterMissingError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/http/RequestBodyParameterMissingError.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/http/RequestBodyParameterMissingError.yaml diff --git a/ext/openAPI/components/schemas/errors/http/TemporaryNotAvailableError.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/http/TemporaryNotAvailableError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/http/TemporaryNotAvailableError.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/http/TemporaryNotAvailableError.yaml diff --git a/ext/openAPI/components/schemas/errors/http/UrlParameterMissingError.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/http/UrlParameterMissingError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/http/UrlParameterMissingError.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/http/UrlParameterMissingError.yaml diff --git a/ext/openAPI/components/schemas/errors/validation/AtLeastOneFieldMissingValidationError.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/validation/AtLeastOneFieldMissingValidationError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/validation/AtLeastOneFieldMissingValidationError.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/validation/AtLeastOneFieldMissingValidationError.yaml diff --git a/ext/openAPI/components/schemas/errors/validation/EmptyFieldValidationError.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/validation/EmptyFieldValidationError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/validation/EmptyFieldValidationError.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/validation/EmptyFieldValidationError.yaml diff --git a/ext/openAPI/components/schemas/errors/validation/InvalidFieldLengthValidationError.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/validation/InvalidFieldLengthValidationError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/validation/InvalidFieldLengthValidationError.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/validation/InvalidFieldLengthValidationError.yaml diff --git a/ext/openAPI/components/schemas/errors/validation/InvalidFieldValueValidationError.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/validation/InvalidFieldValueValidationError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/validation/InvalidFieldValueValidationError.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/validation/InvalidFieldValueValidationError.yaml diff --git a/ext/openAPI/components/schemas/errors/validation/InvalidIdentifierValidationError.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/validation/InvalidIdentifierValidationError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/validation/InvalidIdentifierValidationError.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/validation/InvalidIdentifierValidationError.yaml diff --git a/ext/openAPI/components/schemas/errors/validation/MissingFieldValidationError.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/validation/MissingFieldValidationError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/validation/MissingFieldValidationError.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/validation/MissingFieldValidationError.yaml diff --git a/ext/openAPI/components/schemas/errors/validation/UnsupportedFieldValidationError.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/validation/UnsupportedFieldValidationError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/validation/UnsupportedFieldValidationError.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/validation/UnsupportedFieldValidationError.yaml diff --git a/ext/openAPI/components/schemas/errors/validation/ValidationError.yaml b/hivemq-edge-openapi/openapi/components/schemas/errors/validation/ValidationError.yaml similarity index 100% rename from ext/openAPI/components/schemas/errors/validation/ValidationError.yaml rename to hivemq-edge-openapi/openapi/components/schemas/errors/validation/ValidationError.yaml diff --git a/ext/openAPI/templates/Java/README.md b/hivemq-edge-openapi/openapi/templates/Java/README.md similarity index 100% rename from ext/openAPI/templates/Java/README.md rename to hivemq-edge-openapi/openapi/templates/Java/README.md diff --git a/ext/openAPI/templates/Java/typeInfoAnnotation.mustache b/hivemq-edge-openapi/openapi/templates/Java/typeInfoAnnotation.mustache similarity index 100% rename from ext/openAPI/templates/Java/typeInfoAnnotation.mustache rename to hivemq-edge-openapi/openapi/templates/Java/typeInfoAnnotation.mustache diff --git a/hivemq-edge/build.gradle.kts b/hivemq-edge/build.gradle.kts index 1d85c68473..dc885701f4 100644 --- a/hivemq-edge/build.gradle.kts +++ b/hivemq-edge/build.gradle.kts @@ -300,7 +300,7 @@ val buildDirectory = layout.buildDirectory.get() tasks.register("genJaxRs") { inputSpec.set("${projectDir}/../ext/hivemq-edge-openapi-${project.version}.yaml") outputDir.set("${buildDirectory}/generated/openapi") - templateDir.set("$projectDir/../ext/openAPI/templates/Java") + templateDir.set("$projectDir/../hivemq-edge-openapi/openapi/templates/Java") generatorName.set("jaxrs-spec") apiPackage.set("com.hivemq.edge.api") modelPackage.set("com.hivemq.edge.api.model") From 57308465bfaa5afb6ad84a8bb1a0c9b016f47087 Mon Sep 17 00:00:00 2001 From: Nicolas Van Labeke Date: Fri, 17 Oct 2025 14:41:55 +0100 Subject: [PATCH 116/121] [frontend] enable problem+json in the request headers of the HTTP client --- .../src/api/hooks/useHttpClient/useHttpClient.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hivemq-edge-frontend/src/api/hooks/useHttpClient/useHttpClient.ts b/hivemq-edge-frontend/src/api/hooks/useHttpClient/useHttpClient.ts index 1c8ba9ee62..4efbc8f074 100644 --- a/hivemq-edge-frontend/src/api/hooks/useHttpClient/useHttpClient.ts +++ b/hivemq-edge-frontend/src/api/hooks/useHttpClient/useHttpClient.ts @@ -63,6 +63,9 @@ export const useHttpClient = () => { { BASE: config.apiBaseUrl, TOKEN: credentials?.token, + HEADERS: { + Accept: 'application/json, application/problem+json', + }, }, AxiosHttpRequestWithInterceptors ) From a54229409df9e0d4ed69382483cdef52a71a5a5a Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Tue, 28 Oct 2025 10:10:03 +0100 Subject: [PATCH 117/121] refactor: Update openapi spec --- ext/hivemq-edge-openapi-2025.18.yaml | 1996 +++++++++++++++++++--- hivemq-edge-openapi/openapi/openapi.yaml | 2 +- 2 files changed, 1755 insertions(+), 243 deletions(-) diff --git a/ext/hivemq-edge-openapi-2025.18.yaml b/ext/hivemq-edge-openapi-2025.18.yaml index 9d636c5ba9..2665dc19b5 100644 --- a/ext/hivemq-edge-openapi-2025.18.yaml +++ b/ext/hivemq-edge-openapi-2025.18.yaml @@ -94,6 +94,9 @@ tags: These endpoints can be used to retrieve states of clients for the Data Hub. name: Data Hub - State + - description: | + These endpoints can be used to retrieve the different elements of the Edge topology + name: Domain - description: | These endpoints can be used to manage Pulse and its assets. name: Pulse @@ -357,12 +360,23 @@ paths: schema: $ref: '#/components/schemas/BehaviorPolicyList' description: Success + '400': + content: + application/problem+json: + schema: + oneOf: + - $ref: '#/components/schemas/InvalidQueryParameterError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' + description: URL parameter missing '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporarily not available + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Get all policies tags: - Data Hub - Behavior Policies @@ -447,34 +461,45 @@ paths: description: Success '400': content: - application/json: - schema: - $ref: '#/components/schemas/ProblemDetails' + application/problem+json: + schema: + oneOf: + - $ref: '#/components/schemas/BehaviorPolicyCreationFailureError' + - $ref: '#/components/schemas/BehaviorPolicyInvalidErrors' + - $ref: '#/components/schemas/BehaviorPolicyRejectedError' + - $ref: '#/components/schemas/RequestBodyMissingError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError: '#/components/schemas/BehaviorPolicyCreationFailureError' + https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors: '#/components/schemas/BehaviorPolicyInvalidErrors' + https://hivemq.com/edge/api/model/BehaviorPolicyRejectedError: '#/components/schemas/BehaviorPolicyRejectedError' + https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' description: Policy creation failed '409': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Already exists + $ref: '#/components/schemas/BehaviorPolicyAlreadyPresentError' + description: Behavior policy already present '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Internal error + $ref: '#/components/schemas/InternalServerError' + description: Internal server error '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporarily unavailable + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable '507': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Insufficient storage error + $ref: '#/components/schemas/PolicyInsufficientStorageError' + description: Insufficient storage summary: Create a new policy tags: - Data Hub - Behavior Policies @@ -504,34 +529,39 @@ paths: description: Success, no response body '400': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Policy not found + $ref: '#/components/schemas/PolicyNotFoundError' + description: Behavior policy not found '412': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/PreconditionFailedError' description: Precondition failed '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Internal error + $ref: '#/components/schemas/InternalServerError' + description: Internal server error '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporarily not available + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Delete a behavior policy tags: - Data Hub - Behavior Policies @@ -599,16 +629,33 @@ paths: description: Success '400': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Invalid query parameter + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + description: Bad request '404': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/BehaviorPolicyNotFoundError' description: Policy not found + '500': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/InternalServerError' + description: Internal server error + '503': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Get a policy tags: - Data Hub - Behavior Policies @@ -709,41 +756,56 @@ paths: description: Success '400': content: - application/json: - schema: - $ref: '#/components/schemas/ProblemDetails' - description: Policy creation failed + application/problem+json: + schema: + oneOf: + - $ref: '#/components/schemas/RequestBodyMissingError' + - $ref: '#/components/schemas/UrlParameterMissingError' + - $ref: '#/components/schemas/BehaviorPolicyCreationFailureError' + - $ref: '#/components/schemas/BehaviorPolicyInvalidErrors' + - $ref: '#/components/schemas/BehaviorPolicyUpdateFailureError' + - $ref: '#/components/schemas/PolicyIdMismatchError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError: '#/components/schemas/BehaviorPolicyCreationFailureError' + https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors: '#/components/schemas/BehaviorPolicyInvalidErrors' + https://hivemq.com/edge/api/model/BehaviorPolicyUpdateFailureError: '#/components/schemas/BehaviorPolicyUpdateFailureError' + https://hivemq.com/edge/api/model/PolicyIdMismatchError: '#/components/schemas/PolicyIdMismatchError' + description: Behavior policy creation failed '404': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Policy not found + $ref: '#/components/schemas/BehaviorPolicyNotFoundError' + description: Data policy not found '412': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/PreconditionFailedError' description: Precondition failed '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Internal error + $ref: '#/components/schemas/InternalServerError' + description: Internal server error '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporarily unavailable + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable '507': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Insufficient storage error - summary: Update an existing policy + $ref: '#/components/schemas/PolicyInsufficientStorageError' + description: Insufficient storage + summary: Update an existing behavior policy tags: - Data Hub - Behavior Policies /api/v1/data-hub/behavior-validation/states/{clientId}: @@ -787,22 +849,34 @@ paths: description: Success '400': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' description: URL parameter missing '404': content: - application/json: - schema: - $ref: '#/components/schemas/ProblemDetails' - description: Client is disconnected + application/problem+json: + schema: + oneOf: + - $ref: '#/components/schemas/ClientDisconnectedError' + - $ref: '#/components/schemas/ClientNotFoundError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/ClientDisconnectedError: '#/components/schemas/ClientDisconnectedError' + https://hivemq.com/edge/api/model/ClientNotFoundError: '#/components/schemas/ClientNotFoundError' + description: Client error '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Internal Server error + $ref: '#/components/schemas/InternalServerError' + description: Internal server error summary: Get the state of a client tags: - Data Hub - State @@ -1051,27 +1125,20 @@ paths: description: Success '400': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + oneOf: + - $ref: '#/components/schemas/InvalidQueryParameterError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' description: URL parameter missing - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/ProblemDetails' - description: DataPolicy not found - '500': - content: - application/json: - schema: - $ref: '#/components/schemas/ProblemDetails' - description: Internal server error '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable summary: Get all data policies tags: @@ -1155,33 +1222,44 @@ paths: description: Success '400': content: - application/json: - schema: - $ref: '#/components/schemas/ProblemDetails' - description: DataPolicy creation failed + application/problem+json: + schema: + oneOf: + - $ref: '#/components/schemas/RequestBodyMissingError' + - $ref: '#/components/schemas/DataPolicyCreationFailureError' + - $ref: '#/components/schemas/DataPolicyInvalidErrors' + - $ref: '#/components/schemas/DataPolicyRejectedError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' + https://hivemq.com/edge/api/model/DataPolicyCreationFailureError: '#/components/schemas/DataPolicyCreationFailureError' + https://hivemq.com/edge/api/model/DataPolicyInvalidErrors: '#/components/schemas/DataPolicyInvalidErrors' + https://hivemq.com/edge/api/model/DataPolicyRejectedError: '#/components/schemas/DataPolicyRejectedError' + description: Data policy creation failed '409': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: DataPolicy already present + $ref: '#/components/schemas/DataPolicyAlreadyPresentError' + description: Data policy already present '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable '507': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/PolicyInsufficientStorageError' description: Insufficient storage summary: Create a new data policy tags: @@ -1212,27 +1290,38 @@ paths: description: Success, no response body '400': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: DataPolicy not found + $ref: '#/components/schemas/PolicyNotFoundError' + description: Data policy not found + '412': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/PreconditionFailedError' + description: Precondition failed '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable summary: Delete a data policy tags: @@ -1300,32 +1389,33 @@ paths: description: Success '400': content: - application/json: - examples: - param-missing: - description: Example response when a required parameter is missing. - summary: Required URL parameter missing - value: - errors: - - title: Required parameter missing - detail: Required URL parameter 'parameterName' is missing + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' description: Bad request '404': content: - application/json: - examples: - not-found: - description: Policy not found - summary: Not found - value: - errors: - - title: Resource not found - detail: Resource with id 'my-resource-id' not found + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/PolicyNotFoundError' description: Resource not found + '500': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/InternalServerError' + description: Internal server error + '503': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Get a data policy tags: - Data Hub - Data Policies @@ -1425,33 +1515,56 @@ paths: description: Success '400': content: - application/json: - schema: - $ref: '#/components/schemas/ProblemDetails' - description: DataPolicy creation failed + application/problem+json: + schema: + oneOf: + - $ref: '#/components/schemas/RequestBodyMissingError' + - $ref: '#/components/schemas/UrlParameterMissingError' + - $ref: '#/components/schemas/DataPolicyCreationFailureError' + - $ref: '#/components/schemas/DataPolicyInvalidErrors' + - $ref: '#/components/schemas/DataPolicyUpdateFailureError' + - $ref: '#/components/schemas/PolicyIdMismatchError' + - $ref: '#/components/schemas/TopicFilterMismatchError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + https://hivemq.com/edge/api/model/DataPolicyCreationFailureError: '#/components/schemas/DataPolicyCreationFailureError' + https://hivemq.com/edge/api/model/DataPolicyInvalidErrors: '#/components/schemas/DataPolicyInvalidErrors' + https://hivemq.com/edge/api/model/DataPolicyUpdateFailureError: '#/components/schemas/DataPolicyUpdateFailureError' + https://hivemq.com/edge/api/model/PolicyIdMismatchError: '#/components/schemas/PolicyIdMismatchError' + https://hivemq.com/edge/api/model/TopicFilterMismatchError: '#/components/schemas/TopicFilterMismatchError' + description: Data policy creation failed '404': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: DataPolicy not found + $ref: '#/components/schemas/DataPolicyNotFoundError' + description: Data policy not found + '412': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/PreconditionFailedError' + description: Precondition failed '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable '507': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/PolicyInsufficientStorageError' description: Insufficient storage summary: Update an existing data policy tags: @@ -1537,9 +1650,9 @@ paths: description: Success '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/Errors' + $ref: '#/components/schemas/InternalServerError' description: Internal server error summary: Get all FSMs as a JSON Schema tags: @@ -1699,9 +1812,9 @@ paths: description: Success '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error summary: Get all functions as a JSON Schema tags: @@ -1719,9 +1832,9 @@ paths: description: Success '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error summary: Get all interpolation variables tags: @@ -1739,9 +1852,9 @@ paths: description: Success '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error summary: Get all functions as a list of function specifications tags: @@ -1876,11 +1989,22 @@ paths: schema: $ref: '#/components/schemas/SchemaList' description: Success + '400': + content: + application/problem+json: + schema: + oneOf: + - $ref: '#/components/schemas/InvalidQueryParameterError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' + description: URL parameter missing '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable summary: Get all schemas tags: @@ -1927,33 +2051,48 @@ paths: description: Success '400': content: - application/json: - schema: - $ref: '#/components/schemas/ProblemDetails' - description: Schema could not be validatetd + application/problem+json: + schema: + oneOf: + - $ref: '#/components/schemas/RequestBodyParameterMissingError' + - $ref: '#/components/schemas/SchemaInvalidErrors' + - $ref: '#/components/schemas/SchemaParsingFailureError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/RequestBodyParameterMissingError: '#/components/schemas/RequestBodyParameterMissingError' + https://hivemq.com/edge/api/model/SchemaInvalidErrors: '#/components/schemas/SchemaInvalidErrors' + https://hivemq.com/edge/api/model/SchemaParsingFailureError: '#/components/schemas/SchemaParsingFailureError' + description: Schema creation failed '409': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Schema already exists + $ref: '#/components/schemas/SchemaAlreadyPresentError' + description: Schema is already present '412': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Mismatch between schema and etag + $ref: '#/components/schemas/SchemaEtagMismatchError' + description: Schema doesn't match etag '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error + '503': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable '507': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/SchemaInsufficientStorageError' description: Insufficient storage summary: Create a new schema tags: @@ -1984,33 +2123,40 @@ paths: description: Success, no response body '400': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Schema referenced + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + - $ref: '#/components/schemas/SchemaReferencedError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + https://hivemq.com/edge/api/model/SchemaReferencedError: '#/components/schemas/SchemaReferencedError' + description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/SchemaNotFoundError' description: Schema not found '412': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Mismatch between schema and etag + $ref: '#/components/schemas/SchemaEtagMismatchError' + description: Schema doesn't match etag '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Internal server error + $ref: '#/components/schemas/InternalServerError' + description: Internal Server error '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable summary: Delete all versions of the schema tags: @@ -2056,22 +2202,33 @@ paths: description: Success '400': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: A url parameter is missing + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/SchemaNotFoundError' description: Schema not found '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error + '503': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Get a schema tags: - Data Hub - Schemas @@ -2192,12 +2349,23 @@ paths: schema: $ref: '#/components/schemas/ScriptList' description: Success + '400': + content: + application/problem+json: + schema: + oneOf: + - $ref: '#/components/schemas/InvalidQueryParameterError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' + description: URL parameter missing '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporary not available + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Get all scripts tags: - Data Hub - Scripts @@ -2243,39 +2411,52 @@ paths: description: Success '400': content: - application/json: - schema: - $ref: '#/components/schemas/ProblemDetails' - description: Script is invalid + application/problem+json: + schema: + oneOf: + - $ref: '#/components/schemas/RequestBodyParameterMissingError' + - $ref: '#/components/schemas/ScriptCreationFailureError' + - $ref: '#/components/schemas/ScriptInvalidErrors' + - $ref: '#/components/schemas/ScriptParsingFailureError' + - $ref: '#/components/schemas/ScriptSanitationFailureError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/RequestBodyParameterMissingError: '#/components/schemas/RequestBodyParameterMissingError' + https://hivemq.com/edge/api/model/ScriptCreationFailureError: '#/components/schemas/ScriptCreationFailureError' + https://hivemq.com/edge/api/model/ScriptInvalidErrors: '#/components/schemas/ScriptInvalidErrors' + https://hivemq.com/edge/api/model/ScriptParsingFailureError: '#/components/schemas/ScriptParsingFailureError' + https://hivemq.com/edge/api/model/ScriptSanitationFailureError: '#/components/schemas/ScriptSanitationFailureError' + description: Script creation failed '409': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/ScriptAlreadyPresentError' description: Script is already present '412': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/ScriptEtagMismatchError' description: Script doesn't match etag '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporary not available + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable '507': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/ScriptInsufficientStorageError' description: Insufficient storage summary: Create a new script tags: @@ -2303,34 +2484,41 @@ paths: description: Success, no response body '400': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Script is referenced + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + - $ref: '#/components/schemas/ScriptReferencedError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + https://hivemq.com/edge/api/model/ScriptReferencedError: '#/components/schemas/ScriptReferencedError' + description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/ScriptNotFoundError' description: Script not found '412': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/ScriptEtagMismatchError' description: Script doesn't match etag '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal Server error '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporary not available + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Delete a script tags: - Data Hub - Scripts @@ -2371,28 +2559,33 @@ paths: description: Success '400': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/ScriptNotFoundError' description: Script not found '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal Server error '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporary not available + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Get a script tags: - Data Hub - Scripts @@ -3697,7 +3890,7 @@ paths: summary: Add a new Adapter tags: - Protocol Adapters - /api/v1/management/protocol-adapters/northboundMappings: + /api/v1/management/protocol-adapters/mappings/northboundMappings: get: description: Get all northbound mappings operationId: get-northboundMappings @@ -3706,12 +3899,13 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/NorthboundMappingList' + $ref: '#/components/schemas/NorthboundMappingOwnerList' description: Success - summary: Get the mappings for northbound messages. + summary: Get all the northbound mappings. tags: - Protocol Adapters - /api/v1/management/protocol-adapters/southboundMappings: + - Domain + /api/v1/management/protocol-adapters/mappings/southboundMappings: get: description: Get all southbound mappings. operationId: get-southboundMappings @@ -3720,11 +3914,12 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/SouthboundMappingList' + $ref: '#/components/schemas/SouthboundMappingOwnerList' description: Success - summary: Get all southbound mappings. + summary: Get all the southbound mappings. tags: - Protocol Adapters + - Domain /api/v1/management/protocol-adapters/status: get: description: Obtain the details. @@ -3796,11 +3991,12 @@ paths: node: ns=2;i=test2 name: tag2 schema: - $ref: '#/components/schemas/DomainTagList' + $ref: '#/components/schemas/DomainTagOwnerList' description: Success - summary: Get the list of all domain tags created in this Edge instance + summary: Get the list of all tags created in this Edge instance tags: - Protocol Adapters + - Domain /api/v1/management/protocol-adapters/tags/{tagName}: get: description: Get a domain tag created in this Edge instance @@ -4060,6 +4256,7 @@ paths: summary: Get the list of all topic filters created in this Edge instance tags: - Topic Filters + - Domain post: description: Add a new topic filter. operationId: add-topicFilters @@ -4583,6 +4780,7 @@ paths: operationId: get-managed-assets tags: - Pulse + - Domain responses: '200': content: @@ -4916,6 +5114,7 @@ components: detail: type: string errors: + deprecated: true type: array items: $ref: '#/components/schemas/Error' @@ -5080,20 +5279,1278 @@ components: description: List of result items that are returned by this endpoint items: $ref: '#/components/schemas/BehaviorPolicy' - JsonNode: - type: object - description: The arguments of the fsm derived from the behavior policy. - FsmStateInformationItem: - type: object - description: List of result items that are returned by this endpoint - properties: - arguments: - $ref: '#/components/schemas/JsonNode' - behaviorId: - type: string - description: The unique identifier of the policy. - firstSetAt: - type: string + ApiProblemDetails: + allOf: + - $ref: '#/components/schemas/ProblemDetails' + - type: object + required: + - detail + - status + - type + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/BehaviorPolicyAlreadyPresentError: '#/components/schemas/BehaviorPolicyAlreadyPresentError' + https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError: '#/components/schemas/BehaviorPolicyCreationFailureError' + https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors: '#/components/schemas/BehaviorPolicyInvalidErrors' + https://hivemq.com/edge/api/model/BehaviorPolicyNotFoundError: '#/components/schemas/BehaviorPolicyNotFoundError' + https://hivemq.com/edge/api/model/BehaviorPolicyRejectedError: '#/components/schemas/BehaviorPolicyRejectedError' + https://hivemq.com/edge/api/model/BehaviorPolicyUpdateFailureError: '#/components/schemas/BehaviorPolicyUpdateFailureError' + https://hivemq.com/edge/api/model/ClientDisconnectedError: '#/components/schemas/ClientDisconnectedError' + https://hivemq.com/edge/api/model/ClientNotFoundError: '#/components/schemas/ClientNotFoundError' + https://hivemq.com/edge/api/model/DataPolicyAlreadyPresentError: '#/components/schemas/DataPolicyAlreadyPresentError' + https://hivemq.com/edge/api/model/DataPolicyCreationFailureError: '#/components/schemas/DataPolicyCreationFailureError' + https://hivemq.com/edge/api/model/DataPolicyInvalidErrors: '#/components/schemas/DataPolicyInvalidErrors' + https://hivemq.com/edge/api/model/DataPolicyNotFoundError: '#/components/schemas/DataPolicyNotFoundError' + https://hivemq.com/edge/api/model/DataPolicyRejectedError: '#/components/schemas/DataPolicyRejectedError' + https://hivemq.com/edge/api/model/DataPolicyUpdateFailureError: '#/components/schemas/DataPolicyUpdateFailureError' + https://hivemq.com/edge/api/model/PolicyIdMismatchError: '#/components/schemas/PolicyIdMismatchError' + https://hivemq.com/edge/api/model/PolicyInsufficientStorageError: '#/components/schemas/PolicyInsufficientStorageError' + https://hivemq.com/edge/api/model/PolicyNotFoundError: '#/components/schemas/PolicyNotFoundError' + https://hivemq.com/edge/api/model/SchemaAlreadyPresentError: '#/components/schemas/SchemaAlreadyPresentError' + https://hivemq.com/edge/api/model/SchemaEtagMismatchError: '#/components/schemas/SchemaEtagMismatchError' + https://hivemq.com/edge/api/model/SchemaInsufficientStorageError: '#/components/schemas/SchemaInsufficientStorageError' + https://hivemq.com/edge/api/model/SchemaInvalidErrors: '#/components/schemas/SchemaInvalidErrors' + https://hivemq.com/edge/api/model/SchemaNotFoundError: '#/components/schemas/SchemaNotFoundError' + https://hivemq.com/edge/api/model/SchemaParsingFailureError: '#/components/schemas/SchemaParsingFailureError' + https://hivemq.com/edge/api/model/SchemaReferencedError: '#/components/schemas/SchemaReferencedError' + https://hivemq.com/edge/api/model/ScriptAlreadyPresentError: '#/components/schemas/ScriptAlreadyPresentError' + https://hivemq.com/edge/api/model/ScriptCreationFailureError: '#/components/schemas/ScriptCreationFailureError' + https://hivemq.com/edge/api/model/ScriptEtagMismatchError: '#/components/schemas/ScriptEtagMismatchError' + https://hivemq.com/edge/api/model/ScriptInsufficientStorageError: '#/components/schemas/ScriptInsufficientStorageError' + https://hivemq.com/edge/api/model/ScriptInvalidErrors: '#/components/schemas/ScriptInvalidErrors' + https://hivemq.com/edge/api/model/ScriptNotFoundError: '#/components/schemas/ScriptNotFoundError' + https://hivemq.com/edge/api/model/ScriptParsingFailureError: '#/components/schemas/ScriptParsingFailureError' + https://hivemq.com/edge/api/model/ScriptReferencedError: '#/components/schemas/ScriptReferencedError' + https://hivemq.com/edge/api/model/ScriptSanitationFailureError: '#/components/schemas/ScriptSanitationFailureError' + https://hivemq.com/edge/api/model/TopicFilterMismatchError: '#/components/schemas/TopicFilterMismatchError' + https://hivemq.com/edge/api/model/InsufficientStorageError: '#/components/schemas/InsufficientStorageError' + https://hivemq.com/edge/api/model/InternalServerError: '#/components/schemas/InternalServerError' + https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' + https://hivemq.com/edge/api/model/PreconditionFailedError: '#/components/schemas/PreconditionFailedError' + https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' + https://hivemq.com/edge/api/model/RequestBodyParameterMissingError: '#/components/schemas/RequestBodyParameterMissingError' + https://hivemq.com/edge/api/model/TemporaryNotAvailableError: '#/components/schemas/TemporaryNotAvailableError' + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + BehaviorPolicyAlreadyPresentError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The behavior policy id. + example: abc + required: + - id + example: + general: + status: 409 + title: Behavior Policy Already Present + detail: The given behavior policy 'abc' is already present. + id: abc + type: https://hivemq.com/edge/api/model/BehaviorPolicyAlreadyPresentError + BehaviorPolicyCreationFailureError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 400 + title: Behavior Policy Creation Failed + detail: 'Behavior policy creation failed: The policy was rejected.' + type: https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError + AtLeastOneFieldMissingValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + paths: + type: array + description: The missing json paths. + items: + type: string + format: json-path + description: The json path. + example: + - $.field1 + - $.field2 + required: + - paths + example: + general: + detail: 'At least one of the fields must be present: ''$.field1'', ''$.field2''.' + paths: + - $.field1 + - $.field2 + type: https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError + ValidationError: + type: object + properties: + detail: + type: string + description: Detailed contextual description of the validation error. + type: + type: string + format: uri + description: Type of the validation error. + required: + - detail + - type + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError: '#/components/schemas/AtLeastOneFieldMissingValidationError' + https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError: '#/components/schemas/AtMostOneFunctionValidationError' + https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' + https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError: '#/components/schemas/FunctionMustBePairedValidationError' + https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError: '#/components/schemas/IllegalEventTransitionValidationError' + https://hivemq.com/edge/api/model/IllegalFunctionValidationError: '#/components/schemas/IllegalFunctionValidationError' + https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' + https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' + https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError: '#/components/schemas/InvalidFunctionOrderValidationError' + https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' + https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError: '#/components/schemas/InvalidSchemaVersionValidationError' + https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' + https://hivemq.com/edge/api/model/UnknownVariableValidationError: '#/components/schemas/UnknownVariableValidationError' + https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' + AtMostOneFunctionValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + function: + type: string + description: The function. + example: function1 + occurrences: + type: integer + format: int32 + description: The occurrences of the function. + minimum: 0 + example: 3 + paths: + type: array + items: + type: string + format: json-path + description: The json paths where the function occurs. + example: + - $.path1 + - $.path2 + - $.path3 + required: + - function + - occurrences + - paths + example: + general: + detail: The pipeline must contain at most one 'function1' function, but 3 were found at ['$.path1', '$.path2', '$.path3']. + function: function1 + occurrences: 3 + paths: + - $.path1 + - $.path2 + - $.path3 + type: https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError + EmptyFieldValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + path: + type: string + format: json-path + description: The missing field. + example: $.field + required: + - path + example: + general: + detail: Required field '$.field' is empty. + path: $.field + type: https://hivemq.com/edge/api/model/EmptyFieldValidationError + FunctionMustBePairedValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + existingFunction: + type: string + description: The existing function. + example: function1 + missingFunction: + type: string + description: The missing function. + example: function2 + required: + - existingFunction + - missingFunction + example: + general: + detail: If 'function1' function is present in the pipeline, 'function2' function must be present as well. + existingFunction: function1 + missingFunction: function2 + type: https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError + IllegalEventTransitionValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + event: + type: string + description: The event name. + example: event1 + fromState: + type: string + description: The event from state. + example: state1 + id: + type: string + description: The event id. + example: abc + path: + type: string + description: The path. + example: $.event + toState: + type: string + description: The event to state. + example: state2 + required: + - event + - fromState + - id + - path + - toState + example: + general: + detail: The transition from state 'state1' to state 'state2' on event 'event1' in '$.event' is not defined for behavior 'abc'. + event: event1 + fromState: state1 + toState: state2 + id: abc + path: $.event + type: https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError + IllegalFunctionValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + event: + type: string + description: The event name. + example: event1 + id: + type: string + description: The function id. + example: abc + path: + type: string + format: json-path + description: The json path. + example: $.event + required: + - event + - id + - path + example: + general: + detail: The function 'abc' is not allowed for event 'event1' in '$.event'. + event: event1 + id: abc + path: $.event + type: https://hivemq.com/edge/api/model/IllegalFunctionValidationError + InvalidFieldLengthValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + actualLength: + type: integer + format: int32 + description: The actual length of the field value. + example: 10 + expectedMinimumLength: + type: integer + format: int32 + description: The minimum length expected for the field value. + minimum: 0 + example: 5 + expectedMaximumLength: + type: integer + format: int32 + description: The maximum length expected for the field value. + minimum: 0 + example: 20 + path: + type: string + format: json-path + description: The invalid json path. + example: $.field + value: + type: string + description: The invalid value. + example: function transform() { return 'Hello, World!'; } + required: + - actualLength + - expectedMinimumLength + - expectedMaximumLength + - path + - value + example: + general: + detail: The length of script field '$.transform' 48 must be between 0 and 20. + actualLength: 48 + minimumLength: 0 + maximumLength: 20 + path: $.transform + value: function transform() { return 'Hello, World!'; } + type: https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError + InvalidFieldValueValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + path: + type: string + format: json-path + description: The invalid json path. + example: $.action.pipeline[1].field + value: + type: string + description: The invalid value. + example: functionDoesNotExist + required: + - path + example: + general: + detail: Referenced function does not exist. + path: $.action.pipeline[1].field + value: functionDoesNotExist + type: https://hivemq.com/edge/api/model/InvalidFieldValueValidationError + InvalidFunctionOrderValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + function: + type: string + description: The function. + example: transform + path: + type: string + format: json-path + description: The json path. + example: $.path + previousFunction: + type: string + description: The previous function. + example: init + required: + - function + - path + - previousFunction + example: + general: + detail: The operation at '$.path' with the functionId 'transform' must be after a 'init' operation. + function: transform + path: $.path + previousFunction: init + type: https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError + InvalidIdentifierValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + path: + type: string + format: json-path + description: The invalid identifier path. + example: $.id + value: + type: string + description: The invalid identifier value. + example: invalidId + required: + - path + - value + example: + general: + detail: Identifier script 'id' must begin with a letter and may only consist of lowercase letters, uppercase letters, numbers, periods, hyphens, and underscores. + path: $.id + value: invalidId + type: https://hivemq.com/edge/api/model/InvalidIdentifierValidationError + InvalidSchemaVersionValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + id: + type: string + description: The schema id. + example: abc + version: + type: string + description: The schema version. + example: '2' + required: + - id + - version + example: + general: + detail: The referenced schema with id 'abc' and version '2' was not found. + id: abc + version: '2' + type: https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError + MissingFieldValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + path: + type: string + format: json-path + description: The missing path. + example: $.id + required: + - path + example: + general: + detail: Required field '$.id' is missing. + path: $.id + type: https://hivemq.com/edge/api/model/MissingFieldValidationError + UnknownVariableValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + path: + type: string + description: The json path of the field. + example: $.path + variables: + type: array + items: + type: string + description: The unknown variables. + example: + - a + - b + - c + required: + - path + - variables + example: + general: + detail: 'Field ''$.path'' contains unknown variables: [a, b, c].' + path: $.path + variables: + - a + - b + - c + type: https://hivemq.com/edge/api/model/UnknownVariableValidationError + UnsupportedFieldValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + actualValue: + type: string + description: The actual value. + expectedValue: + type: string + description: The expected value. + path: + type: string + format: json-path + description: The json path. + example: $.id + required: + - actualValue + - expectedValue + - path + example: + general: + detail: Unsupported type 'String' for field '$.id'. Expected type is 'Object'. + actualValue: String + expectedValue: Object + path: $.id + type: https://hivemq.com/edge/api/model/UnsupportedFieldValidationError + BehaviorPolicyValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - oneOf: + - $ref: '#/components/schemas/IllegalEventTransitionValidationError' + - $ref: '#/components/schemas/IllegalFunctionValidationError' + - $ref: '#/components/schemas/InvalidSchemaVersionValidationError' + - $ref: '#/components/schemas/AtLeastOneFieldMissingValidationError' + - $ref: '#/components/schemas/EmptyFieldValidationError' + - $ref: '#/components/schemas/InvalidFieldLengthValidationError' + - $ref: '#/components/schemas/InvalidFieldValueValidationError' + - $ref: '#/components/schemas/InvalidIdentifierValidationError' + - $ref: '#/components/schemas/MissingFieldValidationError' + - $ref: '#/components/schemas/UnsupportedFieldValidationError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError: '#/components/schemas/AtLeastOneFieldMissingValidationError' + https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' + https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError: '#/components/schemas/IllegalEventTransitionValidationError' + https://hivemq.com/edge/api/model/IllegalFunctionValidationError: '#/components/schemas/IllegalFunctionValidationError' + https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' + https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' + https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' + https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError: '#/components/schemas/InvalidSchemaVersionValidationError' + https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' + https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' + BehaviorPolicyInvalidErrors: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + childErrors: + type: array + description: List of child validation errors. + items: + $ref: '#/components/schemas/BehaviorPolicyValidationError' + required: + - childErrors + example: + general: + status: 400 + title: Behavior Policy Invalid + detail: Behavior policy is invalid due to validation errors. + type: https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors + childErrors: + - detail: The transition from state 'state1' to state 'state2' on event 'event1' in '$.path' is not defined for behavior 'id1'. + fromState: state1 + toState: state2 + path: $.path + id: id1 + type: https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError + BehaviorPolicyNotFoundError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The data policy id. + example: abc + required: + - id + example: + general: + status: 404 + title: Behavior Policy Not Found + detail: Behavior policy with ID 'abc' is not found. + id: abc + type: https://hivemq.com/edge/api/model/BehaviorPolicyNotFoundError + BehaviorPolicyRejectedError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 400 + title: Behavior Policy Rejected + detail: Behavior policy is rejected. + type: https://hivemq.com/edge/api/model/BehaviorPolicyRejectedError + BehaviorPolicyUpdateFailureError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The ID of the policy that failed to update. + example: abc + required: + - id + example: + general: + status: 400 + title: Behavior Policy Update Failed + detail: Behavior policy with ID 'abc' update failed. + id: abc + type: https://hivemq.com/edge/api/model/BehaviorPolicyUpdateFailureError + ClientDisconnectedError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The client id. + example: abc + required: + - id + example: + general: + status: 404 + title: Client Disconnected + detail: Client with ID 'abc' is disconnected. + id: abc + type: https://hivemq.com/edge/api/model/ClientDisconnectedError + ClientNotFoundError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The client id. + example: abc + required: + - id + example: + general: + status: 404 + title: Client Not Found + detail: Client with ID 'abc' is not found. + id: abc + type: https://hivemq.com/edge/api/model/ClientNotFoundError + DataPolicyAlreadyPresentError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The data policy id. + example: abc + required: + - id + example: + general: + status: 409 + title: Data Policy Already Present + detail: The given data policy 'abc' is already present. + id: abc + type: https://hivemq.com/edge/api/model/DataPolicyAlreadyPresentError + DataPolicyCreationFailureError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 400 + title: Data Policy Creation Failed + detail: 'Data policy creation failed: The policy was rejected.' + type: https://hivemq.com/edge/api/model/DataPolicyCreationFailureError + DataPolicyValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - oneOf: + - $ref: '#/components/schemas/AtMostOneFunctionValidationError' + - $ref: '#/components/schemas/FunctionMustBePairedValidationError' + - $ref: '#/components/schemas/InvalidFunctionOrderValidationError' + - $ref: '#/components/schemas/InvalidSchemaVersionValidationError' + - $ref: '#/components/schemas/UnknownVariableValidationError' + - $ref: '#/components/schemas/EmptyFieldValidationError' + - $ref: '#/components/schemas/InvalidFieldLengthValidationError' + - $ref: '#/components/schemas/InvalidFieldValueValidationError' + - $ref: '#/components/schemas/InvalidIdentifierValidationError' + - $ref: '#/components/schemas/MissingFieldValidationError' + - $ref: '#/components/schemas/UnsupportedFieldValidationError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError: '#/components/schemas/AtMostOneFunctionValidationError' + https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' + https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError: '#/components/schemas/FunctionMustBePairedValidationError' + https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' + https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' + https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError: '#/components/schemas/InvalidFunctionOrderValidationError' + https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' + https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError: '#/components/schemas/InvalidSchemaVersionValidationError' + https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' + https://hivemq.com/edge/api/model/UnknownVariableValidationError: '#/components/schemas/UnknownVariableValidationError' + https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' + DataPolicyInvalidErrors: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + childErrors: + type: array + description: List of child validation errors. + items: + $ref: '#/components/schemas/DataPolicyValidationError' + required: + - childErrors + example: + general: + status: 400 + title: Data Policy Invalid + detail: Data policy is invalid due to validation errors. + type: https://hivemq.com/edge/api/model/DataPolicyInvalidErrors + childErrors: + - detail: The pipeline must contain at most one 'function1' function, but 3 were found at ['$.path1', '$.path2', '$.path3']. + function: function1 + occurrences: 3 + paths: + - $.path1 + - $.path2 + - $.path3 + type: https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError + DataPolicyNotFoundError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The data policy id. + example: abc + required: + - id + example: + general: + status: 404 + title: Data Policy Not Found + detail: Data policy with ID 'abc' is not found. + id: abc + type: https://hivemq.com/edge/api/model/DataPolicyNotFoundError + DataPolicyRejectedError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 400 + title: Data Policy Rejected + detail: Data policy is rejected. + type: https://hivemq.com/edge/api/model/DataPolicyRejectedError + DataPolicyUpdateFailureError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The ID of the policy that failed to update. + example: abc + required: + - id + example: + general: + status: 400 + title: Data Policy Update Failed + detail: Data policy with ID 'abc' update failed. + id: abc + type: https://hivemq.com/edge/api/model/DataPolicyUpdateFailureError + PolicyIdMismatchError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + actualId: + type: string + description: The actual id. + example: id1 + expectedId: + type: string + description: The expected id. + example: id2 + required: + - actualId + - expectedId + example: + general: + status: 400 + title: Policy ID Mismatch + detail: The policy ID 'id1' in the request parameter does not match the policy ID 'id2' in the policy request body. + id: abc + type: https://hivemq.com/edge/api/model/PolicyIdMismatchError + PolicyInsufficientStorageError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The policy id. + example: abc + required: + - id + example: + general: + status: 507 + title: Policy Insufficient Storage + detail: Policy with ID '123' could not be added because of insufficient server storage. + id: abc + type: https://hivemq.com/edge/api/model/PolicyInsufficientStorageError + PolicyNotFoundError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The policy id. + example: abc + required: + - id + example: + general: + status: 404 + title: Policy Not Found + detail: Policy with ID 'abc' is not found. + id: abc + type: https://hivemq.com/edge/api/model/PolicyNotFoundError + SchemaAlreadyPresentError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The schema id. + example: abc + required: + - id + example: + general: + status: 409 + title: Schema Already Present + detail: The given schema is already present as the latest version for the schema id 'abc'. + id: abc + type: https://hivemq.com/edge/api/model/SchemaAlreadyPresentError + SchemaEtagMismatchError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The schema id. + example: abc + eTag: + type: string + description: The eTag. + example: 33a64df551425fcc55e4d42a148795d9f25f89d4 + required: + - id + example: + general: + status: 412 + title: Schema eTag Mismatch + detail: Schema with id 'abc' does not match the given etag '33a64df551425fcc55e4d42a148795d9f25f89d4'. + id: abc + eTag: 33a64df551425fcc55e4d42a148795d9f25f89d4 + type: https://hivemq.com/edge/api/model/SchemaEtagMismatchError + SchemaInsufficientStorageError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The policy id. + example: abc + required: + - id + example: + general: + status: 507 + title: Schema Insufficient Storage + detail: Schema with ID '123' could not be added because of insufficient server storage. + id: abc + type: https://hivemq.com/edge/api/model/SchemaInsufficientStorageError + SchemaValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - oneOf: + - $ref: '#/components/schemas/EmptyFieldValidationError' + - $ref: '#/components/schemas/InvalidFieldLengthValidationError' + - $ref: '#/components/schemas/InvalidFieldValueValidationError' + - $ref: '#/components/schemas/InvalidIdentifierValidationError' + - $ref: '#/components/schemas/MissingFieldValidationError' + - $ref: '#/components/schemas/UnsupportedFieldValidationError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' + https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' + https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' + https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' + https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' + https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' + SchemaInvalidErrors: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + childErrors: + type: array + description: List of child validation errors. + items: + $ref: '#/components/schemas/SchemaValidationError' + required: + - childErrors + example: + general: + status: 400 + title: Schema Invalid + detail: Schema is invalid due to validation errors. + type: https://hivemq.com/edge/api/model/SchemaInvalidErrors + childErrors: + - detail: The length of script field '$.id' 1025 must be between 0 and 1024. + paths: $.id + value: aaa...aaa + actualLength: 1025 + expectedMinimumLength: 0 + expectedMaximumLength: 1024 + type: https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError + SchemaNotFoundError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The schema ID. + example: abc + required: + - id + example: + general: + status: 404 + title: Schema Not Found + detail: Schema with ID 'abc' is not found. + id: abc + type: https://hivemq.com/edge/api/model/SchemaNotFoundError + SchemaParsingFailureError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + alias: + type: string + description: The schema alias. + example: abc + required: + - alias + example: + general: + status: 400 + title: Schema Parsing Failure + detail: The given schema 'abc' could not be parsed. + alias: abc + type: https://hivemq.com/edge/api/model/SchemaParsingFailureError + SchemaReferencedError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The schema ID. + example: abc + required: + - id + example: + general: + status: 400 + title: Schema Referenced + detail: Schema with ID 'abc' is referenced. + id: abc + type: https://hivemq.com/edge/api/model/SchemaReferencedError + ScriptAlreadyPresentError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The script id. + example: abc + required: + - id + example: + general: + status: 409 + title: Script Already Present + detail: The given script 'abc' is already present. + id: abc + type: https://hivemq.com/edge/api/model/ScriptAlreadyPresentError + ScriptCreationFailureError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 400 + title: Script Creation Failure + detail: The given script could not be created. + type: https://hivemq.com/edge/api/model/ScriptCreationFailureError + ScriptEtagMismatchError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The script id. + example: abc + eTag: + type: string + description: The eTag. + example: 33a64df551425fcc55e4d42a148795d9f25f89d4 + required: + - id + example: + general: + status: 412 + title: Script eTag Mismatch + detail: Script with id 'abc' does not match the given etag '33a64df551425fcc55e4d42a148795d9f25f89d4'. + id: abc + eTag: 33a64df551425fcc55e4d42a148795d9f25f89d4 + type: https://hivemq.com/edge/api/model/ScriptEtagMismatchError + ScriptInsufficientStorageError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The policy id. + example: abc + required: + - id + example: + general: + status: 507 + title: Script Insufficient Storage + detail: Script with ID '123' could not be added because of insufficient server storage. + id: abc + type: https://hivemq.com/edge/api/model/ScriptInsufficientStorageError + ScriptValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - oneOf: + - $ref: '#/components/schemas/InvalidFieldLengthValidationError' + - $ref: '#/components/schemas/InvalidFieldValueValidationError' + - $ref: '#/components/schemas/InvalidIdentifierValidationError' + - $ref: '#/components/schemas/MissingFieldValidationError' + - $ref: '#/components/schemas/UnsupportedFieldValidationError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' + https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' + https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' + https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' + https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' + ScriptInvalidErrors: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + childErrors: + type: array + description: List of child validation errors. + items: + $ref: '#/components/schemas/ScriptValidationError' + required: + - childErrors + example: + general: + status: 400 + title: Script Invalid + detail: Script is invalid due to validation errors. + type: https://hivemq.com/edge/api/model/ScriptInvalidErrors + childErrors: + - detail: The length of script field '$.id' 1025 must be between 0 and 1024. + paths: $.id + value: aaa...aaa + actualLength: 1025 + expectedMinimumLength: 0 + expectedMaximumLength: 1024 + type: https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError + ScriptNotFoundError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The script ID. + example: abc + required: + - id + example: + general: + status: 404 + title: Script Not Found + detail: Script with ID 'abc' is not found. + id: abc + type: https://hivemq.com/edge/api/model/ScriptNotFoundError + ScriptParsingFailureError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 400 + title: Script Parsing Failure + detail: The given script 'abc' could not be parsed. + type: https://hivemq.com/edge/api/model/ScriptParsingFailureError + ScriptReferencedError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The script ID. + example: abc + required: + - id + example: + general: + status: 400 + title: Script Referenced + detail: Script with ID 'abc' is referenced. + id: abc + type: https://hivemq.com/edge/api/model/ScriptReferencedError + ScriptSanitationFailureError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 400 + title: Script Sanitation Failure + detail: The given script could not be sanitized. + type: https://hivemq.com/edge/api/model/ScriptSanitationFailureError + TopicFilterMismatchError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + path: + type: string + description: The json path of the topic filter. + example: $.filter + required: + - path + example: + general: + status: 400 + title: Topic Filter Mismatch + detail: The topic filter '$.filter' mismatches. + type: https://hivemq.com/edge/api/model/TopicFilterMismatchError + InsufficientStorageError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 507 + title: Insufficient Storage + detail: Insufficient Storage. + type: https://hivemq.com/edge/api/model/InsufficientStorageError + InternalServerError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 500 + title: Internal Server Error + detail: An unexpected error occurred, check the logs. + type: https://hivemq.com/edge/api/model/InternalServerError + creation: + status: 500 + title: Internal Server Error + detail: 'An unexpected error occurred: Exception during creation of the Json Schema for functions.' + type: https://hivemq.com/edge/api/model/InternalServerError + InvalidQueryParameterError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + parameter: + type: string + description: The query parameter. + required: + - parameter + example: + general: + status: 400 + title: Query Parameter is Invalid + detail: 'Query parameter ''a'' is invalid: ''a'' could not be parsed.' + parameter: a + type: https://hivemq.com/edge/api/model/InvalidQueryParameterError + PreconditionFailedError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 412 + title: Precondition Failed + detail: 'A precondition required for fulfilling the request was not fulfilled: Policy does not match the given etag ''abc''.' + type: https://hivemq.com/edge/api/model/PreconditionFailedError + RequestBodyMissingError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 400 + title: Required Request Body Missing + detail: Required request body is missing. + type: https://hivemq.com/edge/api/model/RequestBodyMissingError + RequestBodyParameterMissingError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + parameter: + type: string + description: The the missing request body parameter. + required: + - parameter + example: + general: + status: 400 + title: Required Request Body Parameter Missing + detail: Required request body parameter 'a' is missing. + parameter: a + type: https://hivemq.com/edge/api/model/RequestBodyParameterMissingError + TemporaryNotAvailableError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 503 + title: Endpoint Temporarily not Available + detail: The endpoint is temporarily not available, please try again later. + type: https://hivemq.com/edge/api/model/TemporaryNotAvailableError + UrlParameterMissingError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + parameter: + type: string + description: The name of the missing parameter. + required: + - parameter + example: + general: + status: 400 + title: Required URL Parameter Missing + detail: Required URL parameter 'a' is missing. + parameter: a + type: https://hivemq.com/edge/api/model/UrlParameterMissingError + JsonNode: + type: object + description: The arguments of the fsm derived from the behavior policy. + FsmStateInformationItem: + type: object + description: List of result items that are returned by this endpoint + properties: + arguments: + $ref: '#/components/schemas/JsonNode' + behaviorId: + type: string + description: The unique identifier of the policy. + firstSetAt: + type: string description: The timestamp when this state was set the first time. policyId: type: string @@ -5201,8 +6658,6 @@ components: description: List of result items that are returned by this endpoint items: $ref: '#/components/schemas/DataPolicy' - Errors: - type: object PolicyType: description: The type of policy in Data Hub type: string @@ -6450,6 +7905,44 @@ components: $ref: '#/components/schemas/DomainTag' required: - items + NorthboundMappingOwnerList: + type: object + properties: + items: + type: array + description: List of result items that are returned by this endpoint + items: + type: object + required: + - adapterId + - mapping + properties: + adapterId: + type: string + description: The id of the adapter owning the mapping + mapping: + $ref: '#/components/schemas/NorthboundMapping' + required: + - items + SouthboundMappingOwnerList: + type: object + properties: + items: + type: array + description: List of result items that are returned by this endpoint + items: + type: object + required: + - adapterId + - mapping + properties: + adapterId: + type: string + description: The id of the adapter owning the mapping + mapping: + $ref: '#/components/schemas/SouthboundMapping' + required: + - items TagSchema: type: object properties: @@ -6458,6 +7951,25 @@ components: protocolId: type: string description: The id assigned to the protocol adapter type + DomainTagOwnerList: + type: object + properties: + items: + type: array + description: List of result items that are returned by this endpoint + items: + type: object + required: + - adapterId + - mapping + properties: + adapterId: + type: string + description: The id of the adapter owning the tag + mapping: + $ref: '#/components/schemas/DomainTag' + required: + - items ProtocolAdapterCategory: type: object description: The category of the adapter diff --git a/hivemq-edge-openapi/openapi/openapi.yaml b/hivemq-edge-openapi/openapi/openapi.yaml index 96cf32c3d5..c9595b9574 100644 --- a/hivemq-edge-openapi/openapi/openapi.yaml +++ b/hivemq-edge-openapi/openapi/openapi.yaml @@ -30,7 +30,7 @@ info: imported into popular API tooling (e.g. Postman) or can be used to generate client-code for multiple programming languages. title: HiveMQ Edge REST API - version: 2025.15-SNAPSHOT + version: 2025.18-SNAPSHOT x-logo: url: https://www.hivemq.com/img/svg/hivemq-bee.svg tags: From 186b5555d955abcd3d4a40c63b56a5664178a5cb Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Tue, 28 Oct 2025 15:30:19 +0100 Subject: [PATCH 118/121] fix: Fix a typo --- .../src/main/java/com/hivemq/api/errors/ValidationError.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hivemq-edge/src/main/java/com/hivemq/api/errors/ValidationError.java b/hivemq-edge/src/main/java/com/hivemq/api/errors/ValidationError.java index e542b61221..ef9ad89c5c 100644 --- a/hivemq-edge/src/main/java/com/hivemq/api/errors/ValidationError.java +++ b/hivemq-edge/src/main/java/com/hivemq/api/errors/ValidationError.java @@ -27,7 +27,7 @@ public ValidationError( final @Nullable List errors) { super( "ValidationError", - "Validatin failed", + "Validation failed", "JSON failed validation.", HttpStatus.BAD_REQUEST_400, errors); From ff180e22eeb0f50151c1ef3e069dee1924b488ac Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Wed, 29 Oct 2025 09:02:28 +0100 Subject: [PATCH 119/121] refactor: Sync openapi spec --- ext/hivemq-edge-openapi-2025.14.yaml | 1889 ++-------------- ext/hivemq-edge-openapi-2025.15.yaml | 1889 ++-------------- ext/hivemq-edge-openapi-2025.17.yaml | 1887 ++-------------- ext/hivemq-edge-openapi-2025.18.yaml | 1968 ++-------------- ext/hivemq-edge-openapi-2025.19-SNAPSHOT.yaml | 1996 +++++++++++++++-- hivemq-edge-openapi/openapi/openapi.yaml | 2 +- 6 files changed, 2645 insertions(+), 6986 deletions(-) diff --git a/ext/hivemq-edge-openapi-2025.14.yaml b/ext/hivemq-edge-openapi-2025.14.yaml index b9a0673cd9..109e12c57d 100644 --- a/ext/hivemq-edge-openapi-2025.14.yaml +++ b/ext/hivemq-edge-openapi-2025.14.yaml @@ -14,7 +14,7 @@ info: ## OpenAPI HiveMQ's REST API provides an OpenAPI 3.0 schema definition that can imported into popular API tooling (e.g. Postman) or can be used to generate client-code for multiple programming languages. title: HiveMQ Edge REST API - version: 2025.12-SNAPSHOT + version: 2025.14-SNAPSHOT x-logo: url: https://www.hivemq.com/img/svg/hivemq-bee.svg tags: @@ -357,23 +357,12 @@ paths: schema: $ref: '#/components/schemas/BehaviorPolicyList' description: Success - '400': - content: - application/problem+json: - schema: - oneOf: - - $ref: '#/components/schemas/InvalidQueryParameterError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' - description: URL parameter missing '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable + $ref: '#/components/schemas/ProblemDetails' + description: Temporarily not available summary: Get all policies tags: - Data Hub - Behavior Policies @@ -458,45 +447,34 @@ paths: description: Success '400': content: - application/problem+json: - schema: - oneOf: - - $ref: '#/components/schemas/BehaviorPolicyCreationFailureError' - - $ref: '#/components/schemas/BehaviorPolicyInvalidErrors' - - $ref: '#/components/schemas/BehaviorPolicyRejectedError' - - $ref: '#/components/schemas/RequestBodyMissingError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError: '#/components/schemas/BehaviorPolicyCreationFailureError' - https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors: '#/components/schemas/BehaviorPolicyInvalidErrors' - https://hivemq.com/edge/api/model/BehaviorPolicyRejectedError: '#/components/schemas/BehaviorPolicyRejectedError' - https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' description: Policy creation failed '409': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/BehaviorPolicyAlreadyPresentError' - description: Behavior policy already present + $ref: '#/components/schemas/ProblemDetails' + description: Already exists '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' - description: Internal server error + $ref: '#/components/schemas/ProblemDetails' + description: Internal error '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable + $ref: '#/components/schemas/ProblemDetails' + description: Temporarily unavailable '507': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/PolicyInsufficientStorageError' - description: Insufficient storage + $ref: '#/components/schemas/ProblemDetails' + description: Insufficient storage error summary: Create a new policy tags: - Data Hub - Behavior Policies @@ -526,39 +504,34 @@ paths: description: Success, no response body '400': content: - application/problem+json: + application/json: schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + $ref: '#/components/schemas/ProblemDetails' description: URL parameter missing '404': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/PolicyNotFoundError' - description: Behavior policy not found + $ref: '#/components/schemas/ProblemDetails' + description: Policy not found '412': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/PreconditionFailedError' + $ref: '#/components/schemas/ProblemDetails' description: Precondition failed '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' - description: Internal server error + $ref: '#/components/schemas/ProblemDetails' + description: Internal error '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable + $ref: '#/components/schemas/ProblemDetails' + description: Temporarily not available summary: Delete a behavior policy tags: - Data Hub - Behavior Policies @@ -626,33 +599,16 @@ paths: description: Success '400': content: - application/problem+json: + application/json: schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' - description: Bad request + $ref: '#/components/schemas/ProblemDetails' + description: Invalid query parameter '404': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/BehaviorPolicyNotFoundError' + $ref: '#/components/schemas/ProblemDetails' description: Policy not found - '500': - content: - application/problem+json: - schema: - $ref: '#/components/schemas/InternalServerError' - description: Internal server error - '503': - content: - application/problem+json: - schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable summary: Get a policy tags: - Data Hub - Behavior Policies @@ -753,56 +709,41 @@ paths: description: Success '400': content: - application/problem+json: - schema: - oneOf: - - $ref: '#/components/schemas/RequestBodyMissingError' - - $ref: '#/components/schemas/UrlParameterMissingError' - - $ref: '#/components/schemas/BehaviorPolicyCreationFailureError' - - $ref: '#/components/schemas/BehaviorPolicyInvalidErrors' - - $ref: '#/components/schemas/BehaviorPolicyUpdateFailureError' - - $ref: '#/components/schemas/PolicyIdMismatchError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' - https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError: '#/components/schemas/BehaviorPolicyCreationFailureError' - https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors: '#/components/schemas/BehaviorPolicyInvalidErrors' - https://hivemq.com/edge/api/model/BehaviorPolicyUpdateFailureError: '#/components/schemas/BehaviorPolicyUpdateFailureError' - https://hivemq.com/edge/api/model/PolicyIdMismatchError: '#/components/schemas/PolicyIdMismatchError' - description: Behavior policy creation failed + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: Policy creation failed '404': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/BehaviorPolicyNotFoundError' - description: Data policy not found + $ref: '#/components/schemas/ProblemDetails' + description: Policy not found '412': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/PreconditionFailedError' + $ref: '#/components/schemas/ProblemDetails' description: Precondition failed '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' - description: Internal server error + $ref: '#/components/schemas/ProblemDetails' + description: Internal error '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable + $ref: '#/components/schemas/ProblemDetails' + description: Temporarily unavailable '507': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/PolicyInsufficientStorageError' - description: Insufficient storage - summary: Update an existing behavior policy + $ref: '#/components/schemas/ProblemDetails' + description: Insufficient storage error + summary: Update an existing policy tags: - Data Hub - Behavior Policies /api/v1/data-hub/behavior-validation/states/{clientId}: @@ -846,34 +787,22 @@ paths: description: Success '400': content: - application/problem+json: + application/json: schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + $ref: '#/components/schemas/ProblemDetails' description: URL parameter missing '404': content: - application/problem+json: - schema: - oneOf: - - $ref: '#/components/schemas/ClientDisconnectedError' - - $ref: '#/components/schemas/ClientNotFoundError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/ClientDisconnectedError: '#/components/schemas/ClientDisconnectedError' - https://hivemq.com/edge/api/model/ClientNotFoundError: '#/components/schemas/ClientNotFoundError' - description: Client error + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: Client is disconnected '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' - description: Internal server error + $ref: '#/components/schemas/ProblemDetails' + description: Internal Server error summary: Get the state of a client tags: - Data Hub - State @@ -1122,20 +1051,27 @@ paths: description: Success '400': content: - application/problem+json: + application/json: schema: - oneOf: - - $ref: '#/components/schemas/InvalidQueryParameterError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' + $ref: '#/components/schemas/ProblemDetails' description: URL parameter missing + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: DataPolicy not found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: Internal server error '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' + $ref: '#/components/schemas/ProblemDetails' description: Request resource temporary unavailable summary: Get all data policies tags: @@ -1219,44 +1155,33 @@ paths: description: Success '400': content: - application/problem+json: - schema: - oneOf: - - $ref: '#/components/schemas/RequestBodyMissingError' - - $ref: '#/components/schemas/DataPolicyCreationFailureError' - - $ref: '#/components/schemas/DataPolicyInvalidErrors' - - $ref: '#/components/schemas/DataPolicyRejectedError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' - https://hivemq.com/edge/api/model/DataPolicyCreationFailureError: '#/components/schemas/DataPolicyCreationFailureError' - https://hivemq.com/edge/api/model/DataPolicyInvalidErrors: '#/components/schemas/DataPolicyInvalidErrors' - https://hivemq.com/edge/api/model/DataPolicyRejectedError: '#/components/schemas/DataPolicyRejectedError' - description: Data policy creation failed + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: DataPolicy creation failed '409': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/DataPolicyAlreadyPresentError' - description: Data policy already present + $ref: '#/components/schemas/ProblemDetails' + description: DataPolicy already present '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' + $ref: '#/components/schemas/ProblemDetails' description: Request resource temporary unavailable '507': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/PolicyInsufficientStorageError' + $ref: '#/components/schemas/ProblemDetails' description: Insufficient storage summary: Create a new data policy tags: @@ -1287,38 +1212,27 @@ paths: description: Success, no response body '400': content: - application/problem+json: + application/json: schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + $ref: '#/components/schemas/ProblemDetails' description: URL parameter missing '404': content: - application/problem+json: - schema: - $ref: '#/components/schemas/PolicyNotFoundError' - description: Data policy not found - '412': - content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/PreconditionFailedError' - description: Precondition failed + $ref: '#/components/schemas/ProblemDetails' + description: DataPolicy not found '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' + $ref: '#/components/schemas/ProblemDetails' description: Request resource temporary unavailable summary: Delete a data policy tags: @@ -1386,33 +1300,32 @@ paths: description: Success '400': content: - application/problem+json: + application/json: + examples: + param-missing: + description: Example response when a required parameter is missing. + summary: Required URL parameter missing + value: + errors: + - title: Required parameter missing + detail: Required URL parameter 'parameterName' is missing schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + $ref: '#/components/schemas/ProblemDetails' description: Bad request '404': content: - application/problem+json: + application/json: + examples: + not-found: + description: Policy not found + summary: Not found + value: + errors: + - title: Resource not found + detail: Resource with id 'my-resource-id' not found schema: - $ref: '#/components/schemas/PolicyNotFoundError' + $ref: '#/components/schemas/ProblemDetails' description: Resource not found - '500': - content: - application/problem+json: - schema: - $ref: '#/components/schemas/InternalServerError' - description: Internal server error - '503': - content: - application/problem+json: - schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable summary: Get a data policy tags: - Data Hub - Data Policies @@ -1512,56 +1425,33 @@ paths: description: Success '400': content: - application/problem+json: - schema: - oneOf: - - $ref: '#/components/schemas/RequestBodyMissingError' - - $ref: '#/components/schemas/UrlParameterMissingError' - - $ref: '#/components/schemas/DataPolicyCreationFailureError' - - $ref: '#/components/schemas/DataPolicyInvalidErrors' - - $ref: '#/components/schemas/DataPolicyUpdateFailureError' - - $ref: '#/components/schemas/PolicyIdMismatchError' - - $ref: '#/components/schemas/TopicFilterMismatchError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' - https://hivemq.com/edge/api/model/DataPolicyCreationFailureError: '#/components/schemas/DataPolicyCreationFailureError' - https://hivemq.com/edge/api/model/DataPolicyInvalidErrors: '#/components/schemas/DataPolicyInvalidErrors' - https://hivemq.com/edge/api/model/DataPolicyUpdateFailureError: '#/components/schemas/DataPolicyUpdateFailureError' - https://hivemq.com/edge/api/model/PolicyIdMismatchError: '#/components/schemas/PolicyIdMismatchError' - https://hivemq.com/edge/api/model/TopicFilterMismatchError: '#/components/schemas/TopicFilterMismatchError' - description: Data policy creation failed - '404': - content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/DataPolicyNotFoundError' - description: Data policy not found - '412': + $ref: '#/components/schemas/ProblemDetails' + description: DataPolicy creation failed + '404': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/PreconditionFailedError' - description: Precondition failed + $ref: '#/components/schemas/ProblemDetails' + description: DataPolicy not found '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' + $ref: '#/components/schemas/ProblemDetails' description: Request resource temporary unavailable '507': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/PolicyInsufficientStorageError' + $ref: '#/components/schemas/ProblemDetails' description: Insufficient storage summary: Update an existing data policy tags: @@ -1647,9 +1537,9 @@ paths: description: Success '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/Errors' description: Internal server error summary: Get all FSMs as a JSON Schema tags: @@ -1809,9 +1699,9 @@ paths: description: Success '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error summary: Get all functions as a JSON Schema tags: @@ -1829,9 +1719,9 @@ paths: description: Success '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error summary: Get all interpolation variables tags: @@ -1849,9 +1739,9 @@ paths: description: Success '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error summary: Get all functions as a list of function specifications tags: @@ -1986,22 +1876,11 @@ paths: schema: $ref: '#/components/schemas/SchemaList' description: Success - '400': - content: - application/problem+json: - schema: - oneOf: - - $ref: '#/components/schemas/InvalidQueryParameterError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' - description: URL parameter missing '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' + $ref: '#/components/schemas/ProblemDetails' description: Request resource temporary unavailable summary: Get all schemas tags: @@ -2048,48 +1927,33 @@ paths: description: Success '400': content: - application/problem+json: - schema: - oneOf: - - $ref: '#/components/schemas/RequestBodyParameterMissingError' - - $ref: '#/components/schemas/SchemaInvalidErrors' - - $ref: '#/components/schemas/SchemaParsingFailureError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/RequestBodyParameterMissingError: '#/components/schemas/RequestBodyParameterMissingError' - https://hivemq.com/edge/api/model/SchemaInvalidErrors: '#/components/schemas/SchemaInvalidErrors' - https://hivemq.com/edge/api/model/SchemaParsingFailureError: '#/components/schemas/SchemaParsingFailureError' - description: Schema creation failed + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: Schema could not be validatetd '409': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/SchemaAlreadyPresentError' - description: Schema is already present + $ref: '#/components/schemas/ProblemDetails' + description: Schema already exists '412': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/SchemaEtagMismatchError' - description: Schema doesn't match etag + $ref: '#/components/schemas/ProblemDetails' + description: Mismatch between schema and etag '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error - '503': - content: - application/problem+json: - schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable '507': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/SchemaInsufficientStorageError' + $ref: '#/components/schemas/ProblemDetails' description: Insufficient storage summary: Create a new schema tags: @@ -2120,40 +1984,33 @@ paths: description: Success, no response body '400': content: - application/problem+json: + application/json: schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - - $ref: '#/components/schemas/SchemaReferencedError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' - https://hivemq.com/edge/api/model/SchemaReferencedError: '#/components/schemas/SchemaReferencedError' - description: URL parameter missing + $ref: '#/components/schemas/ProblemDetails' + description: Schema referenced '404': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/SchemaNotFoundError' + $ref: '#/components/schemas/ProblemDetails' description: Schema not found '412': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/SchemaEtagMismatchError' - description: Schema doesn't match etag + $ref: '#/components/schemas/ProblemDetails' + description: Mismatch between schema and etag '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' - description: Internal Server error + $ref: '#/components/schemas/ProblemDetails' + description: Internal server error '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' + $ref: '#/components/schemas/ProblemDetails' description: Request resource temporary unavailable summary: Delete all versions of the schema tags: @@ -2199,33 +2056,22 @@ paths: description: Success '400': content: - application/problem+json: + application/json: schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' - description: URL parameter missing + $ref: '#/components/schemas/ProblemDetails' + description: A url parameter is missing '404': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/SchemaNotFoundError' + $ref: '#/components/schemas/ProblemDetails' description: Schema not found '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error - '503': - content: - application/problem+json: - schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable summary: Get a schema tags: - Data Hub - Schemas @@ -2346,23 +2192,12 @@ paths: schema: $ref: '#/components/schemas/ScriptList' description: Success - '400': - content: - application/problem+json: - schema: - oneOf: - - $ref: '#/components/schemas/InvalidQueryParameterError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' - description: URL parameter missing '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable + $ref: '#/components/schemas/ProblemDetails' + description: Temporary not available summary: Get all scripts tags: - Data Hub - Scripts @@ -2408,52 +2243,39 @@ paths: description: Success '400': content: - application/problem+json: - schema: - oneOf: - - $ref: '#/components/schemas/RequestBodyParameterMissingError' - - $ref: '#/components/schemas/ScriptCreationFailureError' - - $ref: '#/components/schemas/ScriptInvalidErrors' - - $ref: '#/components/schemas/ScriptParsingFailureError' - - $ref: '#/components/schemas/ScriptSanitationFailureError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/RequestBodyParameterMissingError: '#/components/schemas/RequestBodyParameterMissingError' - https://hivemq.com/edge/api/model/ScriptCreationFailureError: '#/components/schemas/ScriptCreationFailureError' - https://hivemq.com/edge/api/model/ScriptInvalidErrors: '#/components/schemas/ScriptInvalidErrors' - https://hivemq.com/edge/api/model/ScriptParsingFailureError: '#/components/schemas/ScriptParsingFailureError' - https://hivemq.com/edge/api/model/ScriptSanitationFailureError: '#/components/schemas/ScriptSanitationFailureError' - description: Script creation failed + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: Script is invalid '409': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/ScriptAlreadyPresentError' + $ref: '#/components/schemas/ProblemDetails' description: Script is already present '412': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/ScriptEtagMismatchError' + $ref: '#/components/schemas/ProblemDetails' description: Script doesn't match etag '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable + $ref: '#/components/schemas/ProblemDetails' + description: Temporary not available '507': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/ScriptInsufficientStorageError' + $ref: '#/components/schemas/ProblemDetails' description: Insufficient storage summary: Create a new script tags: @@ -2481,41 +2303,34 @@ paths: description: Success, no response body '400': content: - application/problem+json: + application/json: schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - - $ref: '#/components/schemas/ScriptReferencedError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' - https://hivemq.com/edge/api/model/ScriptReferencedError: '#/components/schemas/ScriptReferencedError' - description: URL parameter missing + $ref: '#/components/schemas/ProblemDetails' + description: Script is referenced '404': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/ScriptNotFoundError' + $ref: '#/components/schemas/ProblemDetails' description: Script not found '412': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/ScriptEtagMismatchError' + $ref: '#/components/schemas/ProblemDetails' description: Script doesn't match etag '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal Server error '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable + $ref: '#/components/schemas/ProblemDetails' + description: Temporary not available summary: Delete a script tags: - Data Hub - Scripts @@ -2556,33 +2371,28 @@ paths: description: Success '400': content: - application/problem+json: + application/json: schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + $ref: '#/components/schemas/ProblemDetails' description: URL parameter missing '404': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/ScriptNotFoundError' + $ref: '#/components/schemas/ProblemDetails' description: Script not found '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal Server error '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable + $ref: '#/components/schemas/ProblemDetails' + description: Temporary not available summary: Get a script tags: - Data Hub - Scripts @@ -5058,7 +4868,6 @@ components: detail: type: string errors: - deprecated: true type: array items: $ref: '#/components/schemas/Error' @@ -5223,1264 +5032,6 @@ components: description: List of result items that are returned by this endpoint items: $ref: '#/components/schemas/BehaviorPolicy' - ApiProblemDetails: - allOf: - - $ref: '#/components/schemas/ProblemDetails' - - type: object - required: - - detail - - status - - type - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/BehaviorPolicyAlreadyPresentError: '#/components/schemas/BehaviorPolicyAlreadyPresentError' - https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError: '#/components/schemas/BehaviorPolicyCreationFailureError' - https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors: '#/components/schemas/BehaviorPolicyInvalidErrors' - https://hivemq.com/edge/api/model/BehaviorPolicyNotFoundError: '#/components/schemas/BehaviorPolicyNotFoundError' - https://hivemq.com/edge/api/model/BehaviorPolicyRejectedError: '#/components/schemas/BehaviorPolicyRejectedError' - https://hivemq.com/edge/api/model/BehaviorPolicyUpdateFailureError: '#/components/schemas/BehaviorPolicyUpdateFailureError' - https://hivemq.com/edge/api/model/ClientDisconnectedError: '#/components/schemas/ClientDisconnectedError' - https://hivemq.com/edge/api/model/ClientNotFoundError: '#/components/schemas/ClientNotFoundError' - https://hivemq.com/edge/api/model/DataPolicyAlreadyPresentError: '#/components/schemas/DataPolicyAlreadyPresentError' - https://hivemq.com/edge/api/model/DataPolicyCreationFailureError: '#/components/schemas/DataPolicyCreationFailureError' - https://hivemq.com/edge/api/model/DataPolicyInvalidErrors: '#/components/schemas/DataPolicyInvalidErrors' - https://hivemq.com/edge/api/model/DataPolicyNotFoundError: '#/components/schemas/DataPolicyNotFoundError' - https://hivemq.com/edge/api/model/DataPolicyRejectedError: '#/components/schemas/DataPolicyRejectedError' - https://hivemq.com/edge/api/model/DataPolicyUpdateFailureError: '#/components/schemas/DataPolicyUpdateFailureError' - https://hivemq.com/edge/api/model/PolicyIdMismatchError: '#/components/schemas/PolicyIdMismatchError' - https://hivemq.com/edge/api/model/PolicyInsufficientStorageError: '#/components/schemas/PolicyInsufficientStorageError' - https://hivemq.com/edge/api/model/PolicyNotFoundError: '#/components/schemas/PolicyNotFoundError' - https://hivemq.com/edge/api/model/SchemaAlreadyPresentError: '#/components/schemas/SchemaAlreadyPresentError' - https://hivemq.com/edge/api/model/SchemaEtagMismatchError: '#/components/schemas/SchemaEtagMismatchError' - https://hivemq.com/edge/api/model/SchemaInsufficientStorageError: '#/components/schemas/SchemaInsufficientStorageError' - https://hivemq.com/edge/api/model/SchemaInvalidErrors: '#/components/schemas/SchemaInvalidErrors' - https://hivemq.com/edge/api/model/SchemaNotFoundError: '#/components/schemas/SchemaNotFoundError' - https://hivemq.com/edge/api/model/SchemaParsingFailureError: '#/components/schemas/SchemaParsingFailureError' - https://hivemq.com/edge/api/model/SchemaReferencedError: '#/components/schemas/SchemaReferencedError' - https://hivemq.com/edge/api/model/ScriptAlreadyPresentError: '#/components/schemas/ScriptAlreadyPresentError' - https://hivemq.com/edge/api/model/ScriptCreationFailureError: '#/components/schemas/ScriptCreationFailureError' - https://hivemq.com/edge/api/model/ScriptEtagMismatchError: '#/components/schemas/ScriptEtagMismatchError' - https://hivemq.com/edge/api/model/ScriptInsufficientStorageError: '#/components/schemas/ScriptInsufficientStorageError' - https://hivemq.com/edge/api/model/ScriptInvalidErrors: '#/components/schemas/ScriptInvalidErrors' - https://hivemq.com/edge/api/model/ScriptNotFoundError: '#/components/schemas/ScriptNotFoundError' - https://hivemq.com/edge/api/model/ScriptParsingFailureError: '#/components/schemas/ScriptParsingFailureError' - https://hivemq.com/edge/api/model/ScriptReferencedError: '#/components/schemas/ScriptReferencedError' - https://hivemq.com/edge/api/model/ScriptSanitationFailureError: '#/components/schemas/ScriptSanitationFailureError' - https://hivemq.com/edge/api/model/TopicFilterMismatchError: '#/components/schemas/TopicFilterMismatchError' - https://hivemq.com/edge/api/model/InsufficientStorageError: '#/components/schemas/InsufficientStorageError' - https://hivemq.com/edge/api/model/InternalServerError: '#/components/schemas/InternalServerError' - https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' - https://hivemq.com/edge/api/model/PreconditionFailedError: '#/components/schemas/PreconditionFailedError' - https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' - https://hivemq.com/edge/api/model/RequestBodyParameterMissingError: '#/components/schemas/RequestBodyParameterMissingError' - https://hivemq.com/edge/api/model/TemporaryNotAvailableError: '#/components/schemas/TemporaryNotAvailableError' - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' - BehaviorPolicyAlreadyPresentError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The behavior policy id. - example: abc - required: - - id - example: - general: - status: 409 - title: Behavior Policy Already Present - detail: The given behavior policy 'abc' is already present. - id: abc - type: https://hivemq.com/edge/api/model/BehaviorPolicyAlreadyPresentError - BehaviorPolicyCreationFailureError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 400 - title: Behavior Policy Creation Failed - detail: 'Behavior policy creation failed: The policy was rejected.' - type: https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError - AtLeastOneFieldMissingValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - paths: - type: array - description: The missing json paths. - items: - type: string - format: json-path - description: The json path. - example: - - $.field1 - - $.field2 - required: - - paths - example: - general: - detail: 'At least one of the fields must be present: ''$.field1'', ''$.field2''.' - paths: - - $.field1 - - $.field2 - type: https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError - ValidationError: - type: object - properties: - detail: - type: string - description: Detailed contextual description of the validation error. - type: - type: string - format: uri - description: Type of the validation error. - required: - - detail - - type - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError: '#/components/schemas/AtLeastOneFieldMissingValidationError' - https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError: '#/components/schemas/AtMostOneFunctionValidationError' - https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' - https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError: '#/components/schemas/FunctionMustBePairedValidationError' - https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError: '#/components/schemas/IllegalEventTransitionValidationError' - https://hivemq.com/edge/api/model/IllegalFunctionValidationError: '#/components/schemas/IllegalFunctionValidationError' - https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' - https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' - https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError: '#/components/schemas/InvalidFunctionOrderValidationError' - https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' - https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError: '#/components/schemas/InvalidSchemaVersionValidationError' - https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' - https://hivemq.com/edge/api/model/UnknownVariableValidationError: '#/components/schemas/UnknownVariableValidationError' - https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' - AtMostOneFunctionValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - function: - type: string - description: The function. - example: function1 - occurrences: - type: integer - format: int32 - description: The occurrences of the function. - minimum: 0 - example: 3 - paths: - type: array - items: - type: string - format: json-path - description: The json paths where the function occurs. - example: - - $.path1 - - $.path2 - - $.path3 - required: - - function - - occurrences - - paths - example: - general: - detail: The pipeline must contain at most one 'function1' function, but 3 were found at ['$.path1', '$.path2', '$.path3']. - function: function1 - occurrences: 3 - paths: - - $.path1 - - $.path2 - - $.path3 - type: https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError - EmptyFieldValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - path: - type: string - format: json-path - description: The missing field. - example: $.field - required: - - path - example: - general: - detail: Required field '$.field' is empty. - path: $.field - type: https://hivemq.com/edge/api/model/EmptyFieldValidationError - FunctionMustBePairedValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - existingFunction: - type: string - description: The existing function. - example: function1 - missingFunction: - type: string - description: The missing function. - example: function2 - required: - - existingFunction - - missingFunction - example: - general: - detail: If 'function1' function is present in the pipeline, 'function2' function must be present as well. - existingFunction: function1 - missingFunction: function2 - type: https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError - IllegalEventTransitionValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - event: - type: string - description: The event name. - example: event1 - fromState: - type: string - description: The event from state. - example: state1 - id: - type: string - description: The event id. - example: abc - path: - type: string - description: The path. - example: $.event - toState: - type: string - description: The event to state. - example: state2 - required: - - event - - fromState - - id - - path - - toState - example: - general: - detail: The transition from state 'state1' to state 'state2' on event 'event1' in '$.event' is not defined for behavior 'abc'. - event: event1 - fromState: state1 - toState: state2 - id: abc - path: $.event - type: https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError - IllegalFunctionValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - event: - type: string - description: The event name. - example: event1 - id: - type: string - description: The function id. - example: abc - path: - type: string - format: json-path - description: The json path. - example: $.event - required: - - event - - id - - path - example: - general: - detail: The function 'abc' is not allowed for event 'event1' in '$.event'. - event: event1 - id: abc - path: $.event - type: https://hivemq.com/edge/api/model/IllegalFunctionValidationError - InvalidFieldLengthValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - actualLength: - type: integer - format: int32 - description: The actual length of the field value. - example: 10 - expectedMinimumLength: - type: integer - format: int32 - description: The minimum length expected for the field value. - minimum: 0 - example: 5 - expectedMaximumLength: - type: integer - format: int32 - description: The maximum length expected for the field value. - minimum: 0 - example: 20 - path: - type: string - format: json-path - description: The invalid json path. - example: $.field - value: - type: string - description: The invalid value. - example: function transform() { return 'Hello, World!'; } - required: - - actualLength - - expectedMinimumLength - - expectedMaximumLength - - path - - value - example: - general: - detail: The length of script field '$.transform' 48 must be between 0 and 20. - actualLength: 48 - minimumLength: 0 - maximumLength: 20 - path: $.transform - value: function transform() { return 'Hello, World!'; } - type: https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError - InvalidFieldValueValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - path: - type: string - format: json-path - description: The invalid json path. - example: $.action.pipeline[1].field - value: - type: string - description: The invalid value. - example: functionDoesNotExist - required: - - path - example: - general: - detail: Referenced function does not exist. - path: $.action.pipeline[1].field - value: functionDoesNotExist - type: https://hivemq.com/edge/api/model/InvalidFieldValueValidationError - InvalidFunctionOrderValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - function: - type: string - description: The function. - example: transform - path: - type: string - format: json-path - description: The json path. - example: $.path - previousFunction: - type: string - description: The previous function. - example: init - required: - - function - - path - - previousFunction - example: - general: - detail: The operation at '$.path' with the functionId 'transform' must be after a 'init' operation. - function: transform - path: $.path - previousFunction: init - type: https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError - InvalidIdentifierValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - path: - type: string - format: json-path - description: The invalid identifier path. - example: $.id - value: - type: string - description: The invalid identifier value. - example: invalidId - required: - - path - - value - example: - general: - detail: Identifier script 'id' must begin with a letter and may only consist of lowercase letters, uppercase letters, numbers, periods, hyphens, and underscores. - path: $.id - value: invalidId - type: https://hivemq.com/edge/api/model/InvalidIdentifierValidationError - InvalidSchemaVersionValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - id: - type: string - description: The schema id. - example: abc - version: - type: string - description: The schema version. - example: '2' - required: - - id - - version - example: - general: - detail: The referenced schema with id 'abc' and version '2' was not found. - id: abc - version: '2' - type: https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError - MissingFieldValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - path: - type: string - format: json-path - description: The missing path. - example: $.id - required: - - path - example: - general: - detail: Required field '$.id' is missing. - path: $.id - type: https://hivemq.com/edge/api/model/MissingFieldValidationError - UnknownVariableValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - path: - type: string - description: The json path of the field. - example: $.path - variables: - type: array - items: - type: string - description: The unknown variables. - example: - - a - - b - - c - required: - - path - - variables - example: - general: - detail: 'Field ''$.path'' contains unknown variables: [a, b, c].' - path: $.path - variables: - - a - - b - - c - type: https://hivemq.com/edge/api/model/UnknownVariableValidationError - UnsupportedFieldValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - actualValue: - type: string - description: The actual value. - expectedValue: - type: string - description: The expected value. - path: - type: string - format: json-path - description: The json path. - example: $.id - required: - - actualValue - - expectedValue - - path - example: - general: - detail: Unsupported type 'String' for field '$.id'. Expected type is 'Object'. - actualValue: String - expectedValue: Object - path: $.id - type: https://hivemq.com/edge/api/model/UnsupportedFieldValidationError - BehaviorPolicyValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - oneOf: - - $ref: '#/components/schemas/IllegalEventTransitionValidationError' - - $ref: '#/components/schemas/IllegalFunctionValidationError' - - $ref: '#/components/schemas/InvalidSchemaVersionValidationError' - - $ref: '#/components/schemas/AtLeastOneFieldMissingValidationError' - - $ref: '#/components/schemas/EmptyFieldValidationError' - - $ref: '#/components/schemas/InvalidFieldLengthValidationError' - - $ref: '#/components/schemas/InvalidFieldValueValidationError' - - $ref: '#/components/schemas/InvalidIdentifierValidationError' - - $ref: '#/components/schemas/MissingFieldValidationError' - - $ref: '#/components/schemas/UnsupportedFieldValidationError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError: '#/components/schemas/AtLeastOneFieldMissingValidationError' - https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' - https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError: '#/components/schemas/IllegalEventTransitionValidationError' - https://hivemq.com/edge/api/model/IllegalFunctionValidationError: '#/components/schemas/IllegalFunctionValidationError' - https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' - https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' - https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' - https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError: '#/components/schemas/InvalidSchemaVersionValidationError' - https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' - https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' - BehaviorPolicyInvalidErrors: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - childErrors: - type: array - description: List of child validation errors. - items: - $ref: '#/components/schemas/BehaviorPolicyValidationError' - required: - - childErrors - example: - general: - status: 400 - title: Behavior Policy Invalid - detail: Behavior policy is invalid due to validation errors. - type: https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors - childErrors: - - detail: The transition from state 'state1' to state 'state2' on event 'event1' in '$.path' is not defined for behavior 'id1'. - fromState: state1 - toState: state2 - path: $.path - id: id1 - type: https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError - BehaviorPolicyNotFoundError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The data policy id. - example: abc - required: - - id - example: - general: - status: 404 - title: Behavior Policy Not Found - detail: Behavior policy with ID 'abc' is not found. - id: abc - type: https://hivemq.com/edge/api/model/BehaviorPolicyNotFoundError - BehaviorPolicyRejectedError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 400 - title: Behavior Policy Rejected - detail: Behavior policy is rejected. - type: https://hivemq.com/edge/api/model/BehaviorPolicyRejectedError - BehaviorPolicyUpdateFailureError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The ID of the policy that failed to update. - example: abc - required: - - id - example: - general: - status: 400 - title: Behavior Policy Update Failed - detail: Behavior policy with ID 'abc' update failed. - id: abc - type: https://hivemq.com/edge/api/model/BehaviorPolicyUpdateFailureError - ClientDisconnectedError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The client id. - example: abc - required: - - id - example: - general: - status: 404 - title: Client Disconnected - detail: Client with ID 'abc' is disconnected. - id: abc - type: https://hivemq.com/edge/api/model/ClientDisconnectedError - ClientNotFoundError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The client id. - example: abc - required: - - id - example: - general: - status: 404 - title: Client Not Found - detail: Client with ID 'abc' is not found. - id: abc - type: https://hivemq.com/edge/api/model/ClientNotFoundError - DataPolicyAlreadyPresentError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The data policy id. - example: abc - required: - - id - example: - general: - status: 409 - title: Data Policy Already Present - detail: The given data policy 'abc' is already present. - id: abc - type: https://hivemq.com/edge/api/model/DataPolicyAlreadyPresentError - DataPolicyCreationFailureError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 400 - title: Data Policy Creation Failed - detail: 'Data policy creation failed: The policy was rejected.' - type: https://hivemq.com/edge/api/model/DataPolicyCreationFailureError - DataPolicyValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - oneOf: - - $ref: '#/components/schemas/AtMostOneFunctionValidationError' - - $ref: '#/components/schemas/FunctionMustBePairedValidationError' - - $ref: '#/components/schemas/InvalidFunctionOrderValidationError' - - $ref: '#/components/schemas/InvalidSchemaVersionValidationError' - - $ref: '#/components/schemas/UnknownVariableValidationError' - - $ref: '#/components/schemas/EmptyFieldValidationError' - - $ref: '#/components/schemas/InvalidFieldLengthValidationError' - - $ref: '#/components/schemas/InvalidFieldValueValidationError' - - $ref: '#/components/schemas/InvalidIdentifierValidationError' - - $ref: '#/components/schemas/MissingFieldValidationError' - - $ref: '#/components/schemas/UnsupportedFieldValidationError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError: '#/components/schemas/AtMostOneFunctionValidationError' - https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' - https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError: '#/components/schemas/FunctionMustBePairedValidationError' - https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' - https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' - https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError: '#/components/schemas/InvalidFunctionOrderValidationError' - https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' - https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError: '#/components/schemas/InvalidSchemaVersionValidationError' - https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' - https://hivemq.com/edge/api/model/UnknownVariableValidationError: '#/components/schemas/UnknownVariableValidationError' - https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' - DataPolicyInvalidErrors: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - childErrors: - type: array - description: List of child validation errors. - items: - $ref: '#/components/schemas/DataPolicyValidationError' - required: - - childErrors - example: - general: - status: 400 - title: Data Policy Invalid - detail: Data policy is invalid due to validation errors. - type: https://hivemq.com/edge/api/model/DataPolicyInvalidErrors - childErrors: - - detail: The pipeline must contain at most one 'function1' function, but 3 were found at ['$.path1', '$.path2', '$.path3']. - function: function1 - occurrences: 3 - paths: - - $.path1 - - $.path2 - - $.path3 - type: https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError - DataPolicyNotFoundError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The data policy id. - example: abc - required: - - id - example: - general: - status: 404 - title: Data Policy Not Found - detail: Data policy with ID 'abc' is not found. - id: abc - type: https://hivemq.com/edge/api/model/DataPolicyNotFoundError - DataPolicyRejectedError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 400 - title: Data Policy Rejected - detail: Data policy is rejected. - type: https://hivemq.com/edge/api/model/DataPolicyRejectedError - DataPolicyUpdateFailureError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The ID of the policy that failed to update. - example: abc - required: - - id - example: - general: - status: 400 - title: Data Policy Update Failed - detail: Data policy with ID 'abc' update failed. - id: abc - type: https://hivemq.com/edge/api/model/DataPolicyUpdateFailureError - PolicyIdMismatchError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - actualId: - type: string - description: The actual id. - example: id1 - expectedId: - type: string - description: The expected id. - example: id2 - required: - - actualId - - expectedId - example: - general: - status: 400 - title: Policy ID Mismatch - detail: The policy ID 'id1' in the request parameter does not match the policy ID 'id2' in the policy request body. - id: abc - type: https://hivemq.com/edge/api/model/PolicyIdMismatchError - PolicyInsufficientStorageError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The policy id. - example: abc - required: - - id - example: - general: - status: 507 - title: Policy Insufficient Storage - detail: Policy with ID '123' could not be added because of insufficient server storage. - id: abc - type: https://hivemq.com/edge/api/model/PolicyInsufficientStorageError - PolicyNotFoundError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The policy id. - example: abc - required: - - id - example: - general: - status: 404 - title: Policy Not Found - detail: Policy with ID 'abc' is not found. - id: abc - type: https://hivemq.com/edge/api/model/PolicyNotFoundError - SchemaAlreadyPresentError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The schema id. - example: abc - required: - - id - example: - general: - status: 409 - title: Schema Already Present - detail: The given schema is already present as the latest version for the schema id 'abc'. - id: abc - type: https://hivemq.com/edge/api/model/SchemaAlreadyPresentError - SchemaEtagMismatchError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The schema id. - example: abc - eTag: - type: string - description: The eTag. - example: 33a64df551425fcc55e4d42a148795d9f25f89d4 - required: - - id - example: - general: - status: 412 - title: Schema eTag Mismatch - detail: Schema with id 'abc' does not match the given etag '33a64df551425fcc55e4d42a148795d9f25f89d4'. - id: abc - eTag: 33a64df551425fcc55e4d42a148795d9f25f89d4 - type: https://hivemq.com/edge/api/model/SchemaEtagMismatchError - SchemaInsufficientStorageError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The policy id. - example: abc - required: - - id - example: - general: - status: 507 - title: Schema Insufficient Storage - detail: Schema with ID '123' could not be added because of insufficient server storage. - id: abc - type: https://hivemq.com/edge/api/model/SchemaInsufficientStorageError - SchemaValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - oneOf: - - $ref: '#/components/schemas/EmptyFieldValidationError' - - $ref: '#/components/schemas/InvalidFieldLengthValidationError' - - $ref: '#/components/schemas/InvalidFieldValueValidationError' - - $ref: '#/components/schemas/InvalidIdentifierValidationError' - - $ref: '#/components/schemas/MissingFieldValidationError' - - $ref: '#/components/schemas/UnsupportedFieldValidationError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' - https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' - https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' - https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' - https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' - https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' - SchemaInvalidErrors: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - childErrors: - type: array - description: List of child validation errors. - items: - $ref: '#/components/schemas/SchemaValidationError' - required: - - childErrors - example: - general: - status: 400 - title: Schema Invalid - detail: Schema is invalid due to validation errors. - type: https://hivemq.com/edge/api/model/SchemaInvalidErrors - childErrors: - - detail: The length of script field '$.id' 1025 must be between 0 and 1024. - paths: $.id - value: aaa...aaa - actualLength: 1025 - expectedMinimumLength: 0 - expectedMaximumLength: 1024 - type: https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError - SchemaNotFoundError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The schema ID. - example: abc - required: - - id - example: - general: - status: 404 - title: Schema Not Found - detail: Schema with ID 'abc' is not found. - id: abc - type: https://hivemq.com/edge/api/model/SchemaNotFoundError - SchemaParsingFailureError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - alias: - type: string - description: The schema alias. - example: abc - required: - - alias - example: - general: - status: 400 - title: Schema Parsing Failure - detail: The given schema 'abc' could not be parsed. - alias: abc - type: https://hivemq.com/edge/api/model/SchemaParsingFailureError - SchemaReferencedError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The schema ID. - example: abc - required: - - id - example: - general: - status: 400 - title: Schema Referenced - detail: Schema with ID 'abc' is referenced. - id: abc - type: https://hivemq.com/edge/api/model/SchemaReferencedError - ScriptAlreadyPresentError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The script id. - example: abc - required: - - id - example: - general: - status: 409 - title: Script Already Present - detail: The given script 'abc' is already present. - id: abc - type: https://hivemq.com/edge/api/model/ScriptAlreadyPresentError - ScriptCreationFailureError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 400 - title: Script Creation Failure - detail: The given script could not be created. - type: https://hivemq.com/edge/api/model/ScriptCreationFailureError - ScriptEtagMismatchError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The script id. - example: abc - eTag: - type: string - description: The eTag. - example: 33a64df551425fcc55e4d42a148795d9f25f89d4 - required: - - id - example: - general: - status: 412 - title: Script eTag Mismatch - detail: Script with id 'abc' does not match the given etag '33a64df551425fcc55e4d42a148795d9f25f89d4'. - id: abc - eTag: 33a64df551425fcc55e4d42a148795d9f25f89d4 - type: https://hivemq.com/edge/api/model/ScriptEtagMismatchError - ScriptInsufficientStorageError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The policy id. - example: abc - required: - - id - example: - general: - status: 507 - title: Script Insufficient Storage - detail: Script with ID '123' could not be added because of insufficient server storage. - id: abc - type: https://hivemq.com/edge/api/model/ScriptInsufficientStorageError - ScriptValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - oneOf: - - $ref: '#/components/schemas/InvalidFieldLengthValidationError' - - $ref: '#/components/schemas/InvalidFieldValueValidationError' - - $ref: '#/components/schemas/InvalidIdentifierValidationError' - - $ref: '#/components/schemas/MissingFieldValidationError' - - $ref: '#/components/schemas/UnsupportedFieldValidationError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' - https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' - https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' - https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' - https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' - ScriptInvalidErrors: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - childErrors: - type: array - description: List of child validation errors. - items: - $ref: '#/components/schemas/ScriptValidationError' - required: - - childErrors - example: - general: - status: 400 - title: Script Invalid - detail: Script is invalid due to validation errors. - type: https://hivemq.com/edge/api/model/ScriptInvalidErrors - childErrors: - - detail: The length of script field '$.id' 1025 must be between 0 and 1024. - paths: $.id - value: aaa...aaa - actualLength: 1025 - expectedMinimumLength: 0 - expectedMaximumLength: 1024 - type: https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError - ScriptNotFoundError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The script ID. - example: abc - required: - - id - example: - general: - status: 404 - title: Script Not Found - detail: Script with ID 'abc' is not found. - id: abc - type: https://hivemq.com/edge/api/model/ScriptNotFoundError - ScriptParsingFailureError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 400 - title: Script Parsing Failure - detail: The given script 'abc' could not be parsed. - type: https://hivemq.com/edge/api/model/ScriptParsingFailureError - ScriptReferencedError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The script ID. - example: abc - required: - - id - example: - general: - status: 400 - title: Script Referenced - detail: Script with ID 'abc' is referenced. - id: abc - type: https://hivemq.com/edge/api/model/ScriptReferencedError - ScriptSanitationFailureError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 400 - title: Script Sanitation Failure - detail: The given script could not be sanitized. - type: https://hivemq.com/edge/api/model/ScriptSanitationFailureError - TopicFilterMismatchError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - path: - type: string - description: The json path of the topic filter. - example: $.filter - required: - - path - example: - general: - status: 400 - title: Topic Filter Mismatch - detail: The topic filter '$.filter' mismatches. - type: https://hivemq.com/edge/api/model/TopicFilterMismatchError - InsufficientStorageError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 507 - title: Insufficient Storage - detail: Insufficient Storage. - type: https://hivemq.com/edge/api/model/InsufficientStorageError - InternalServerError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 500 - title: Internal Server Error - detail: An unexpected error occurred, check the logs. - type: https://hivemq.com/edge/api/model/InternalServerError - creation: - status: 500 - title: Internal Server Error - detail: 'An unexpected error occurred: Exception during creation of the Json Schema for functions.' - type: https://hivemq.com/edge/api/model/InternalServerError - InvalidQueryParameterError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - parameter: - type: string - description: The query parameter. - required: - - parameter - example: - general: - status: 400 - title: Query Parameter is Invalid - detail: 'Query parameter ''a'' is invalid: ''a'' could not be parsed.' - parameter: a - type: https://hivemq.com/edge/api/model/InvalidQueryParameterError - PreconditionFailedError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 412 - title: Precondition Failed - detail: 'A precondition required for fulfilling the request was not fulfilled: Policy does not match the given etag ''abc''.' - type: https://hivemq.com/edge/api/model/PreconditionFailedError - RequestBodyMissingError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 400 - title: Required Request Body Missing - detail: Required request body is missing. - type: https://hivemq.com/edge/api/model/RequestBodyMissingError - RequestBodyParameterMissingError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - parameter: - type: string - description: The the missing request body parameter. - required: - - parameter - example: - general: - status: 400 - title: Required Request Body Parameter Missing - detail: Required request body parameter 'a' is missing. - parameter: a - type: https://hivemq.com/edge/api/model/RequestBodyParameterMissingError - TemporaryNotAvailableError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 503 - title: Endpoint Temporarily not Available - detail: The endpoint is temporarily not available, please try again later. - type: https://hivemq.com/edge/api/model/TemporaryNotAvailableError - UrlParameterMissingError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - parameter: - type: string - description: The name of the missing parameter. - required: - - parameter - example: - general: - status: 400 - title: Required URL Parameter Missing - detail: Required URL parameter 'a' is missing. - parameter: a - type: https://hivemq.com/edge/api/model/UrlParameterMissingError JsonNode: type: object description: The arguments of the fsm derived from the behavior policy. @@ -6602,6 +5153,8 @@ components: description: List of result items that are returned by this endpoint items: $ref: '#/components/schemas/DataPolicy' + Errors: + type: object PolicyType: description: The type of policy in Data Hub type: string diff --git a/ext/hivemq-edge-openapi-2025.15.yaml b/ext/hivemq-edge-openapi-2025.15.yaml index 16b9ba5dfb..bb996cf852 100644 --- a/ext/hivemq-edge-openapi-2025.15.yaml +++ b/ext/hivemq-edge-openapi-2025.15.yaml @@ -14,7 +14,7 @@ info: ## OpenAPI HiveMQ's REST API provides an OpenAPI 3.0 schema definition that can imported into popular API tooling (e.g. Postman) or can be used to generate client-code for multiple programming languages. title: HiveMQ Edge REST API - version: 2025.15-SNAPSHOT + version: 2025.14-SNAPSHOT x-logo: url: https://www.hivemq.com/img/svg/hivemq-bee.svg tags: @@ -357,23 +357,12 @@ paths: schema: $ref: '#/components/schemas/BehaviorPolicyList' description: Success - '400': - content: - application/problem+json: - schema: - oneOf: - - $ref: '#/components/schemas/InvalidQueryParameterError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' - description: URL parameter missing '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable + $ref: '#/components/schemas/ProblemDetails' + description: Temporarily not available summary: Get all policies tags: - Data Hub - Behavior Policies @@ -458,45 +447,34 @@ paths: description: Success '400': content: - application/problem+json: - schema: - oneOf: - - $ref: '#/components/schemas/BehaviorPolicyCreationFailureError' - - $ref: '#/components/schemas/BehaviorPolicyInvalidErrors' - - $ref: '#/components/schemas/BehaviorPolicyRejectedError' - - $ref: '#/components/schemas/RequestBodyMissingError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError: '#/components/schemas/BehaviorPolicyCreationFailureError' - https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors: '#/components/schemas/BehaviorPolicyInvalidErrors' - https://hivemq.com/edge/api/model/BehaviorPolicyRejectedError: '#/components/schemas/BehaviorPolicyRejectedError' - https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' description: Policy creation failed '409': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/BehaviorPolicyAlreadyPresentError' - description: Behavior policy already present + $ref: '#/components/schemas/ProblemDetails' + description: Already exists '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' - description: Internal server error + $ref: '#/components/schemas/ProblemDetails' + description: Internal error '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable + $ref: '#/components/schemas/ProblemDetails' + description: Temporarily unavailable '507': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/PolicyInsufficientStorageError' - description: Insufficient storage + $ref: '#/components/schemas/ProblemDetails' + description: Insufficient storage error summary: Create a new policy tags: - Data Hub - Behavior Policies @@ -526,39 +504,34 @@ paths: description: Success, no response body '400': content: - application/problem+json: + application/json: schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + $ref: '#/components/schemas/ProblemDetails' description: URL parameter missing '404': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/PolicyNotFoundError' - description: Behavior policy not found + $ref: '#/components/schemas/ProblemDetails' + description: Policy not found '412': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/PreconditionFailedError' + $ref: '#/components/schemas/ProblemDetails' description: Precondition failed '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' - description: Internal server error + $ref: '#/components/schemas/ProblemDetails' + description: Internal error '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable + $ref: '#/components/schemas/ProblemDetails' + description: Temporarily not available summary: Delete a behavior policy tags: - Data Hub - Behavior Policies @@ -626,33 +599,16 @@ paths: description: Success '400': content: - application/problem+json: + application/json: schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' - description: Bad request + $ref: '#/components/schemas/ProblemDetails' + description: Invalid query parameter '404': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/BehaviorPolicyNotFoundError' + $ref: '#/components/schemas/ProblemDetails' description: Policy not found - '500': - content: - application/problem+json: - schema: - $ref: '#/components/schemas/InternalServerError' - description: Internal server error - '503': - content: - application/problem+json: - schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable summary: Get a policy tags: - Data Hub - Behavior Policies @@ -753,56 +709,41 @@ paths: description: Success '400': content: - application/problem+json: - schema: - oneOf: - - $ref: '#/components/schemas/RequestBodyMissingError' - - $ref: '#/components/schemas/UrlParameterMissingError' - - $ref: '#/components/schemas/BehaviorPolicyCreationFailureError' - - $ref: '#/components/schemas/BehaviorPolicyInvalidErrors' - - $ref: '#/components/schemas/BehaviorPolicyUpdateFailureError' - - $ref: '#/components/schemas/PolicyIdMismatchError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' - https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError: '#/components/schemas/BehaviorPolicyCreationFailureError' - https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors: '#/components/schemas/BehaviorPolicyInvalidErrors' - https://hivemq.com/edge/api/model/BehaviorPolicyUpdateFailureError: '#/components/schemas/BehaviorPolicyUpdateFailureError' - https://hivemq.com/edge/api/model/PolicyIdMismatchError: '#/components/schemas/PolicyIdMismatchError' - description: Behavior policy creation failed + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: Policy creation failed '404': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/BehaviorPolicyNotFoundError' - description: Data policy not found + $ref: '#/components/schemas/ProblemDetails' + description: Policy not found '412': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/PreconditionFailedError' + $ref: '#/components/schemas/ProblemDetails' description: Precondition failed '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' - description: Internal server error + $ref: '#/components/schemas/ProblemDetails' + description: Internal error '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable + $ref: '#/components/schemas/ProblemDetails' + description: Temporarily unavailable '507': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/PolicyInsufficientStorageError' - description: Insufficient storage - summary: Update an existing behavior policy + $ref: '#/components/schemas/ProblemDetails' + description: Insufficient storage error + summary: Update an existing policy tags: - Data Hub - Behavior Policies /api/v1/data-hub/behavior-validation/states/{clientId}: @@ -846,34 +787,22 @@ paths: description: Success '400': content: - application/problem+json: + application/json: schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + $ref: '#/components/schemas/ProblemDetails' description: URL parameter missing '404': content: - application/problem+json: - schema: - oneOf: - - $ref: '#/components/schemas/ClientDisconnectedError' - - $ref: '#/components/schemas/ClientNotFoundError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/ClientDisconnectedError: '#/components/schemas/ClientDisconnectedError' - https://hivemq.com/edge/api/model/ClientNotFoundError: '#/components/schemas/ClientNotFoundError' - description: Client error + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: Client is disconnected '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' - description: Internal server error + $ref: '#/components/schemas/ProblemDetails' + description: Internal Server error summary: Get the state of a client tags: - Data Hub - State @@ -1122,20 +1051,27 @@ paths: description: Success '400': content: - application/problem+json: + application/json: schema: - oneOf: - - $ref: '#/components/schemas/InvalidQueryParameterError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' + $ref: '#/components/schemas/ProblemDetails' description: URL parameter missing + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: DataPolicy not found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: Internal server error '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' + $ref: '#/components/schemas/ProblemDetails' description: Request resource temporary unavailable summary: Get all data policies tags: @@ -1219,44 +1155,33 @@ paths: description: Success '400': content: - application/problem+json: - schema: - oneOf: - - $ref: '#/components/schemas/RequestBodyMissingError' - - $ref: '#/components/schemas/DataPolicyCreationFailureError' - - $ref: '#/components/schemas/DataPolicyInvalidErrors' - - $ref: '#/components/schemas/DataPolicyRejectedError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' - https://hivemq.com/edge/api/model/DataPolicyCreationFailureError: '#/components/schemas/DataPolicyCreationFailureError' - https://hivemq.com/edge/api/model/DataPolicyInvalidErrors: '#/components/schemas/DataPolicyInvalidErrors' - https://hivemq.com/edge/api/model/DataPolicyRejectedError: '#/components/schemas/DataPolicyRejectedError' - description: Data policy creation failed + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: DataPolicy creation failed '409': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/DataPolicyAlreadyPresentError' - description: Data policy already present + $ref: '#/components/schemas/ProblemDetails' + description: DataPolicy already present '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' + $ref: '#/components/schemas/ProblemDetails' description: Request resource temporary unavailable '507': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/PolicyInsufficientStorageError' + $ref: '#/components/schemas/ProblemDetails' description: Insufficient storage summary: Create a new data policy tags: @@ -1287,38 +1212,27 @@ paths: description: Success, no response body '400': content: - application/problem+json: + application/json: schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + $ref: '#/components/schemas/ProblemDetails' description: URL parameter missing '404': content: - application/problem+json: - schema: - $ref: '#/components/schemas/PolicyNotFoundError' - description: Data policy not found - '412': - content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/PreconditionFailedError' - description: Precondition failed + $ref: '#/components/schemas/ProblemDetails' + description: DataPolicy not found '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' + $ref: '#/components/schemas/ProblemDetails' description: Request resource temporary unavailable summary: Delete a data policy tags: @@ -1386,33 +1300,32 @@ paths: description: Success '400': content: - application/problem+json: + application/json: + examples: + param-missing: + description: Example response when a required parameter is missing. + summary: Required URL parameter missing + value: + errors: + - title: Required parameter missing + detail: Required URL parameter 'parameterName' is missing schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + $ref: '#/components/schemas/ProblemDetails' description: Bad request '404': content: - application/problem+json: + application/json: + examples: + not-found: + description: Policy not found + summary: Not found + value: + errors: + - title: Resource not found + detail: Resource with id 'my-resource-id' not found schema: - $ref: '#/components/schemas/PolicyNotFoundError' + $ref: '#/components/schemas/ProblemDetails' description: Resource not found - '500': - content: - application/problem+json: - schema: - $ref: '#/components/schemas/InternalServerError' - description: Internal server error - '503': - content: - application/problem+json: - schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable summary: Get a data policy tags: - Data Hub - Data Policies @@ -1512,56 +1425,33 @@ paths: description: Success '400': content: - application/problem+json: - schema: - oneOf: - - $ref: '#/components/schemas/RequestBodyMissingError' - - $ref: '#/components/schemas/UrlParameterMissingError' - - $ref: '#/components/schemas/DataPolicyCreationFailureError' - - $ref: '#/components/schemas/DataPolicyInvalidErrors' - - $ref: '#/components/schemas/DataPolicyUpdateFailureError' - - $ref: '#/components/schemas/PolicyIdMismatchError' - - $ref: '#/components/schemas/TopicFilterMismatchError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' - https://hivemq.com/edge/api/model/DataPolicyCreationFailureError: '#/components/schemas/DataPolicyCreationFailureError' - https://hivemq.com/edge/api/model/DataPolicyInvalidErrors: '#/components/schemas/DataPolicyInvalidErrors' - https://hivemq.com/edge/api/model/DataPolicyUpdateFailureError: '#/components/schemas/DataPolicyUpdateFailureError' - https://hivemq.com/edge/api/model/PolicyIdMismatchError: '#/components/schemas/PolicyIdMismatchError' - https://hivemq.com/edge/api/model/TopicFilterMismatchError: '#/components/schemas/TopicFilterMismatchError' - description: Data policy creation failed - '404': - content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/DataPolicyNotFoundError' - description: Data policy not found - '412': + $ref: '#/components/schemas/ProblemDetails' + description: DataPolicy creation failed + '404': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/PreconditionFailedError' - description: Precondition failed + $ref: '#/components/schemas/ProblemDetails' + description: DataPolicy not found '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' + $ref: '#/components/schemas/ProblemDetails' description: Request resource temporary unavailable '507': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/PolicyInsufficientStorageError' + $ref: '#/components/schemas/ProblemDetails' description: Insufficient storage summary: Update an existing data policy tags: @@ -1647,9 +1537,9 @@ paths: description: Success '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/Errors' description: Internal server error summary: Get all FSMs as a JSON Schema tags: @@ -1809,9 +1699,9 @@ paths: description: Success '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error summary: Get all functions as a JSON Schema tags: @@ -1829,9 +1719,9 @@ paths: description: Success '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error summary: Get all interpolation variables tags: @@ -1849,9 +1739,9 @@ paths: description: Success '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error summary: Get all functions as a list of function specifications tags: @@ -1986,22 +1876,11 @@ paths: schema: $ref: '#/components/schemas/SchemaList' description: Success - '400': - content: - application/problem+json: - schema: - oneOf: - - $ref: '#/components/schemas/InvalidQueryParameterError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' - description: URL parameter missing '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' + $ref: '#/components/schemas/ProblemDetails' description: Request resource temporary unavailable summary: Get all schemas tags: @@ -2048,48 +1927,33 @@ paths: description: Success '400': content: - application/problem+json: - schema: - oneOf: - - $ref: '#/components/schemas/RequestBodyParameterMissingError' - - $ref: '#/components/schemas/SchemaInvalidErrors' - - $ref: '#/components/schemas/SchemaParsingFailureError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/RequestBodyParameterMissingError: '#/components/schemas/RequestBodyParameterMissingError' - https://hivemq.com/edge/api/model/SchemaInvalidErrors: '#/components/schemas/SchemaInvalidErrors' - https://hivemq.com/edge/api/model/SchemaParsingFailureError: '#/components/schemas/SchemaParsingFailureError' - description: Schema creation failed + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: Schema could not be validatetd '409': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/SchemaAlreadyPresentError' - description: Schema is already present + $ref: '#/components/schemas/ProblemDetails' + description: Schema already exists '412': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/SchemaEtagMismatchError' - description: Schema doesn't match etag + $ref: '#/components/schemas/ProblemDetails' + description: Mismatch between schema and etag '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error - '503': - content: - application/problem+json: - schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable '507': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/SchemaInsufficientStorageError' + $ref: '#/components/schemas/ProblemDetails' description: Insufficient storage summary: Create a new schema tags: @@ -2120,40 +1984,33 @@ paths: description: Success, no response body '400': content: - application/problem+json: + application/json: schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - - $ref: '#/components/schemas/SchemaReferencedError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' - https://hivemq.com/edge/api/model/SchemaReferencedError: '#/components/schemas/SchemaReferencedError' - description: URL parameter missing + $ref: '#/components/schemas/ProblemDetails' + description: Schema referenced '404': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/SchemaNotFoundError' + $ref: '#/components/schemas/ProblemDetails' description: Schema not found '412': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/SchemaEtagMismatchError' - description: Schema doesn't match etag + $ref: '#/components/schemas/ProblemDetails' + description: Mismatch between schema and etag '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' - description: Internal Server error + $ref: '#/components/schemas/ProblemDetails' + description: Internal server error '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' + $ref: '#/components/schemas/ProblemDetails' description: Request resource temporary unavailable summary: Delete all versions of the schema tags: @@ -2199,33 +2056,22 @@ paths: description: Success '400': content: - application/problem+json: + application/json: schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' - description: URL parameter missing + $ref: '#/components/schemas/ProblemDetails' + description: A url parameter is missing '404': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/SchemaNotFoundError' + $ref: '#/components/schemas/ProblemDetails' description: Schema not found '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error - '503': - content: - application/problem+json: - schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable summary: Get a schema tags: - Data Hub - Schemas @@ -2346,23 +2192,12 @@ paths: schema: $ref: '#/components/schemas/ScriptList' description: Success - '400': - content: - application/problem+json: - schema: - oneOf: - - $ref: '#/components/schemas/InvalidQueryParameterError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' - description: URL parameter missing '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable + $ref: '#/components/schemas/ProblemDetails' + description: Temporary not available summary: Get all scripts tags: - Data Hub - Scripts @@ -2408,52 +2243,39 @@ paths: description: Success '400': content: - application/problem+json: - schema: - oneOf: - - $ref: '#/components/schemas/RequestBodyParameterMissingError' - - $ref: '#/components/schemas/ScriptCreationFailureError' - - $ref: '#/components/schemas/ScriptInvalidErrors' - - $ref: '#/components/schemas/ScriptParsingFailureError' - - $ref: '#/components/schemas/ScriptSanitationFailureError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/RequestBodyParameterMissingError: '#/components/schemas/RequestBodyParameterMissingError' - https://hivemq.com/edge/api/model/ScriptCreationFailureError: '#/components/schemas/ScriptCreationFailureError' - https://hivemq.com/edge/api/model/ScriptInvalidErrors: '#/components/schemas/ScriptInvalidErrors' - https://hivemq.com/edge/api/model/ScriptParsingFailureError: '#/components/schemas/ScriptParsingFailureError' - https://hivemq.com/edge/api/model/ScriptSanitationFailureError: '#/components/schemas/ScriptSanitationFailureError' - description: Script creation failed + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: Script is invalid '409': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/ScriptAlreadyPresentError' + $ref: '#/components/schemas/ProblemDetails' description: Script is already present '412': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/ScriptEtagMismatchError' + $ref: '#/components/schemas/ProblemDetails' description: Script doesn't match etag '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable + $ref: '#/components/schemas/ProblemDetails' + description: Temporary not available '507': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/ScriptInsufficientStorageError' + $ref: '#/components/schemas/ProblemDetails' description: Insufficient storage summary: Create a new script tags: @@ -2481,41 +2303,34 @@ paths: description: Success, no response body '400': content: - application/problem+json: + application/json: schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - - $ref: '#/components/schemas/ScriptReferencedError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' - https://hivemq.com/edge/api/model/ScriptReferencedError: '#/components/schemas/ScriptReferencedError' - description: URL parameter missing + $ref: '#/components/schemas/ProblemDetails' + description: Script is referenced '404': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/ScriptNotFoundError' + $ref: '#/components/schemas/ProblemDetails' description: Script not found '412': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/ScriptEtagMismatchError' + $ref: '#/components/schemas/ProblemDetails' description: Script doesn't match etag '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal Server error '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable + $ref: '#/components/schemas/ProblemDetails' + description: Temporary not available summary: Delete a script tags: - Data Hub - Scripts @@ -2556,33 +2371,28 @@ paths: description: Success '400': content: - application/problem+json: + application/json: schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + $ref: '#/components/schemas/ProblemDetails' description: URL parameter missing '404': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/ScriptNotFoundError' + $ref: '#/components/schemas/ProblemDetails' description: Script not found '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal Server error '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable + $ref: '#/components/schemas/ProblemDetails' + description: Temporary not available summary: Get a script tags: - Data Hub - Scripts @@ -5106,7 +4916,6 @@ components: detail: type: string errors: - deprecated: true type: array items: $ref: '#/components/schemas/Error' @@ -5271,1264 +5080,6 @@ components: description: List of result items that are returned by this endpoint items: $ref: '#/components/schemas/BehaviorPolicy' - ApiProblemDetails: - allOf: - - $ref: '#/components/schemas/ProblemDetails' - - type: object - required: - - detail - - status - - type - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/BehaviorPolicyAlreadyPresentError: '#/components/schemas/BehaviorPolicyAlreadyPresentError' - https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError: '#/components/schemas/BehaviorPolicyCreationFailureError' - https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors: '#/components/schemas/BehaviorPolicyInvalidErrors' - https://hivemq.com/edge/api/model/BehaviorPolicyNotFoundError: '#/components/schemas/BehaviorPolicyNotFoundError' - https://hivemq.com/edge/api/model/BehaviorPolicyRejectedError: '#/components/schemas/BehaviorPolicyRejectedError' - https://hivemq.com/edge/api/model/BehaviorPolicyUpdateFailureError: '#/components/schemas/BehaviorPolicyUpdateFailureError' - https://hivemq.com/edge/api/model/ClientDisconnectedError: '#/components/schemas/ClientDisconnectedError' - https://hivemq.com/edge/api/model/ClientNotFoundError: '#/components/schemas/ClientNotFoundError' - https://hivemq.com/edge/api/model/DataPolicyAlreadyPresentError: '#/components/schemas/DataPolicyAlreadyPresentError' - https://hivemq.com/edge/api/model/DataPolicyCreationFailureError: '#/components/schemas/DataPolicyCreationFailureError' - https://hivemq.com/edge/api/model/DataPolicyInvalidErrors: '#/components/schemas/DataPolicyInvalidErrors' - https://hivemq.com/edge/api/model/DataPolicyNotFoundError: '#/components/schemas/DataPolicyNotFoundError' - https://hivemq.com/edge/api/model/DataPolicyRejectedError: '#/components/schemas/DataPolicyRejectedError' - https://hivemq.com/edge/api/model/DataPolicyUpdateFailureError: '#/components/schemas/DataPolicyUpdateFailureError' - https://hivemq.com/edge/api/model/PolicyIdMismatchError: '#/components/schemas/PolicyIdMismatchError' - https://hivemq.com/edge/api/model/PolicyInsufficientStorageError: '#/components/schemas/PolicyInsufficientStorageError' - https://hivemq.com/edge/api/model/PolicyNotFoundError: '#/components/schemas/PolicyNotFoundError' - https://hivemq.com/edge/api/model/SchemaAlreadyPresentError: '#/components/schemas/SchemaAlreadyPresentError' - https://hivemq.com/edge/api/model/SchemaEtagMismatchError: '#/components/schemas/SchemaEtagMismatchError' - https://hivemq.com/edge/api/model/SchemaInsufficientStorageError: '#/components/schemas/SchemaInsufficientStorageError' - https://hivemq.com/edge/api/model/SchemaInvalidErrors: '#/components/schemas/SchemaInvalidErrors' - https://hivemq.com/edge/api/model/SchemaNotFoundError: '#/components/schemas/SchemaNotFoundError' - https://hivemq.com/edge/api/model/SchemaParsingFailureError: '#/components/schemas/SchemaParsingFailureError' - https://hivemq.com/edge/api/model/SchemaReferencedError: '#/components/schemas/SchemaReferencedError' - https://hivemq.com/edge/api/model/ScriptAlreadyPresentError: '#/components/schemas/ScriptAlreadyPresentError' - https://hivemq.com/edge/api/model/ScriptCreationFailureError: '#/components/schemas/ScriptCreationFailureError' - https://hivemq.com/edge/api/model/ScriptEtagMismatchError: '#/components/schemas/ScriptEtagMismatchError' - https://hivemq.com/edge/api/model/ScriptInsufficientStorageError: '#/components/schemas/ScriptInsufficientStorageError' - https://hivemq.com/edge/api/model/ScriptInvalidErrors: '#/components/schemas/ScriptInvalidErrors' - https://hivemq.com/edge/api/model/ScriptNotFoundError: '#/components/schemas/ScriptNotFoundError' - https://hivemq.com/edge/api/model/ScriptParsingFailureError: '#/components/schemas/ScriptParsingFailureError' - https://hivemq.com/edge/api/model/ScriptReferencedError: '#/components/schemas/ScriptReferencedError' - https://hivemq.com/edge/api/model/ScriptSanitationFailureError: '#/components/schemas/ScriptSanitationFailureError' - https://hivemq.com/edge/api/model/TopicFilterMismatchError: '#/components/schemas/TopicFilterMismatchError' - https://hivemq.com/edge/api/model/InsufficientStorageError: '#/components/schemas/InsufficientStorageError' - https://hivemq.com/edge/api/model/InternalServerError: '#/components/schemas/InternalServerError' - https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' - https://hivemq.com/edge/api/model/PreconditionFailedError: '#/components/schemas/PreconditionFailedError' - https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' - https://hivemq.com/edge/api/model/RequestBodyParameterMissingError: '#/components/schemas/RequestBodyParameterMissingError' - https://hivemq.com/edge/api/model/TemporaryNotAvailableError: '#/components/schemas/TemporaryNotAvailableError' - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' - BehaviorPolicyAlreadyPresentError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The behavior policy id. - example: abc - required: - - id - example: - general: - status: 409 - title: Behavior Policy Already Present - detail: The given behavior policy 'abc' is already present. - id: abc - type: https://hivemq.com/edge/api/model/BehaviorPolicyAlreadyPresentError - BehaviorPolicyCreationFailureError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 400 - title: Behavior Policy Creation Failed - detail: 'Behavior policy creation failed: The policy was rejected.' - type: https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError - AtLeastOneFieldMissingValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - paths: - type: array - description: The missing json paths. - items: - type: string - format: json-path - description: The json path. - example: - - $.field1 - - $.field2 - required: - - paths - example: - general: - detail: 'At least one of the fields must be present: ''$.field1'', ''$.field2''.' - paths: - - $.field1 - - $.field2 - type: https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError - ValidationError: - type: object - properties: - detail: - type: string - description: Detailed contextual description of the validation error. - type: - type: string - format: uri - description: Type of the validation error. - required: - - detail - - type - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError: '#/components/schemas/AtLeastOneFieldMissingValidationError' - https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError: '#/components/schemas/AtMostOneFunctionValidationError' - https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' - https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError: '#/components/schemas/FunctionMustBePairedValidationError' - https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError: '#/components/schemas/IllegalEventTransitionValidationError' - https://hivemq.com/edge/api/model/IllegalFunctionValidationError: '#/components/schemas/IllegalFunctionValidationError' - https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' - https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' - https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError: '#/components/schemas/InvalidFunctionOrderValidationError' - https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' - https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError: '#/components/schemas/InvalidSchemaVersionValidationError' - https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' - https://hivemq.com/edge/api/model/UnknownVariableValidationError: '#/components/schemas/UnknownVariableValidationError' - https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' - AtMostOneFunctionValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - function: - type: string - description: The function. - example: function1 - occurrences: - type: integer - format: int32 - description: The occurrences of the function. - minimum: 0 - example: 3 - paths: - type: array - items: - type: string - format: json-path - description: The json paths where the function occurs. - example: - - $.path1 - - $.path2 - - $.path3 - required: - - function - - occurrences - - paths - example: - general: - detail: The pipeline must contain at most one 'function1' function, but 3 were found at ['$.path1', '$.path2', '$.path3']. - function: function1 - occurrences: 3 - paths: - - $.path1 - - $.path2 - - $.path3 - type: https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError - EmptyFieldValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - path: - type: string - format: json-path - description: The missing field. - example: $.field - required: - - path - example: - general: - detail: Required field '$.field' is empty. - path: $.field - type: https://hivemq.com/edge/api/model/EmptyFieldValidationError - FunctionMustBePairedValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - existingFunction: - type: string - description: The existing function. - example: function1 - missingFunction: - type: string - description: The missing function. - example: function2 - required: - - existingFunction - - missingFunction - example: - general: - detail: If 'function1' function is present in the pipeline, 'function2' function must be present as well. - existingFunction: function1 - missingFunction: function2 - type: https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError - IllegalEventTransitionValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - event: - type: string - description: The event name. - example: event1 - fromState: - type: string - description: The event from state. - example: state1 - id: - type: string - description: The event id. - example: abc - path: - type: string - description: The path. - example: $.event - toState: - type: string - description: The event to state. - example: state2 - required: - - event - - fromState - - id - - path - - toState - example: - general: - detail: The transition from state 'state1' to state 'state2' on event 'event1' in '$.event' is not defined for behavior 'abc'. - event: event1 - fromState: state1 - toState: state2 - id: abc - path: $.event - type: https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError - IllegalFunctionValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - event: - type: string - description: The event name. - example: event1 - id: - type: string - description: The function id. - example: abc - path: - type: string - format: json-path - description: The json path. - example: $.event - required: - - event - - id - - path - example: - general: - detail: The function 'abc' is not allowed for event 'event1' in '$.event'. - event: event1 - id: abc - path: $.event - type: https://hivemq.com/edge/api/model/IllegalFunctionValidationError - InvalidFieldLengthValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - actualLength: - type: integer - format: int32 - description: The actual length of the field value. - example: 10 - expectedMinimumLength: - type: integer - format: int32 - description: The minimum length expected for the field value. - minimum: 0 - example: 5 - expectedMaximumLength: - type: integer - format: int32 - description: The maximum length expected for the field value. - minimum: 0 - example: 20 - path: - type: string - format: json-path - description: The invalid json path. - example: $.field - value: - type: string - description: The invalid value. - example: function transform() { return 'Hello, World!'; } - required: - - actualLength - - expectedMinimumLength - - expectedMaximumLength - - path - - value - example: - general: - detail: The length of script field '$.transform' 48 must be between 0 and 20. - actualLength: 48 - minimumLength: 0 - maximumLength: 20 - path: $.transform - value: function transform() { return 'Hello, World!'; } - type: https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError - InvalidFieldValueValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - path: - type: string - format: json-path - description: The invalid json path. - example: $.action.pipeline[1].field - value: - type: string - description: The invalid value. - example: functionDoesNotExist - required: - - path - example: - general: - detail: Referenced function does not exist. - path: $.action.pipeline[1].field - value: functionDoesNotExist - type: https://hivemq.com/edge/api/model/InvalidFieldValueValidationError - InvalidFunctionOrderValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - function: - type: string - description: The function. - example: transform - path: - type: string - format: json-path - description: The json path. - example: $.path - previousFunction: - type: string - description: The previous function. - example: init - required: - - function - - path - - previousFunction - example: - general: - detail: The operation at '$.path' with the functionId 'transform' must be after a 'init' operation. - function: transform - path: $.path - previousFunction: init - type: https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError - InvalidIdentifierValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - path: - type: string - format: json-path - description: The invalid identifier path. - example: $.id - value: - type: string - description: The invalid identifier value. - example: invalidId - required: - - path - - value - example: - general: - detail: Identifier script 'id' must begin with a letter and may only consist of lowercase letters, uppercase letters, numbers, periods, hyphens, and underscores. - path: $.id - value: invalidId - type: https://hivemq.com/edge/api/model/InvalidIdentifierValidationError - InvalidSchemaVersionValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - id: - type: string - description: The schema id. - example: abc - version: - type: string - description: The schema version. - example: '2' - required: - - id - - version - example: - general: - detail: The referenced schema with id 'abc' and version '2' was not found. - id: abc - version: '2' - type: https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError - MissingFieldValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - path: - type: string - format: json-path - description: The missing path. - example: $.id - required: - - path - example: - general: - detail: Required field '$.id' is missing. - path: $.id - type: https://hivemq.com/edge/api/model/MissingFieldValidationError - UnknownVariableValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - path: - type: string - description: The json path of the field. - example: $.path - variables: - type: array - items: - type: string - description: The unknown variables. - example: - - a - - b - - c - required: - - path - - variables - example: - general: - detail: 'Field ''$.path'' contains unknown variables: [a, b, c].' - path: $.path - variables: - - a - - b - - c - type: https://hivemq.com/edge/api/model/UnknownVariableValidationError - UnsupportedFieldValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - actualValue: - type: string - description: The actual value. - expectedValue: - type: string - description: The expected value. - path: - type: string - format: json-path - description: The json path. - example: $.id - required: - - actualValue - - expectedValue - - path - example: - general: - detail: Unsupported type 'String' for field '$.id'. Expected type is 'Object'. - actualValue: String - expectedValue: Object - path: $.id - type: https://hivemq.com/edge/api/model/UnsupportedFieldValidationError - BehaviorPolicyValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - oneOf: - - $ref: '#/components/schemas/IllegalEventTransitionValidationError' - - $ref: '#/components/schemas/IllegalFunctionValidationError' - - $ref: '#/components/schemas/InvalidSchemaVersionValidationError' - - $ref: '#/components/schemas/AtLeastOneFieldMissingValidationError' - - $ref: '#/components/schemas/EmptyFieldValidationError' - - $ref: '#/components/schemas/InvalidFieldLengthValidationError' - - $ref: '#/components/schemas/InvalidFieldValueValidationError' - - $ref: '#/components/schemas/InvalidIdentifierValidationError' - - $ref: '#/components/schemas/MissingFieldValidationError' - - $ref: '#/components/schemas/UnsupportedFieldValidationError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError: '#/components/schemas/AtLeastOneFieldMissingValidationError' - https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' - https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError: '#/components/schemas/IllegalEventTransitionValidationError' - https://hivemq.com/edge/api/model/IllegalFunctionValidationError: '#/components/schemas/IllegalFunctionValidationError' - https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' - https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' - https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' - https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError: '#/components/schemas/InvalidSchemaVersionValidationError' - https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' - https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' - BehaviorPolicyInvalidErrors: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - childErrors: - type: array - description: List of child validation errors. - items: - $ref: '#/components/schemas/BehaviorPolicyValidationError' - required: - - childErrors - example: - general: - status: 400 - title: Behavior Policy Invalid - detail: Behavior policy is invalid due to validation errors. - type: https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors - childErrors: - - detail: The transition from state 'state1' to state 'state2' on event 'event1' in '$.path' is not defined for behavior 'id1'. - fromState: state1 - toState: state2 - path: $.path - id: id1 - type: https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError - BehaviorPolicyNotFoundError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The data policy id. - example: abc - required: - - id - example: - general: - status: 404 - title: Behavior Policy Not Found - detail: Behavior policy with ID 'abc' is not found. - id: abc - type: https://hivemq.com/edge/api/model/BehaviorPolicyNotFoundError - BehaviorPolicyRejectedError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 400 - title: Behavior Policy Rejected - detail: Behavior policy is rejected. - type: https://hivemq.com/edge/api/model/BehaviorPolicyRejectedError - BehaviorPolicyUpdateFailureError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The ID of the policy that failed to update. - example: abc - required: - - id - example: - general: - status: 400 - title: Behavior Policy Update Failed - detail: Behavior policy with ID 'abc' update failed. - id: abc - type: https://hivemq.com/edge/api/model/BehaviorPolicyUpdateFailureError - ClientDisconnectedError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The client id. - example: abc - required: - - id - example: - general: - status: 404 - title: Client Disconnected - detail: Client with ID 'abc' is disconnected. - id: abc - type: https://hivemq.com/edge/api/model/ClientDisconnectedError - ClientNotFoundError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The client id. - example: abc - required: - - id - example: - general: - status: 404 - title: Client Not Found - detail: Client with ID 'abc' is not found. - id: abc - type: https://hivemq.com/edge/api/model/ClientNotFoundError - DataPolicyAlreadyPresentError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The data policy id. - example: abc - required: - - id - example: - general: - status: 409 - title: Data Policy Already Present - detail: The given data policy 'abc' is already present. - id: abc - type: https://hivemq.com/edge/api/model/DataPolicyAlreadyPresentError - DataPolicyCreationFailureError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 400 - title: Data Policy Creation Failed - detail: 'Data policy creation failed: The policy was rejected.' - type: https://hivemq.com/edge/api/model/DataPolicyCreationFailureError - DataPolicyValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - oneOf: - - $ref: '#/components/schemas/AtMostOneFunctionValidationError' - - $ref: '#/components/schemas/FunctionMustBePairedValidationError' - - $ref: '#/components/schemas/InvalidFunctionOrderValidationError' - - $ref: '#/components/schemas/InvalidSchemaVersionValidationError' - - $ref: '#/components/schemas/UnknownVariableValidationError' - - $ref: '#/components/schemas/EmptyFieldValidationError' - - $ref: '#/components/schemas/InvalidFieldLengthValidationError' - - $ref: '#/components/schemas/InvalidFieldValueValidationError' - - $ref: '#/components/schemas/InvalidIdentifierValidationError' - - $ref: '#/components/schemas/MissingFieldValidationError' - - $ref: '#/components/schemas/UnsupportedFieldValidationError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError: '#/components/schemas/AtMostOneFunctionValidationError' - https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' - https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError: '#/components/schemas/FunctionMustBePairedValidationError' - https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' - https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' - https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError: '#/components/schemas/InvalidFunctionOrderValidationError' - https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' - https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError: '#/components/schemas/InvalidSchemaVersionValidationError' - https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' - https://hivemq.com/edge/api/model/UnknownVariableValidationError: '#/components/schemas/UnknownVariableValidationError' - https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' - DataPolicyInvalidErrors: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - childErrors: - type: array - description: List of child validation errors. - items: - $ref: '#/components/schemas/DataPolicyValidationError' - required: - - childErrors - example: - general: - status: 400 - title: Data Policy Invalid - detail: Data policy is invalid due to validation errors. - type: https://hivemq.com/edge/api/model/DataPolicyInvalidErrors - childErrors: - - detail: The pipeline must contain at most one 'function1' function, but 3 were found at ['$.path1', '$.path2', '$.path3']. - function: function1 - occurrences: 3 - paths: - - $.path1 - - $.path2 - - $.path3 - type: https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError - DataPolicyNotFoundError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The data policy id. - example: abc - required: - - id - example: - general: - status: 404 - title: Data Policy Not Found - detail: Data policy with ID 'abc' is not found. - id: abc - type: https://hivemq.com/edge/api/model/DataPolicyNotFoundError - DataPolicyRejectedError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 400 - title: Data Policy Rejected - detail: Data policy is rejected. - type: https://hivemq.com/edge/api/model/DataPolicyRejectedError - DataPolicyUpdateFailureError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The ID of the policy that failed to update. - example: abc - required: - - id - example: - general: - status: 400 - title: Data Policy Update Failed - detail: Data policy with ID 'abc' update failed. - id: abc - type: https://hivemq.com/edge/api/model/DataPolicyUpdateFailureError - PolicyIdMismatchError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - actualId: - type: string - description: The actual id. - example: id1 - expectedId: - type: string - description: The expected id. - example: id2 - required: - - actualId - - expectedId - example: - general: - status: 400 - title: Policy ID Mismatch - detail: The policy ID 'id1' in the request parameter does not match the policy ID 'id2' in the policy request body. - id: abc - type: https://hivemq.com/edge/api/model/PolicyIdMismatchError - PolicyInsufficientStorageError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The policy id. - example: abc - required: - - id - example: - general: - status: 507 - title: Policy Insufficient Storage - detail: Policy with ID '123' could not be added because of insufficient server storage. - id: abc - type: https://hivemq.com/edge/api/model/PolicyInsufficientStorageError - PolicyNotFoundError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The policy id. - example: abc - required: - - id - example: - general: - status: 404 - title: Policy Not Found - detail: Policy with ID 'abc' is not found. - id: abc - type: https://hivemq.com/edge/api/model/PolicyNotFoundError - SchemaAlreadyPresentError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The schema id. - example: abc - required: - - id - example: - general: - status: 409 - title: Schema Already Present - detail: The given schema is already present as the latest version for the schema id 'abc'. - id: abc - type: https://hivemq.com/edge/api/model/SchemaAlreadyPresentError - SchemaEtagMismatchError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The schema id. - example: abc - eTag: - type: string - description: The eTag. - example: 33a64df551425fcc55e4d42a148795d9f25f89d4 - required: - - id - example: - general: - status: 412 - title: Schema eTag Mismatch - detail: Schema with id 'abc' does not match the given etag '33a64df551425fcc55e4d42a148795d9f25f89d4'. - id: abc - eTag: 33a64df551425fcc55e4d42a148795d9f25f89d4 - type: https://hivemq.com/edge/api/model/SchemaEtagMismatchError - SchemaInsufficientStorageError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The policy id. - example: abc - required: - - id - example: - general: - status: 507 - title: Schema Insufficient Storage - detail: Schema with ID '123' could not be added because of insufficient server storage. - id: abc - type: https://hivemq.com/edge/api/model/SchemaInsufficientStorageError - SchemaValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - oneOf: - - $ref: '#/components/schemas/EmptyFieldValidationError' - - $ref: '#/components/schemas/InvalidFieldLengthValidationError' - - $ref: '#/components/schemas/InvalidFieldValueValidationError' - - $ref: '#/components/schemas/InvalidIdentifierValidationError' - - $ref: '#/components/schemas/MissingFieldValidationError' - - $ref: '#/components/schemas/UnsupportedFieldValidationError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' - https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' - https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' - https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' - https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' - https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' - SchemaInvalidErrors: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - childErrors: - type: array - description: List of child validation errors. - items: - $ref: '#/components/schemas/SchemaValidationError' - required: - - childErrors - example: - general: - status: 400 - title: Schema Invalid - detail: Schema is invalid due to validation errors. - type: https://hivemq.com/edge/api/model/SchemaInvalidErrors - childErrors: - - detail: The length of script field '$.id' 1025 must be between 0 and 1024. - paths: $.id - value: aaa...aaa - actualLength: 1025 - expectedMinimumLength: 0 - expectedMaximumLength: 1024 - type: https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError - SchemaNotFoundError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The schema ID. - example: abc - required: - - id - example: - general: - status: 404 - title: Schema Not Found - detail: Schema with ID 'abc' is not found. - id: abc - type: https://hivemq.com/edge/api/model/SchemaNotFoundError - SchemaParsingFailureError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - alias: - type: string - description: The schema alias. - example: abc - required: - - alias - example: - general: - status: 400 - title: Schema Parsing Failure - detail: The given schema 'abc' could not be parsed. - alias: abc - type: https://hivemq.com/edge/api/model/SchemaParsingFailureError - SchemaReferencedError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The schema ID. - example: abc - required: - - id - example: - general: - status: 400 - title: Schema Referenced - detail: Schema with ID 'abc' is referenced. - id: abc - type: https://hivemq.com/edge/api/model/SchemaReferencedError - ScriptAlreadyPresentError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The script id. - example: abc - required: - - id - example: - general: - status: 409 - title: Script Already Present - detail: The given script 'abc' is already present. - id: abc - type: https://hivemq.com/edge/api/model/ScriptAlreadyPresentError - ScriptCreationFailureError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 400 - title: Script Creation Failure - detail: The given script could not be created. - type: https://hivemq.com/edge/api/model/ScriptCreationFailureError - ScriptEtagMismatchError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The script id. - example: abc - eTag: - type: string - description: The eTag. - example: 33a64df551425fcc55e4d42a148795d9f25f89d4 - required: - - id - example: - general: - status: 412 - title: Script eTag Mismatch - detail: Script with id 'abc' does not match the given etag '33a64df551425fcc55e4d42a148795d9f25f89d4'. - id: abc - eTag: 33a64df551425fcc55e4d42a148795d9f25f89d4 - type: https://hivemq.com/edge/api/model/ScriptEtagMismatchError - ScriptInsufficientStorageError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The policy id. - example: abc - required: - - id - example: - general: - status: 507 - title: Script Insufficient Storage - detail: Script with ID '123' could not be added because of insufficient server storage. - id: abc - type: https://hivemq.com/edge/api/model/ScriptInsufficientStorageError - ScriptValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - oneOf: - - $ref: '#/components/schemas/InvalidFieldLengthValidationError' - - $ref: '#/components/schemas/InvalidFieldValueValidationError' - - $ref: '#/components/schemas/InvalidIdentifierValidationError' - - $ref: '#/components/schemas/MissingFieldValidationError' - - $ref: '#/components/schemas/UnsupportedFieldValidationError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' - https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' - https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' - https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' - https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' - ScriptInvalidErrors: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - childErrors: - type: array - description: List of child validation errors. - items: - $ref: '#/components/schemas/ScriptValidationError' - required: - - childErrors - example: - general: - status: 400 - title: Script Invalid - detail: Script is invalid due to validation errors. - type: https://hivemq.com/edge/api/model/ScriptInvalidErrors - childErrors: - - detail: The length of script field '$.id' 1025 must be between 0 and 1024. - paths: $.id - value: aaa...aaa - actualLength: 1025 - expectedMinimumLength: 0 - expectedMaximumLength: 1024 - type: https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError - ScriptNotFoundError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The script ID. - example: abc - required: - - id - example: - general: - status: 404 - title: Script Not Found - detail: Script with ID 'abc' is not found. - id: abc - type: https://hivemq.com/edge/api/model/ScriptNotFoundError - ScriptParsingFailureError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 400 - title: Script Parsing Failure - detail: The given script 'abc' could not be parsed. - type: https://hivemq.com/edge/api/model/ScriptParsingFailureError - ScriptReferencedError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The script ID. - example: abc - required: - - id - example: - general: - status: 400 - title: Script Referenced - detail: Script with ID 'abc' is referenced. - id: abc - type: https://hivemq.com/edge/api/model/ScriptReferencedError - ScriptSanitationFailureError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 400 - title: Script Sanitation Failure - detail: The given script could not be sanitized. - type: https://hivemq.com/edge/api/model/ScriptSanitationFailureError - TopicFilterMismatchError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - path: - type: string - description: The json path of the topic filter. - example: $.filter - required: - - path - example: - general: - status: 400 - title: Topic Filter Mismatch - detail: The topic filter '$.filter' mismatches. - type: https://hivemq.com/edge/api/model/TopicFilterMismatchError - InsufficientStorageError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 507 - title: Insufficient Storage - detail: Insufficient Storage. - type: https://hivemq.com/edge/api/model/InsufficientStorageError - InternalServerError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 500 - title: Internal Server Error - detail: An unexpected error occurred, check the logs. - type: https://hivemq.com/edge/api/model/InternalServerError - creation: - status: 500 - title: Internal Server Error - detail: 'An unexpected error occurred: Exception during creation of the Json Schema for functions.' - type: https://hivemq.com/edge/api/model/InternalServerError - InvalidQueryParameterError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - parameter: - type: string - description: The query parameter. - required: - - parameter - example: - general: - status: 400 - title: Query Parameter is Invalid - detail: 'Query parameter ''a'' is invalid: ''a'' could not be parsed.' - parameter: a - type: https://hivemq.com/edge/api/model/InvalidQueryParameterError - PreconditionFailedError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 412 - title: Precondition Failed - detail: 'A precondition required for fulfilling the request was not fulfilled: Policy does not match the given etag ''abc''.' - type: https://hivemq.com/edge/api/model/PreconditionFailedError - RequestBodyMissingError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 400 - title: Required Request Body Missing - detail: Required request body is missing. - type: https://hivemq.com/edge/api/model/RequestBodyMissingError - RequestBodyParameterMissingError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - parameter: - type: string - description: The the missing request body parameter. - required: - - parameter - example: - general: - status: 400 - title: Required Request Body Parameter Missing - detail: Required request body parameter 'a' is missing. - parameter: a - type: https://hivemq.com/edge/api/model/RequestBodyParameterMissingError - TemporaryNotAvailableError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 503 - title: Endpoint Temporarily not Available - detail: The endpoint is temporarily not available, please try again later. - type: https://hivemq.com/edge/api/model/TemporaryNotAvailableError - UrlParameterMissingError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - parameter: - type: string - description: The name of the missing parameter. - required: - - parameter - example: - general: - status: 400 - title: Required URL Parameter Missing - detail: Required URL parameter 'a' is missing. - parameter: a - type: https://hivemq.com/edge/api/model/UrlParameterMissingError JsonNode: type: object description: The arguments of the fsm derived from the behavior policy. @@ -6650,6 +5201,8 @@ components: description: List of result items that are returned by this endpoint items: $ref: '#/components/schemas/DataPolicy' + Errors: + type: object PolicyType: description: The type of policy in Data Hub type: string diff --git a/ext/hivemq-edge-openapi-2025.17.yaml b/ext/hivemq-edge-openapi-2025.17.yaml index 34f1b8f06f..456f960aba 100644 --- a/ext/hivemq-edge-openapi-2025.17.yaml +++ b/ext/hivemq-edge-openapi-2025.17.yaml @@ -357,23 +357,12 @@ paths: schema: $ref: '#/components/schemas/BehaviorPolicyList' description: Success - '400': - content: - application/problem+json: - schema: - oneOf: - - $ref: '#/components/schemas/InvalidQueryParameterError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' - description: URL parameter missing '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable + $ref: '#/components/schemas/ProblemDetails' + description: Temporarily not available summary: Get all policies tags: - Data Hub - Behavior Policies @@ -458,45 +447,34 @@ paths: description: Success '400': content: - application/problem+json: - schema: - oneOf: - - $ref: '#/components/schemas/BehaviorPolicyCreationFailureError' - - $ref: '#/components/schemas/BehaviorPolicyInvalidErrors' - - $ref: '#/components/schemas/BehaviorPolicyRejectedError' - - $ref: '#/components/schemas/RequestBodyMissingError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError: '#/components/schemas/BehaviorPolicyCreationFailureError' - https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors: '#/components/schemas/BehaviorPolicyInvalidErrors' - https://hivemq.com/edge/api/model/BehaviorPolicyRejectedError: '#/components/schemas/BehaviorPolicyRejectedError' - https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' description: Policy creation failed '409': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/BehaviorPolicyAlreadyPresentError' - description: Behavior policy already present + $ref: '#/components/schemas/ProblemDetails' + description: Already exists '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' - description: Internal server error + $ref: '#/components/schemas/ProblemDetails' + description: Internal error '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable + $ref: '#/components/schemas/ProblemDetails' + description: Temporarily unavailable '507': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/PolicyInsufficientStorageError' - description: Insufficient storage + $ref: '#/components/schemas/ProblemDetails' + description: Insufficient storage error summary: Create a new policy tags: - Data Hub - Behavior Policies @@ -526,39 +504,34 @@ paths: description: Success, no response body '400': content: - application/problem+json: + application/json: schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + $ref: '#/components/schemas/ProblemDetails' description: URL parameter missing '404': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/PolicyNotFoundError' - description: Behavior policy not found + $ref: '#/components/schemas/ProblemDetails' + description: Policy not found '412': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/PreconditionFailedError' + $ref: '#/components/schemas/ProblemDetails' description: Precondition failed '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' - description: Internal server error + $ref: '#/components/schemas/ProblemDetails' + description: Internal error '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable + $ref: '#/components/schemas/ProblemDetails' + description: Temporarily not available summary: Delete a behavior policy tags: - Data Hub - Behavior Policies @@ -626,33 +599,16 @@ paths: description: Success '400': content: - application/problem+json: + application/json: schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' - description: Bad request + $ref: '#/components/schemas/ProblemDetails' + description: Invalid query parameter '404': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/BehaviorPolicyNotFoundError' + $ref: '#/components/schemas/ProblemDetails' description: Policy not found - '500': - content: - application/problem+json: - schema: - $ref: '#/components/schemas/InternalServerError' - description: Internal server error - '503': - content: - application/problem+json: - schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable summary: Get a policy tags: - Data Hub - Behavior Policies @@ -753,56 +709,41 @@ paths: description: Success '400': content: - application/problem+json: - schema: - oneOf: - - $ref: '#/components/schemas/RequestBodyMissingError' - - $ref: '#/components/schemas/UrlParameterMissingError' - - $ref: '#/components/schemas/BehaviorPolicyCreationFailureError' - - $ref: '#/components/schemas/BehaviorPolicyInvalidErrors' - - $ref: '#/components/schemas/BehaviorPolicyUpdateFailureError' - - $ref: '#/components/schemas/PolicyIdMismatchError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' - https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError: '#/components/schemas/BehaviorPolicyCreationFailureError' - https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors: '#/components/schemas/BehaviorPolicyInvalidErrors' - https://hivemq.com/edge/api/model/BehaviorPolicyUpdateFailureError: '#/components/schemas/BehaviorPolicyUpdateFailureError' - https://hivemq.com/edge/api/model/PolicyIdMismatchError: '#/components/schemas/PolicyIdMismatchError' - description: Behavior policy creation failed + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: Policy creation failed '404': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/BehaviorPolicyNotFoundError' - description: Data policy not found + $ref: '#/components/schemas/ProblemDetails' + description: Policy not found '412': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/PreconditionFailedError' + $ref: '#/components/schemas/ProblemDetails' description: Precondition failed '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' - description: Internal server error + $ref: '#/components/schemas/ProblemDetails' + description: Internal error '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable + $ref: '#/components/schemas/ProblemDetails' + description: Temporarily unavailable '507': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/PolicyInsufficientStorageError' - description: Insufficient storage - summary: Update an existing behavior policy + $ref: '#/components/schemas/ProblemDetails' + description: Insufficient storage error + summary: Update an existing policy tags: - Data Hub - Behavior Policies /api/v1/data-hub/behavior-validation/states/{clientId}: @@ -846,34 +787,22 @@ paths: description: Success '400': content: - application/problem+json: + application/json: schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + $ref: '#/components/schemas/ProblemDetails' description: URL parameter missing '404': content: - application/problem+json: - schema: - oneOf: - - $ref: '#/components/schemas/ClientDisconnectedError' - - $ref: '#/components/schemas/ClientNotFoundError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/ClientDisconnectedError: '#/components/schemas/ClientDisconnectedError' - https://hivemq.com/edge/api/model/ClientNotFoundError: '#/components/schemas/ClientNotFoundError' - description: Client error + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: Client is disconnected '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' - description: Internal server error + $ref: '#/components/schemas/ProblemDetails' + description: Internal Server error summary: Get the state of a client tags: - Data Hub - State @@ -1122,20 +1051,27 @@ paths: description: Success '400': content: - application/problem+json: + application/json: schema: - oneOf: - - $ref: '#/components/schemas/InvalidQueryParameterError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' + $ref: '#/components/schemas/ProblemDetails' description: URL parameter missing + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: DataPolicy not found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: Internal server error '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' + $ref: '#/components/schemas/ProblemDetails' description: Request resource temporary unavailable summary: Get all data policies tags: @@ -1219,44 +1155,33 @@ paths: description: Success '400': content: - application/problem+json: - schema: - oneOf: - - $ref: '#/components/schemas/RequestBodyMissingError' - - $ref: '#/components/schemas/DataPolicyCreationFailureError' - - $ref: '#/components/schemas/DataPolicyInvalidErrors' - - $ref: '#/components/schemas/DataPolicyRejectedError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' - https://hivemq.com/edge/api/model/DataPolicyCreationFailureError: '#/components/schemas/DataPolicyCreationFailureError' - https://hivemq.com/edge/api/model/DataPolicyInvalidErrors: '#/components/schemas/DataPolicyInvalidErrors' - https://hivemq.com/edge/api/model/DataPolicyRejectedError: '#/components/schemas/DataPolicyRejectedError' - description: Data policy creation failed + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: DataPolicy creation failed '409': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/DataPolicyAlreadyPresentError' - description: Data policy already present + $ref: '#/components/schemas/ProblemDetails' + description: DataPolicy already present '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' + $ref: '#/components/schemas/ProblemDetails' description: Request resource temporary unavailable '507': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/PolicyInsufficientStorageError' + $ref: '#/components/schemas/ProblemDetails' description: Insufficient storage summary: Create a new data policy tags: @@ -1287,38 +1212,27 @@ paths: description: Success, no response body '400': content: - application/problem+json: + application/json: schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + $ref: '#/components/schemas/ProblemDetails' description: URL parameter missing '404': content: - application/problem+json: - schema: - $ref: '#/components/schemas/PolicyNotFoundError' - description: Data policy not found - '412': - content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/PreconditionFailedError' - description: Precondition failed + $ref: '#/components/schemas/ProblemDetails' + description: DataPolicy not found '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' + $ref: '#/components/schemas/ProblemDetails' description: Request resource temporary unavailable summary: Delete a data policy tags: @@ -1386,33 +1300,32 @@ paths: description: Success '400': content: - application/problem+json: + application/json: + examples: + param-missing: + description: Example response when a required parameter is missing. + summary: Required URL parameter missing + value: + errors: + - title: Required parameter missing + detail: Required URL parameter 'parameterName' is missing schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + $ref: '#/components/schemas/ProblemDetails' description: Bad request '404': content: - application/problem+json: + application/json: + examples: + not-found: + description: Policy not found + summary: Not found + value: + errors: + - title: Resource not found + detail: Resource with id 'my-resource-id' not found schema: - $ref: '#/components/schemas/PolicyNotFoundError' + $ref: '#/components/schemas/ProblemDetails' description: Resource not found - '500': - content: - application/problem+json: - schema: - $ref: '#/components/schemas/InternalServerError' - description: Internal server error - '503': - content: - application/problem+json: - schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable summary: Get a data policy tags: - Data Hub - Data Policies @@ -1512,56 +1425,33 @@ paths: description: Success '400': content: - application/problem+json: - schema: - oneOf: - - $ref: '#/components/schemas/RequestBodyMissingError' - - $ref: '#/components/schemas/UrlParameterMissingError' - - $ref: '#/components/schemas/DataPolicyCreationFailureError' - - $ref: '#/components/schemas/DataPolicyInvalidErrors' - - $ref: '#/components/schemas/DataPolicyUpdateFailureError' - - $ref: '#/components/schemas/PolicyIdMismatchError' - - $ref: '#/components/schemas/TopicFilterMismatchError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' - https://hivemq.com/edge/api/model/DataPolicyCreationFailureError: '#/components/schemas/DataPolicyCreationFailureError' - https://hivemq.com/edge/api/model/DataPolicyInvalidErrors: '#/components/schemas/DataPolicyInvalidErrors' - https://hivemq.com/edge/api/model/DataPolicyUpdateFailureError: '#/components/schemas/DataPolicyUpdateFailureError' - https://hivemq.com/edge/api/model/PolicyIdMismatchError: '#/components/schemas/PolicyIdMismatchError' - https://hivemq.com/edge/api/model/TopicFilterMismatchError: '#/components/schemas/TopicFilterMismatchError' - description: Data policy creation failed - '404': - content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/DataPolicyNotFoundError' - description: Data policy not found - '412': + $ref: '#/components/schemas/ProblemDetails' + description: DataPolicy creation failed + '404': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/PreconditionFailedError' - description: Precondition failed + $ref: '#/components/schemas/ProblemDetails' + description: DataPolicy not found '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' + $ref: '#/components/schemas/ProblemDetails' description: Request resource temporary unavailable '507': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/PolicyInsufficientStorageError' + $ref: '#/components/schemas/ProblemDetails' description: Insufficient storage summary: Update an existing data policy tags: @@ -1647,9 +1537,9 @@ paths: description: Success '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/Errors' description: Internal server error summary: Get all FSMs as a JSON Schema tags: @@ -1809,9 +1699,9 @@ paths: description: Success '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error summary: Get all functions as a JSON Schema tags: @@ -1829,9 +1719,9 @@ paths: description: Success '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error summary: Get all interpolation variables tags: @@ -1849,9 +1739,9 @@ paths: description: Success '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error summary: Get all functions as a list of function specifications tags: @@ -1986,22 +1876,11 @@ paths: schema: $ref: '#/components/schemas/SchemaList' description: Success - '400': - content: - application/problem+json: - schema: - oneOf: - - $ref: '#/components/schemas/InvalidQueryParameterError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' - description: URL parameter missing '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' + $ref: '#/components/schemas/ProblemDetails' description: Request resource temporary unavailable summary: Get all schemas tags: @@ -2048,48 +1927,33 @@ paths: description: Success '400': content: - application/problem+json: - schema: - oneOf: - - $ref: '#/components/schemas/RequestBodyParameterMissingError' - - $ref: '#/components/schemas/SchemaInvalidErrors' - - $ref: '#/components/schemas/SchemaParsingFailureError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/RequestBodyParameterMissingError: '#/components/schemas/RequestBodyParameterMissingError' - https://hivemq.com/edge/api/model/SchemaInvalidErrors: '#/components/schemas/SchemaInvalidErrors' - https://hivemq.com/edge/api/model/SchemaParsingFailureError: '#/components/schemas/SchemaParsingFailureError' - description: Schema creation failed + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: Schema could not be validatetd '409': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/SchemaAlreadyPresentError' - description: Schema is already present + $ref: '#/components/schemas/ProblemDetails' + description: Schema already exists '412': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/SchemaEtagMismatchError' - description: Schema doesn't match etag + $ref: '#/components/schemas/ProblemDetails' + description: Mismatch between schema and etag '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error - '503': - content: - application/problem+json: - schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable '507': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/SchemaInsufficientStorageError' + $ref: '#/components/schemas/ProblemDetails' description: Insufficient storage summary: Create a new schema tags: @@ -2120,40 +1984,33 @@ paths: description: Success, no response body '400': content: - application/problem+json: + application/json: schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - - $ref: '#/components/schemas/SchemaReferencedError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' - https://hivemq.com/edge/api/model/SchemaReferencedError: '#/components/schemas/SchemaReferencedError' - description: URL parameter missing + $ref: '#/components/schemas/ProblemDetails' + description: Schema referenced '404': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/SchemaNotFoundError' + $ref: '#/components/schemas/ProblemDetails' description: Schema not found '412': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/SchemaEtagMismatchError' - description: Schema doesn't match etag + $ref: '#/components/schemas/ProblemDetails' + description: Mismatch between schema and etag '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' - description: Internal Server error + $ref: '#/components/schemas/ProblemDetails' + description: Internal server error '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' + $ref: '#/components/schemas/ProblemDetails' description: Request resource temporary unavailable summary: Delete all versions of the schema tags: @@ -2199,33 +2056,22 @@ paths: description: Success '400': content: - application/problem+json: + application/json: schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' - description: URL parameter missing + $ref: '#/components/schemas/ProblemDetails' + description: A url parameter is missing '404': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/SchemaNotFoundError' + $ref: '#/components/schemas/ProblemDetails' description: Schema not found '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error - '503': - content: - application/problem+json: - schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable summary: Get a schema tags: - Data Hub - Schemas @@ -2346,23 +2192,12 @@ paths: schema: $ref: '#/components/schemas/ScriptList' description: Success - '400': - content: - application/problem+json: - schema: - oneOf: - - $ref: '#/components/schemas/InvalidQueryParameterError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' - description: URL parameter missing '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable + $ref: '#/components/schemas/ProblemDetails' + description: Temporary not available summary: Get all scripts tags: - Data Hub - Scripts @@ -2408,52 +2243,39 @@ paths: description: Success '400': content: - application/problem+json: - schema: - oneOf: - - $ref: '#/components/schemas/RequestBodyParameterMissingError' - - $ref: '#/components/schemas/ScriptCreationFailureError' - - $ref: '#/components/schemas/ScriptInvalidErrors' - - $ref: '#/components/schemas/ScriptParsingFailureError' - - $ref: '#/components/schemas/ScriptSanitationFailureError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/RequestBodyParameterMissingError: '#/components/schemas/RequestBodyParameterMissingError' - https://hivemq.com/edge/api/model/ScriptCreationFailureError: '#/components/schemas/ScriptCreationFailureError' - https://hivemq.com/edge/api/model/ScriptInvalidErrors: '#/components/schemas/ScriptInvalidErrors' - https://hivemq.com/edge/api/model/ScriptParsingFailureError: '#/components/schemas/ScriptParsingFailureError' - https://hivemq.com/edge/api/model/ScriptSanitationFailureError: '#/components/schemas/ScriptSanitationFailureError' - description: Script creation failed + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: Script is invalid '409': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/ScriptAlreadyPresentError' + $ref: '#/components/schemas/ProblemDetails' description: Script is already present '412': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/ScriptEtagMismatchError' + $ref: '#/components/schemas/ProblemDetails' description: Script doesn't match etag '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable + $ref: '#/components/schemas/ProblemDetails' + description: Temporary not available '507': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/ScriptInsufficientStorageError' + $ref: '#/components/schemas/ProblemDetails' description: Insufficient storage summary: Create a new script tags: @@ -2481,41 +2303,34 @@ paths: description: Success, no response body '400': content: - application/problem+json: + application/json: schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - - $ref: '#/components/schemas/ScriptReferencedError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' - https://hivemq.com/edge/api/model/ScriptReferencedError: '#/components/schemas/ScriptReferencedError' - description: URL parameter missing + $ref: '#/components/schemas/ProblemDetails' + description: Script is referenced '404': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/ScriptNotFoundError' + $ref: '#/components/schemas/ProblemDetails' description: Script not found '412': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/ScriptEtagMismatchError' + $ref: '#/components/schemas/ProblemDetails' description: Script doesn't match etag '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal Server error '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable + $ref: '#/components/schemas/ProblemDetails' + description: Temporary not available summary: Delete a script tags: - Data Hub - Scripts @@ -2556,33 +2371,28 @@ paths: description: Success '400': content: - application/problem+json: + application/json: schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + $ref: '#/components/schemas/ProblemDetails' description: URL parameter missing '404': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/ScriptNotFoundError' + $ref: '#/components/schemas/ProblemDetails' description: Script not found '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal Server error '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable + $ref: '#/components/schemas/ProblemDetails' + description: Temporary not available summary: Get a script tags: - Data Hub - Scripts @@ -5106,7 +4916,6 @@ components: detail: type: string errors: - deprecated: true type: array items: $ref: '#/components/schemas/Error' @@ -5271,1264 +5080,6 @@ components: description: List of result items that are returned by this endpoint items: $ref: '#/components/schemas/BehaviorPolicy' - ApiProblemDetails: - allOf: - - $ref: '#/components/schemas/ProblemDetails' - - type: object - required: - - detail - - status - - type - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/BehaviorPolicyAlreadyPresentError: '#/components/schemas/BehaviorPolicyAlreadyPresentError' - https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError: '#/components/schemas/BehaviorPolicyCreationFailureError' - https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors: '#/components/schemas/BehaviorPolicyInvalidErrors' - https://hivemq.com/edge/api/model/BehaviorPolicyNotFoundError: '#/components/schemas/BehaviorPolicyNotFoundError' - https://hivemq.com/edge/api/model/BehaviorPolicyRejectedError: '#/components/schemas/BehaviorPolicyRejectedError' - https://hivemq.com/edge/api/model/BehaviorPolicyUpdateFailureError: '#/components/schemas/BehaviorPolicyUpdateFailureError' - https://hivemq.com/edge/api/model/ClientDisconnectedError: '#/components/schemas/ClientDisconnectedError' - https://hivemq.com/edge/api/model/ClientNotFoundError: '#/components/schemas/ClientNotFoundError' - https://hivemq.com/edge/api/model/DataPolicyAlreadyPresentError: '#/components/schemas/DataPolicyAlreadyPresentError' - https://hivemq.com/edge/api/model/DataPolicyCreationFailureError: '#/components/schemas/DataPolicyCreationFailureError' - https://hivemq.com/edge/api/model/DataPolicyInvalidErrors: '#/components/schemas/DataPolicyInvalidErrors' - https://hivemq.com/edge/api/model/DataPolicyNotFoundError: '#/components/schemas/DataPolicyNotFoundError' - https://hivemq.com/edge/api/model/DataPolicyRejectedError: '#/components/schemas/DataPolicyRejectedError' - https://hivemq.com/edge/api/model/DataPolicyUpdateFailureError: '#/components/schemas/DataPolicyUpdateFailureError' - https://hivemq.com/edge/api/model/PolicyIdMismatchError: '#/components/schemas/PolicyIdMismatchError' - https://hivemq.com/edge/api/model/PolicyInsufficientStorageError: '#/components/schemas/PolicyInsufficientStorageError' - https://hivemq.com/edge/api/model/PolicyNotFoundError: '#/components/schemas/PolicyNotFoundError' - https://hivemq.com/edge/api/model/SchemaAlreadyPresentError: '#/components/schemas/SchemaAlreadyPresentError' - https://hivemq.com/edge/api/model/SchemaEtagMismatchError: '#/components/schemas/SchemaEtagMismatchError' - https://hivemq.com/edge/api/model/SchemaInsufficientStorageError: '#/components/schemas/SchemaInsufficientStorageError' - https://hivemq.com/edge/api/model/SchemaInvalidErrors: '#/components/schemas/SchemaInvalidErrors' - https://hivemq.com/edge/api/model/SchemaNotFoundError: '#/components/schemas/SchemaNotFoundError' - https://hivemq.com/edge/api/model/SchemaParsingFailureError: '#/components/schemas/SchemaParsingFailureError' - https://hivemq.com/edge/api/model/SchemaReferencedError: '#/components/schemas/SchemaReferencedError' - https://hivemq.com/edge/api/model/ScriptAlreadyPresentError: '#/components/schemas/ScriptAlreadyPresentError' - https://hivemq.com/edge/api/model/ScriptCreationFailureError: '#/components/schemas/ScriptCreationFailureError' - https://hivemq.com/edge/api/model/ScriptEtagMismatchError: '#/components/schemas/ScriptEtagMismatchError' - https://hivemq.com/edge/api/model/ScriptInsufficientStorageError: '#/components/schemas/ScriptInsufficientStorageError' - https://hivemq.com/edge/api/model/ScriptInvalidErrors: '#/components/schemas/ScriptInvalidErrors' - https://hivemq.com/edge/api/model/ScriptNotFoundError: '#/components/schemas/ScriptNotFoundError' - https://hivemq.com/edge/api/model/ScriptParsingFailureError: '#/components/schemas/ScriptParsingFailureError' - https://hivemq.com/edge/api/model/ScriptReferencedError: '#/components/schemas/ScriptReferencedError' - https://hivemq.com/edge/api/model/ScriptSanitationFailureError: '#/components/schemas/ScriptSanitationFailureError' - https://hivemq.com/edge/api/model/TopicFilterMismatchError: '#/components/schemas/TopicFilterMismatchError' - https://hivemq.com/edge/api/model/InsufficientStorageError: '#/components/schemas/InsufficientStorageError' - https://hivemq.com/edge/api/model/InternalServerError: '#/components/schemas/InternalServerError' - https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' - https://hivemq.com/edge/api/model/PreconditionFailedError: '#/components/schemas/PreconditionFailedError' - https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' - https://hivemq.com/edge/api/model/RequestBodyParameterMissingError: '#/components/schemas/RequestBodyParameterMissingError' - https://hivemq.com/edge/api/model/TemporaryNotAvailableError: '#/components/schemas/TemporaryNotAvailableError' - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' - BehaviorPolicyAlreadyPresentError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The behavior policy id. - example: abc - required: - - id - example: - general: - status: 409 - title: Behavior Policy Already Present - detail: The given behavior policy 'abc' is already present. - id: abc - type: https://hivemq.com/edge/api/model/BehaviorPolicyAlreadyPresentError - BehaviorPolicyCreationFailureError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 400 - title: Behavior Policy Creation Failed - detail: 'Behavior policy creation failed: The policy was rejected.' - type: https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError - AtLeastOneFieldMissingValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - paths: - type: array - description: The missing json paths. - items: - type: string - format: json-path - description: The json path. - example: - - $.field1 - - $.field2 - required: - - paths - example: - general: - detail: 'At least one of the fields must be present: ''$.field1'', ''$.field2''.' - paths: - - $.field1 - - $.field2 - type: https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError - ValidationError: - type: object - properties: - detail: - type: string - description: Detailed contextual description of the validation error. - type: - type: string - format: uri - description: Type of the validation error. - required: - - detail - - type - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError: '#/components/schemas/AtLeastOneFieldMissingValidationError' - https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError: '#/components/schemas/AtMostOneFunctionValidationError' - https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' - https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError: '#/components/schemas/FunctionMustBePairedValidationError' - https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError: '#/components/schemas/IllegalEventTransitionValidationError' - https://hivemq.com/edge/api/model/IllegalFunctionValidationError: '#/components/schemas/IllegalFunctionValidationError' - https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' - https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' - https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError: '#/components/schemas/InvalidFunctionOrderValidationError' - https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' - https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError: '#/components/schemas/InvalidSchemaVersionValidationError' - https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' - https://hivemq.com/edge/api/model/UnknownVariableValidationError: '#/components/schemas/UnknownVariableValidationError' - https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' - AtMostOneFunctionValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - function: - type: string - description: The function. - example: function1 - occurrences: - type: integer - format: int32 - description: The occurrences of the function. - minimum: 0 - example: 3 - paths: - type: array - items: - type: string - format: json-path - description: The json paths where the function occurs. - example: - - $.path1 - - $.path2 - - $.path3 - required: - - function - - occurrences - - paths - example: - general: - detail: The pipeline must contain at most one 'function1' function, but 3 were found at ['$.path1', '$.path2', '$.path3']. - function: function1 - occurrences: 3 - paths: - - $.path1 - - $.path2 - - $.path3 - type: https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError - EmptyFieldValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - path: - type: string - format: json-path - description: The missing field. - example: $.field - required: - - path - example: - general: - detail: Required field '$.field' is empty. - path: $.field - type: https://hivemq.com/edge/api/model/EmptyFieldValidationError - FunctionMustBePairedValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - existingFunction: - type: string - description: The existing function. - example: function1 - missingFunction: - type: string - description: The missing function. - example: function2 - required: - - existingFunction - - missingFunction - example: - general: - detail: If 'function1' function is present in the pipeline, 'function2' function must be present as well. - existingFunction: function1 - missingFunction: function2 - type: https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError - IllegalEventTransitionValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - event: - type: string - description: The event name. - example: event1 - fromState: - type: string - description: The event from state. - example: state1 - id: - type: string - description: The event id. - example: abc - path: - type: string - description: The path. - example: $.event - toState: - type: string - description: The event to state. - example: state2 - required: - - event - - fromState - - id - - path - - toState - example: - general: - detail: The transition from state 'state1' to state 'state2' on event 'event1' in '$.event' is not defined for behavior 'abc'. - event: event1 - fromState: state1 - toState: state2 - id: abc - path: $.event - type: https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError - IllegalFunctionValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - event: - type: string - description: The event name. - example: event1 - id: - type: string - description: The function id. - example: abc - path: - type: string - format: json-path - description: The json path. - example: $.event - required: - - event - - id - - path - example: - general: - detail: The function 'abc' is not allowed for event 'event1' in '$.event'. - event: event1 - id: abc - path: $.event - type: https://hivemq.com/edge/api/model/IllegalFunctionValidationError - InvalidFieldLengthValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - actualLength: - type: integer - format: int32 - description: The actual length of the field value. - example: 10 - expectedMinimumLength: - type: integer - format: int32 - description: The minimum length expected for the field value. - minimum: 0 - example: 5 - expectedMaximumLength: - type: integer - format: int32 - description: The maximum length expected for the field value. - minimum: 0 - example: 20 - path: - type: string - format: json-path - description: The invalid json path. - example: $.field - value: - type: string - description: The invalid value. - example: function transform() { return 'Hello, World!'; } - required: - - actualLength - - expectedMinimumLength - - expectedMaximumLength - - path - - value - example: - general: - detail: The length of script field '$.transform' 48 must be between 0 and 20. - actualLength: 48 - minimumLength: 0 - maximumLength: 20 - path: $.transform - value: function transform() { return 'Hello, World!'; } - type: https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError - InvalidFieldValueValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - path: - type: string - format: json-path - description: The invalid json path. - example: $.action.pipeline[1].field - value: - type: string - description: The invalid value. - example: functionDoesNotExist - required: - - path - example: - general: - detail: Referenced function does not exist. - path: $.action.pipeline[1].field - value: functionDoesNotExist - type: https://hivemq.com/edge/api/model/InvalidFieldValueValidationError - InvalidFunctionOrderValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - function: - type: string - description: The function. - example: transform - path: - type: string - format: json-path - description: The json path. - example: $.path - previousFunction: - type: string - description: The previous function. - example: init - required: - - function - - path - - previousFunction - example: - general: - detail: The operation at '$.path' with the functionId 'transform' must be after a 'init' operation. - function: transform - path: $.path - previousFunction: init - type: https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError - InvalidIdentifierValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - path: - type: string - format: json-path - description: The invalid identifier path. - example: $.id - value: - type: string - description: The invalid identifier value. - example: invalidId - required: - - path - - value - example: - general: - detail: Identifier script 'id' must begin with a letter and may only consist of lowercase letters, uppercase letters, numbers, periods, hyphens, and underscores. - path: $.id - value: invalidId - type: https://hivemq.com/edge/api/model/InvalidIdentifierValidationError - InvalidSchemaVersionValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - id: - type: string - description: The schema id. - example: abc - version: - type: string - description: The schema version. - example: '2' - required: - - id - - version - example: - general: - detail: The referenced schema with id 'abc' and version '2' was not found. - id: abc - version: '2' - type: https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError - MissingFieldValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - path: - type: string - format: json-path - description: The missing path. - example: $.id - required: - - path - example: - general: - detail: Required field '$.id' is missing. - path: $.id - type: https://hivemq.com/edge/api/model/MissingFieldValidationError - UnknownVariableValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - path: - type: string - description: The json path of the field. - example: $.path - variables: - type: array - items: - type: string - description: The unknown variables. - example: - - a - - b - - c - required: - - path - - variables - example: - general: - detail: 'Field ''$.path'' contains unknown variables: [a, b, c].' - path: $.path - variables: - - a - - b - - c - type: https://hivemq.com/edge/api/model/UnknownVariableValidationError - UnsupportedFieldValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - actualValue: - type: string - description: The actual value. - expectedValue: - type: string - description: The expected value. - path: - type: string - format: json-path - description: The json path. - example: $.id - required: - - actualValue - - expectedValue - - path - example: - general: - detail: Unsupported type 'String' for field '$.id'. Expected type is 'Object'. - actualValue: String - expectedValue: Object - path: $.id - type: https://hivemq.com/edge/api/model/UnsupportedFieldValidationError - BehaviorPolicyValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - oneOf: - - $ref: '#/components/schemas/IllegalEventTransitionValidationError' - - $ref: '#/components/schemas/IllegalFunctionValidationError' - - $ref: '#/components/schemas/InvalidSchemaVersionValidationError' - - $ref: '#/components/schemas/AtLeastOneFieldMissingValidationError' - - $ref: '#/components/schemas/EmptyFieldValidationError' - - $ref: '#/components/schemas/InvalidFieldLengthValidationError' - - $ref: '#/components/schemas/InvalidFieldValueValidationError' - - $ref: '#/components/schemas/InvalidIdentifierValidationError' - - $ref: '#/components/schemas/MissingFieldValidationError' - - $ref: '#/components/schemas/UnsupportedFieldValidationError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError: '#/components/schemas/AtLeastOneFieldMissingValidationError' - https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' - https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError: '#/components/schemas/IllegalEventTransitionValidationError' - https://hivemq.com/edge/api/model/IllegalFunctionValidationError: '#/components/schemas/IllegalFunctionValidationError' - https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' - https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' - https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' - https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError: '#/components/schemas/InvalidSchemaVersionValidationError' - https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' - https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' - BehaviorPolicyInvalidErrors: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - childErrors: - type: array - description: List of child validation errors. - items: - $ref: '#/components/schemas/BehaviorPolicyValidationError' - required: - - childErrors - example: - general: - status: 400 - title: Behavior Policy Invalid - detail: Behavior policy is invalid due to validation errors. - type: https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors - childErrors: - - detail: The transition from state 'state1' to state 'state2' on event 'event1' in '$.path' is not defined for behavior 'id1'. - fromState: state1 - toState: state2 - path: $.path - id: id1 - type: https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError - BehaviorPolicyNotFoundError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The data policy id. - example: abc - required: - - id - example: - general: - status: 404 - title: Behavior Policy Not Found - detail: Behavior policy with ID 'abc' is not found. - id: abc - type: https://hivemq.com/edge/api/model/BehaviorPolicyNotFoundError - BehaviorPolicyRejectedError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 400 - title: Behavior Policy Rejected - detail: Behavior policy is rejected. - type: https://hivemq.com/edge/api/model/BehaviorPolicyRejectedError - BehaviorPolicyUpdateFailureError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The ID of the policy that failed to update. - example: abc - required: - - id - example: - general: - status: 400 - title: Behavior Policy Update Failed - detail: Behavior policy with ID 'abc' update failed. - id: abc - type: https://hivemq.com/edge/api/model/BehaviorPolicyUpdateFailureError - ClientDisconnectedError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The client id. - example: abc - required: - - id - example: - general: - status: 404 - title: Client Disconnected - detail: Client with ID 'abc' is disconnected. - id: abc - type: https://hivemq.com/edge/api/model/ClientDisconnectedError - ClientNotFoundError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The client id. - example: abc - required: - - id - example: - general: - status: 404 - title: Client Not Found - detail: Client with ID 'abc' is not found. - id: abc - type: https://hivemq.com/edge/api/model/ClientNotFoundError - DataPolicyAlreadyPresentError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The data policy id. - example: abc - required: - - id - example: - general: - status: 409 - title: Data Policy Already Present - detail: The given data policy 'abc' is already present. - id: abc - type: https://hivemq.com/edge/api/model/DataPolicyAlreadyPresentError - DataPolicyCreationFailureError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 400 - title: Data Policy Creation Failed - detail: 'Data policy creation failed: The policy was rejected.' - type: https://hivemq.com/edge/api/model/DataPolicyCreationFailureError - DataPolicyValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - oneOf: - - $ref: '#/components/schemas/AtMostOneFunctionValidationError' - - $ref: '#/components/schemas/FunctionMustBePairedValidationError' - - $ref: '#/components/schemas/InvalidFunctionOrderValidationError' - - $ref: '#/components/schemas/InvalidSchemaVersionValidationError' - - $ref: '#/components/schemas/UnknownVariableValidationError' - - $ref: '#/components/schemas/EmptyFieldValidationError' - - $ref: '#/components/schemas/InvalidFieldLengthValidationError' - - $ref: '#/components/schemas/InvalidFieldValueValidationError' - - $ref: '#/components/schemas/InvalidIdentifierValidationError' - - $ref: '#/components/schemas/MissingFieldValidationError' - - $ref: '#/components/schemas/UnsupportedFieldValidationError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError: '#/components/schemas/AtMostOneFunctionValidationError' - https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' - https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError: '#/components/schemas/FunctionMustBePairedValidationError' - https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' - https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' - https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError: '#/components/schemas/InvalidFunctionOrderValidationError' - https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' - https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError: '#/components/schemas/InvalidSchemaVersionValidationError' - https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' - https://hivemq.com/edge/api/model/UnknownVariableValidationError: '#/components/schemas/UnknownVariableValidationError' - https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' - DataPolicyInvalidErrors: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - childErrors: - type: array - description: List of child validation errors. - items: - $ref: '#/components/schemas/DataPolicyValidationError' - required: - - childErrors - example: - general: - status: 400 - title: Data Policy Invalid - detail: Data policy is invalid due to validation errors. - type: https://hivemq.com/edge/api/model/DataPolicyInvalidErrors - childErrors: - - detail: The pipeline must contain at most one 'function1' function, but 3 were found at ['$.path1', '$.path2', '$.path3']. - function: function1 - occurrences: 3 - paths: - - $.path1 - - $.path2 - - $.path3 - type: https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError - DataPolicyNotFoundError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The data policy id. - example: abc - required: - - id - example: - general: - status: 404 - title: Data Policy Not Found - detail: Data policy with ID 'abc' is not found. - id: abc - type: https://hivemq.com/edge/api/model/DataPolicyNotFoundError - DataPolicyRejectedError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 400 - title: Data Policy Rejected - detail: Data policy is rejected. - type: https://hivemq.com/edge/api/model/DataPolicyRejectedError - DataPolicyUpdateFailureError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The ID of the policy that failed to update. - example: abc - required: - - id - example: - general: - status: 400 - title: Data Policy Update Failed - detail: Data policy with ID 'abc' update failed. - id: abc - type: https://hivemq.com/edge/api/model/DataPolicyUpdateFailureError - PolicyIdMismatchError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - actualId: - type: string - description: The actual id. - example: id1 - expectedId: - type: string - description: The expected id. - example: id2 - required: - - actualId - - expectedId - example: - general: - status: 400 - title: Policy ID Mismatch - detail: The policy ID 'id1' in the request parameter does not match the policy ID 'id2' in the policy request body. - id: abc - type: https://hivemq.com/edge/api/model/PolicyIdMismatchError - PolicyInsufficientStorageError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The policy id. - example: abc - required: - - id - example: - general: - status: 507 - title: Policy Insufficient Storage - detail: Policy with ID '123' could not be added because of insufficient server storage. - id: abc - type: https://hivemq.com/edge/api/model/PolicyInsufficientStorageError - PolicyNotFoundError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The policy id. - example: abc - required: - - id - example: - general: - status: 404 - title: Policy Not Found - detail: Policy with ID 'abc' is not found. - id: abc - type: https://hivemq.com/edge/api/model/PolicyNotFoundError - SchemaAlreadyPresentError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The schema id. - example: abc - required: - - id - example: - general: - status: 409 - title: Schema Already Present - detail: The given schema is already present as the latest version for the schema id 'abc'. - id: abc - type: https://hivemq.com/edge/api/model/SchemaAlreadyPresentError - SchemaEtagMismatchError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The schema id. - example: abc - eTag: - type: string - description: The eTag. - example: 33a64df551425fcc55e4d42a148795d9f25f89d4 - required: - - id - example: - general: - status: 412 - title: Schema eTag Mismatch - detail: Schema with id 'abc' does not match the given etag '33a64df551425fcc55e4d42a148795d9f25f89d4'. - id: abc - eTag: 33a64df551425fcc55e4d42a148795d9f25f89d4 - type: https://hivemq.com/edge/api/model/SchemaEtagMismatchError - SchemaInsufficientStorageError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The policy id. - example: abc - required: - - id - example: - general: - status: 507 - title: Schema Insufficient Storage - detail: Schema with ID '123' could not be added because of insufficient server storage. - id: abc - type: https://hivemq.com/edge/api/model/SchemaInsufficientStorageError - SchemaValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - oneOf: - - $ref: '#/components/schemas/EmptyFieldValidationError' - - $ref: '#/components/schemas/InvalidFieldLengthValidationError' - - $ref: '#/components/schemas/InvalidFieldValueValidationError' - - $ref: '#/components/schemas/InvalidIdentifierValidationError' - - $ref: '#/components/schemas/MissingFieldValidationError' - - $ref: '#/components/schemas/UnsupportedFieldValidationError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' - https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' - https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' - https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' - https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' - https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' - SchemaInvalidErrors: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - childErrors: - type: array - description: List of child validation errors. - items: - $ref: '#/components/schemas/SchemaValidationError' - required: - - childErrors - example: - general: - status: 400 - title: Schema Invalid - detail: Schema is invalid due to validation errors. - type: https://hivemq.com/edge/api/model/SchemaInvalidErrors - childErrors: - - detail: The length of script field '$.id' 1025 must be between 0 and 1024. - paths: $.id - value: aaa...aaa - actualLength: 1025 - expectedMinimumLength: 0 - expectedMaximumLength: 1024 - type: https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError - SchemaNotFoundError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The schema ID. - example: abc - required: - - id - example: - general: - status: 404 - title: Schema Not Found - detail: Schema with ID 'abc' is not found. - id: abc - type: https://hivemq.com/edge/api/model/SchemaNotFoundError - SchemaParsingFailureError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - alias: - type: string - description: The schema alias. - example: abc - required: - - alias - example: - general: - status: 400 - title: Schema Parsing Failure - detail: The given schema 'abc' could not be parsed. - alias: abc - type: https://hivemq.com/edge/api/model/SchemaParsingFailureError - SchemaReferencedError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The schema ID. - example: abc - required: - - id - example: - general: - status: 400 - title: Schema Referenced - detail: Schema with ID 'abc' is referenced. - id: abc - type: https://hivemq.com/edge/api/model/SchemaReferencedError - ScriptAlreadyPresentError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The script id. - example: abc - required: - - id - example: - general: - status: 409 - title: Script Already Present - detail: The given script 'abc' is already present. - id: abc - type: https://hivemq.com/edge/api/model/ScriptAlreadyPresentError - ScriptCreationFailureError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 400 - title: Script Creation Failure - detail: The given script could not be created. - type: https://hivemq.com/edge/api/model/ScriptCreationFailureError - ScriptEtagMismatchError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The script id. - example: abc - eTag: - type: string - description: The eTag. - example: 33a64df551425fcc55e4d42a148795d9f25f89d4 - required: - - id - example: - general: - status: 412 - title: Script eTag Mismatch - detail: Script with id 'abc' does not match the given etag '33a64df551425fcc55e4d42a148795d9f25f89d4'. - id: abc - eTag: 33a64df551425fcc55e4d42a148795d9f25f89d4 - type: https://hivemq.com/edge/api/model/ScriptEtagMismatchError - ScriptInsufficientStorageError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The policy id. - example: abc - required: - - id - example: - general: - status: 507 - title: Script Insufficient Storage - detail: Script with ID '123' could not be added because of insufficient server storage. - id: abc - type: https://hivemq.com/edge/api/model/ScriptInsufficientStorageError - ScriptValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - oneOf: - - $ref: '#/components/schemas/InvalidFieldLengthValidationError' - - $ref: '#/components/schemas/InvalidFieldValueValidationError' - - $ref: '#/components/schemas/InvalidIdentifierValidationError' - - $ref: '#/components/schemas/MissingFieldValidationError' - - $ref: '#/components/schemas/UnsupportedFieldValidationError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' - https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' - https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' - https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' - https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' - ScriptInvalidErrors: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - childErrors: - type: array - description: List of child validation errors. - items: - $ref: '#/components/schemas/ScriptValidationError' - required: - - childErrors - example: - general: - status: 400 - title: Script Invalid - detail: Script is invalid due to validation errors. - type: https://hivemq.com/edge/api/model/ScriptInvalidErrors - childErrors: - - detail: The length of script field '$.id' 1025 must be between 0 and 1024. - paths: $.id - value: aaa...aaa - actualLength: 1025 - expectedMinimumLength: 0 - expectedMaximumLength: 1024 - type: https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError - ScriptNotFoundError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The script ID. - example: abc - required: - - id - example: - general: - status: 404 - title: Script Not Found - detail: Script with ID 'abc' is not found. - id: abc - type: https://hivemq.com/edge/api/model/ScriptNotFoundError - ScriptParsingFailureError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 400 - title: Script Parsing Failure - detail: The given script 'abc' could not be parsed. - type: https://hivemq.com/edge/api/model/ScriptParsingFailureError - ScriptReferencedError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The script ID. - example: abc - required: - - id - example: - general: - status: 400 - title: Script Referenced - detail: Script with ID 'abc' is referenced. - id: abc - type: https://hivemq.com/edge/api/model/ScriptReferencedError - ScriptSanitationFailureError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 400 - title: Script Sanitation Failure - detail: The given script could not be sanitized. - type: https://hivemq.com/edge/api/model/ScriptSanitationFailureError - TopicFilterMismatchError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - path: - type: string - description: The json path of the topic filter. - example: $.filter - required: - - path - example: - general: - status: 400 - title: Topic Filter Mismatch - detail: The topic filter '$.filter' mismatches. - type: https://hivemq.com/edge/api/model/TopicFilterMismatchError - InsufficientStorageError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 507 - title: Insufficient Storage - detail: Insufficient Storage. - type: https://hivemq.com/edge/api/model/InsufficientStorageError - InternalServerError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 500 - title: Internal Server Error - detail: An unexpected error occurred, check the logs. - type: https://hivemq.com/edge/api/model/InternalServerError - creation: - status: 500 - title: Internal Server Error - detail: 'An unexpected error occurred: Exception during creation of the Json Schema for functions.' - type: https://hivemq.com/edge/api/model/InternalServerError - InvalidQueryParameterError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - parameter: - type: string - description: The query parameter. - required: - - parameter - example: - general: - status: 400 - title: Query Parameter is Invalid - detail: 'Query parameter ''a'' is invalid: ''a'' could not be parsed.' - parameter: a - type: https://hivemq.com/edge/api/model/InvalidQueryParameterError - PreconditionFailedError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 412 - title: Precondition Failed - detail: 'A precondition required for fulfilling the request was not fulfilled: Policy does not match the given etag ''abc''.' - type: https://hivemq.com/edge/api/model/PreconditionFailedError - RequestBodyMissingError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 400 - title: Required Request Body Missing - detail: Required request body is missing. - type: https://hivemq.com/edge/api/model/RequestBodyMissingError - RequestBodyParameterMissingError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - parameter: - type: string - description: The the missing request body parameter. - required: - - parameter - example: - general: - status: 400 - title: Required Request Body Parameter Missing - detail: Required request body parameter 'a' is missing. - parameter: a - type: https://hivemq.com/edge/api/model/RequestBodyParameterMissingError - TemporaryNotAvailableError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 503 - title: Endpoint Temporarily not Available - detail: The endpoint is temporarily not available, please try again later. - type: https://hivemq.com/edge/api/model/TemporaryNotAvailableError - UrlParameterMissingError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - parameter: - type: string - description: The name of the missing parameter. - required: - - parameter - example: - general: - status: 400 - title: Required URL Parameter Missing - detail: Required URL parameter 'a' is missing. - parameter: a - type: https://hivemq.com/edge/api/model/UrlParameterMissingError JsonNode: type: object description: The arguments of the fsm derived from the behavior policy. @@ -6650,6 +5201,8 @@ components: description: List of result items that are returned by this endpoint items: $ref: '#/components/schemas/DataPolicy' + Errors: + type: object PolicyType: description: The type of policy in Data Hub type: string diff --git a/ext/hivemq-edge-openapi-2025.18.yaml b/ext/hivemq-edge-openapi-2025.18.yaml index 2665dc19b5..9d636c5ba9 100644 --- a/ext/hivemq-edge-openapi-2025.18.yaml +++ b/ext/hivemq-edge-openapi-2025.18.yaml @@ -94,9 +94,6 @@ tags: These endpoints can be used to retrieve states of clients for the Data Hub. name: Data Hub - State - - description: | - These endpoints can be used to retrieve the different elements of the Edge topology - name: Domain - description: | These endpoints can be used to manage Pulse and its assets. name: Pulse @@ -360,23 +357,12 @@ paths: schema: $ref: '#/components/schemas/BehaviorPolicyList' description: Success - '400': - content: - application/problem+json: - schema: - oneOf: - - $ref: '#/components/schemas/InvalidQueryParameterError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' - description: URL parameter missing '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable + $ref: '#/components/schemas/ProblemDetails' + description: Temporarily not available summary: Get all policies tags: - Data Hub - Behavior Policies @@ -461,45 +447,34 @@ paths: description: Success '400': content: - application/problem+json: - schema: - oneOf: - - $ref: '#/components/schemas/BehaviorPolicyCreationFailureError' - - $ref: '#/components/schemas/BehaviorPolicyInvalidErrors' - - $ref: '#/components/schemas/BehaviorPolicyRejectedError' - - $ref: '#/components/schemas/RequestBodyMissingError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError: '#/components/schemas/BehaviorPolicyCreationFailureError' - https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors: '#/components/schemas/BehaviorPolicyInvalidErrors' - https://hivemq.com/edge/api/model/BehaviorPolicyRejectedError: '#/components/schemas/BehaviorPolicyRejectedError' - https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' description: Policy creation failed '409': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/BehaviorPolicyAlreadyPresentError' - description: Behavior policy already present + $ref: '#/components/schemas/ProblemDetails' + description: Already exists '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' - description: Internal server error + $ref: '#/components/schemas/ProblemDetails' + description: Internal error '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable + $ref: '#/components/schemas/ProblemDetails' + description: Temporarily unavailable '507': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/PolicyInsufficientStorageError' - description: Insufficient storage + $ref: '#/components/schemas/ProblemDetails' + description: Insufficient storage error summary: Create a new policy tags: - Data Hub - Behavior Policies @@ -529,39 +504,34 @@ paths: description: Success, no response body '400': content: - application/problem+json: + application/json: schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + $ref: '#/components/schemas/ProblemDetails' description: URL parameter missing '404': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/PolicyNotFoundError' - description: Behavior policy not found + $ref: '#/components/schemas/ProblemDetails' + description: Policy not found '412': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/PreconditionFailedError' + $ref: '#/components/schemas/ProblemDetails' description: Precondition failed '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' - description: Internal server error + $ref: '#/components/schemas/ProblemDetails' + description: Internal error '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable + $ref: '#/components/schemas/ProblemDetails' + description: Temporarily not available summary: Delete a behavior policy tags: - Data Hub - Behavior Policies @@ -629,33 +599,16 @@ paths: description: Success '400': content: - application/problem+json: + application/json: schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' - description: Bad request + $ref: '#/components/schemas/ProblemDetails' + description: Invalid query parameter '404': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/BehaviorPolicyNotFoundError' + $ref: '#/components/schemas/ProblemDetails' description: Policy not found - '500': - content: - application/problem+json: - schema: - $ref: '#/components/schemas/InternalServerError' - description: Internal server error - '503': - content: - application/problem+json: - schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable summary: Get a policy tags: - Data Hub - Behavior Policies @@ -756,56 +709,41 @@ paths: description: Success '400': content: - application/problem+json: - schema: - oneOf: - - $ref: '#/components/schemas/RequestBodyMissingError' - - $ref: '#/components/schemas/UrlParameterMissingError' - - $ref: '#/components/schemas/BehaviorPolicyCreationFailureError' - - $ref: '#/components/schemas/BehaviorPolicyInvalidErrors' - - $ref: '#/components/schemas/BehaviorPolicyUpdateFailureError' - - $ref: '#/components/schemas/PolicyIdMismatchError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' - https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError: '#/components/schemas/BehaviorPolicyCreationFailureError' - https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors: '#/components/schemas/BehaviorPolicyInvalidErrors' - https://hivemq.com/edge/api/model/BehaviorPolicyUpdateFailureError: '#/components/schemas/BehaviorPolicyUpdateFailureError' - https://hivemq.com/edge/api/model/PolicyIdMismatchError: '#/components/schemas/PolicyIdMismatchError' - description: Behavior policy creation failed + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: Policy creation failed '404': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/BehaviorPolicyNotFoundError' - description: Data policy not found + $ref: '#/components/schemas/ProblemDetails' + description: Policy not found '412': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/PreconditionFailedError' + $ref: '#/components/schemas/ProblemDetails' description: Precondition failed '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' - description: Internal server error + $ref: '#/components/schemas/ProblemDetails' + description: Internal error '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable + $ref: '#/components/schemas/ProblemDetails' + description: Temporarily unavailable '507': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/PolicyInsufficientStorageError' - description: Insufficient storage - summary: Update an existing behavior policy + $ref: '#/components/schemas/ProblemDetails' + description: Insufficient storage error + summary: Update an existing policy tags: - Data Hub - Behavior Policies /api/v1/data-hub/behavior-validation/states/{clientId}: @@ -849,34 +787,22 @@ paths: description: Success '400': content: - application/problem+json: + application/json: schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + $ref: '#/components/schemas/ProblemDetails' description: URL parameter missing '404': content: - application/problem+json: - schema: - oneOf: - - $ref: '#/components/schemas/ClientDisconnectedError' - - $ref: '#/components/schemas/ClientNotFoundError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/ClientDisconnectedError: '#/components/schemas/ClientDisconnectedError' - https://hivemq.com/edge/api/model/ClientNotFoundError: '#/components/schemas/ClientNotFoundError' - description: Client error + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: Client is disconnected '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' - description: Internal server error + $ref: '#/components/schemas/ProblemDetails' + description: Internal Server error summary: Get the state of a client tags: - Data Hub - State @@ -1125,20 +1051,27 @@ paths: description: Success '400': content: - application/problem+json: + application/json: schema: - oneOf: - - $ref: '#/components/schemas/InvalidQueryParameterError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' + $ref: '#/components/schemas/ProblemDetails' description: URL parameter missing + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: DataPolicy not found + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: Internal server error '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' + $ref: '#/components/schemas/ProblemDetails' description: Request resource temporary unavailable summary: Get all data policies tags: @@ -1222,44 +1155,33 @@ paths: description: Success '400': content: - application/problem+json: - schema: - oneOf: - - $ref: '#/components/schemas/RequestBodyMissingError' - - $ref: '#/components/schemas/DataPolicyCreationFailureError' - - $ref: '#/components/schemas/DataPolicyInvalidErrors' - - $ref: '#/components/schemas/DataPolicyRejectedError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' - https://hivemq.com/edge/api/model/DataPolicyCreationFailureError: '#/components/schemas/DataPolicyCreationFailureError' - https://hivemq.com/edge/api/model/DataPolicyInvalidErrors: '#/components/schemas/DataPolicyInvalidErrors' - https://hivemq.com/edge/api/model/DataPolicyRejectedError: '#/components/schemas/DataPolicyRejectedError' - description: Data policy creation failed + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: DataPolicy creation failed '409': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/DataPolicyAlreadyPresentError' - description: Data policy already present + $ref: '#/components/schemas/ProblemDetails' + description: DataPolicy already present '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' + $ref: '#/components/schemas/ProblemDetails' description: Request resource temporary unavailable '507': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/PolicyInsufficientStorageError' + $ref: '#/components/schemas/ProblemDetails' description: Insufficient storage summary: Create a new data policy tags: @@ -1290,38 +1212,27 @@ paths: description: Success, no response body '400': content: - application/problem+json: + application/json: schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + $ref: '#/components/schemas/ProblemDetails' description: URL parameter missing '404': content: - application/problem+json: - schema: - $ref: '#/components/schemas/PolicyNotFoundError' - description: Data policy not found - '412': - content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/PreconditionFailedError' - description: Precondition failed + $ref: '#/components/schemas/ProblemDetails' + description: DataPolicy not found '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' + $ref: '#/components/schemas/ProblemDetails' description: Request resource temporary unavailable summary: Delete a data policy tags: @@ -1389,33 +1300,32 @@ paths: description: Success '400': content: - application/problem+json: + application/json: + examples: + param-missing: + description: Example response when a required parameter is missing. + summary: Required URL parameter missing + value: + errors: + - title: Required parameter missing + detail: Required URL parameter 'parameterName' is missing schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + $ref: '#/components/schemas/ProblemDetails' description: Bad request '404': content: - application/problem+json: + application/json: + examples: + not-found: + description: Policy not found + summary: Not found + value: + errors: + - title: Resource not found + detail: Resource with id 'my-resource-id' not found schema: - $ref: '#/components/schemas/PolicyNotFoundError' + $ref: '#/components/schemas/ProblemDetails' description: Resource not found - '500': - content: - application/problem+json: - schema: - $ref: '#/components/schemas/InternalServerError' - description: Internal server error - '503': - content: - application/problem+json: - schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable summary: Get a data policy tags: - Data Hub - Data Policies @@ -1515,56 +1425,33 @@ paths: description: Success '400': content: - application/problem+json: - schema: - oneOf: - - $ref: '#/components/schemas/RequestBodyMissingError' - - $ref: '#/components/schemas/UrlParameterMissingError' - - $ref: '#/components/schemas/DataPolicyCreationFailureError' - - $ref: '#/components/schemas/DataPolicyInvalidErrors' - - $ref: '#/components/schemas/DataPolicyUpdateFailureError' - - $ref: '#/components/schemas/PolicyIdMismatchError' - - $ref: '#/components/schemas/TopicFilterMismatchError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' - https://hivemq.com/edge/api/model/DataPolicyCreationFailureError: '#/components/schemas/DataPolicyCreationFailureError' - https://hivemq.com/edge/api/model/DataPolicyInvalidErrors: '#/components/schemas/DataPolicyInvalidErrors' - https://hivemq.com/edge/api/model/DataPolicyUpdateFailureError: '#/components/schemas/DataPolicyUpdateFailureError' - https://hivemq.com/edge/api/model/PolicyIdMismatchError: '#/components/schemas/PolicyIdMismatchError' - https://hivemq.com/edge/api/model/TopicFilterMismatchError: '#/components/schemas/TopicFilterMismatchError' - description: Data policy creation failed - '404': - content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/DataPolicyNotFoundError' - description: Data policy not found - '412': + $ref: '#/components/schemas/ProblemDetails' + description: DataPolicy creation failed + '404': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/PreconditionFailedError' - description: Precondition failed + $ref: '#/components/schemas/ProblemDetails' + description: DataPolicy not found '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' + $ref: '#/components/schemas/ProblemDetails' description: Request resource temporary unavailable '507': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/PolicyInsufficientStorageError' + $ref: '#/components/schemas/ProblemDetails' description: Insufficient storage summary: Update an existing data policy tags: @@ -1650,9 +1537,9 @@ paths: description: Success '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/Errors' description: Internal server error summary: Get all FSMs as a JSON Schema tags: @@ -1812,9 +1699,9 @@ paths: description: Success '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error summary: Get all functions as a JSON Schema tags: @@ -1832,9 +1719,9 @@ paths: description: Success '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error summary: Get all interpolation variables tags: @@ -1852,9 +1739,9 @@ paths: description: Success '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error summary: Get all functions as a list of function specifications tags: @@ -1989,22 +1876,11 @@ paths: schema: $ref: '#/components/schemas/SchemaList' description: Success - '400': - content: - application/problem+json: - schema: - oneOf: - - $ref: '#/components/schemas/InvalidQueryParameterError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' - description: URL parameter missing '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' + $ref: '#/components/schemas/ProblemDetails' description: Request resource temporary unavailable summary: Get all schemas tags: @@ -2051,48 +1927,33 @@ paths: description: Success '400': content: - application/problem+json: - schema: - oneOf: - - $ref: '#/components/schemas/RequestBodyParameterMissingError' - - $ref: '#/components/schemas/SchemaInvalidErrors' - - $ref: '#/components/schemas/SchemaParsingFailureError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/RequestBodyParameterMissingError: '#/components/schemas/RequestBodyParameterMissingError' - https://hivemq.com/edge/api/model/SchemaInvalidErrors: '#/components/schemas/SchemaInvalidErrors' - https://hivemq.com/edge/api/model/SchemaParsingFailureError: '#/components/schemas/SchemaParsingFailureError' - description: Schema creation failed + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: Schema could not be validatetd '409': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/SchemaAlreadyPresentError' - description: Schema is already present + $ref: '#/components/schemas/ProblemDetails' + description: Schema already exists '412': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/SchemaEtagMismatchError' - description: Schema doesn't match etag + $ref: '#/components/schemas/ProblemDetails' + description: Mismatch between schema and etag '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error - '503': - content: - application/problem+json: - schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable '507': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/SchemaInsufficientStorageError' + $ref: '#/components/schemas/ProblemDetails' description: Insufficient storage summary: Create a new schema tags: @@ -2123,40 +1984,33 @@ paths: description: Success, no response body '400': content: - application/problem+json: + application/json: schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - - $ref: '#/components/schemas/SchemaReferencedError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' - https://hivemq.com/edge/api/model/SchemaReferencedError: '#/components/schemas/SchemaReferencedError' - description: URL parameter missing + $ref: '#/components/schemas/ProblemDetails' + description: Schema referenced '404': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/SchemaNotFoundError' + $ref: '#/components/schemas/ProblemDetails' description: Schema not found '412': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/SchemaEtagMismatchError' - description: Schema doesn't match etag + $ref: '#/components/schemas/ProblemDetails' + description: Mismatch between schema and etag '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' - description: Internal Server error + $ref: '#/components/schemas/ProblemDetails' + description: Internal server error '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' + $ref: '#/components/schemas/ProblemDetails' description: Request resource temporary unavailable summary: Delete all versions of the schema tags: @@ -2202,33 +2056,22 @@ paths: description: Success '400': content: - application/problem+json: + application/json: schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' - description: URL parameter missing + $ref: '#/components/schemas/ProblemDetails' + description: A url parameter is missing '404': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/SchemaNotFoundError' + $ref: '#/components/schemas/ProblemDetails' description: Schema not found '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error - '503': - content: - application/problem+json: - schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable summary: Get a schema tags: - Data Hub - Schemas @@ -2349,23 +2192,12 @@ paths: schema: $ref: '#/components/schemas/ScriptList' description: Success - '400': - content: - application/problem+json: - schema: - oneOf: - - $ref: '#/components/schemas/InvalidQueryParameterError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' - description: URL parameter missing '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable + $ref: '#/components/schemas/ProblemDetails' + description: Temporary not available summary: Get all scripts tags: - Data Hub - Scripts @@ -2411,52 +2243,39 @@ paths: description: Success '400': content: - application/problem+json: - schema: - oneOf: - - $ref: '#/components/schemas/RequestBodyParameterMissingError' - - $ref: '#/components/schemas/ScriptCreationFailureError' - - $ref: '#/components/schemas/ScriptInvalidErrors' - - $ref: '#/components/schemas/ScriptParsingFailureError' - - $ref: '#/components/schemas/ScriptSanitationFailureError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/RequestBodyParameterMissingError: '#/components/schemas/RequestBodyParameterMissingError' - https://hivemq.com/edge/api/model/ScriptCreationFailureError: '#/components/schemas/ScriptCreationFailureError' - https://hivemq.com/edge/api/model/ScriptInvalidErrors: '#/components/schemas/ScriptInvalidErrors' - https://hivemq.com/edge/api/model/ScriptParsingFailureError: '#/components/schemas/ScriptParsingFailureError' - https://hivemq.com/edge/api/model/ScriptSanitationFailureError: '#/components/schemas/ScriptSanitationFailureError' - description: Script creation failed + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: Script is invalid '409': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/ScriptAlreadyPresentError' + $ref: '#/components/schemas/ProblemDetails' description: Script is already present '412': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/ScriptEtagMismatchError' + $ref: '#/components/schemas/ProblemDetails' description: Script doesn't match etag '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal server error '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable + $ref: '#/components/schemas/ProblemDetails' + description: Temporary not available '507': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/ScriptInsufficientStorageError' + $ref: '#/components/schemas/ProblemDetails' description: Insufficient storage summary: Create a new script tags: @@ -2484,41 +2303,34 @@ paths: description: Success, no response body '400': content: - application/problem+json: + application/json: schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - - $ref: '#/components/schemas/ScriptReferencedError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' - https://hivemq.com/edge/api/model/ScriptReferencedError: '#/components/schemas/ScriptReferencedError' - description: URL parameter missing + $ref: '#/components/schemas/ProblemDetails' + description: Script is referenced '404': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/ScriptNotFoundError' + $ref: '#/components/schemas/ProblemDetails' description: Script not found '412': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/ScriptEtagMismatchError' + $ref: '#/components/schemas/ProblemDetails' description: Script doesn't match etag '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal Server error '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable + $ref: '#/components/schemas/ProblemDetails' + description: Temporary not available summary: Delete a script tags: - Data Hub - Scripts @@ -2559,33 +2371,28 @@ paths: description: Success '400': content: - application/problem+json: + application/json: schema: - oneOf: - - $ref: '#/components/schemas/UrlParameterMissingError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + $ref: '#/components/schemas/ProblemDetails' description: URL parameter missing '404': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/ScriptNotFoundError' + $ref: '#/components/schemas/ProblemDetails' description: Script not found '500': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/InternalServerError' + $ref: '#/components/schemas/ProblemDetails' description: Internal Server error '503': content: - application/problem+json: + application/json: schema: - $ref: '#/components/schemas/TemporaryNotAvailableError' - description: Request resource temporary unavailable + $ref: '#/components/schemas/ProblemDetails' + description: Temporary not available summary: Get a script tags: - Data Hub - Scripts @@ -3890,7 +3697,7 @@ paths: summary: Add a new Adapter tags: - Protocol Adapters - /api/v1/management/protocol-adapters/mappings/northboundMappings: + /api/v1/management/protocol-adapters/northboundMappings: get: description: Get all northbound mappings operationId: get-northboundMappings @@ -3899,13 +3706,12 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/NorthboundMappingOwnerList' + $ref: '#/components/schemas/NorthboundMappingList' description: Success - summary: Get all the northbound mappings. + summary: Get the mappings for northbound messages. tags: - Protocol Adapters - - Domain - /api/v1/management/protocol-adapters/mappings/southboundMappings: + /api/v1/management/protocol-adapters/southboundMappings: get: description: Get all southbound mappings. operationId: get-southboundMappings @@ -3914,12 +3720,11 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/SouthboundMappingOwnerList' + $ref: '#/components/schemas/SouthboundMappingList' description: Success - summary: Get all the southbound mappings. + summary: Get all southbound mappings. tags: - Protocol Adapters - - Domain /api/v1/management/protocol-adapters/status: get: description: Obtain the details. @@ -3991,12 +3796,11 @@ paths: node: ns=2;i=test2 name: tag2 schema: - $ref: '#/components/schemas/DomainTagOwnerList' + $ref: '#/components/schemas/DomainTagList' description: Success - summary: Get the list of all tags created in this Edge instance + summary: Get the list of all domain tags created in this Edge instance tags: - Protocol Adapters - - Domain /api/v1/management/protocol-adapters/tags/{tagName}: get: description: Get a domain tag created in this Edge instance @@ -4256,7 +4060,6 @@ paths: summary: Get the list of all topic filters created in this Edge instance tags: - Topic Filters - - Domain post: description: Add a new topic filter. operationId: add-topicFilters @@ -4780,7 +4583,6 @@ paths: operationId: get-managed-assets tags: - Pulse - - Domain responses: '200': content: @@ -5114,7 +4916,6 @@ components: detail: type: string errors: - deprecated: true type: array items: $ref: '#/components/schemas/Error' @@ -5279,1264 +5080,6 @@ components: description: List of result items that are returned by this endpoint items: $ref: '#/components/schemas/BehaviorPolicy' - ApiProblemDetails: - allOf: - - $ref: '#/components/schemas/ProblemDetails' - - type: object - required: - - detail - - status - - type - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/BehaviorPolicyAlreadyPresentError: '#/components/schemas/BehaviorPolicyAlreadyPresentError' - https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError: '#/components/schemas/BehaviorPolicyCreationFailureError' - https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors: '#/components/schemas/BehaviorPolicyInvalidErrors' - https://hivemq.com/edge/api/model/BehaviorPolicyNotFoundError: '#/components/schemas/BehaviorPolicyNotFoundError' - https://hivemq.com/edge/api/model/BehaviorPolicyRejectedError: '#/components/schemas/BehaviorPolicyRejectedError' - https://hivemq.com/edge/api/model/BehaviorPolicyUpdateFailureError: '#/components/schemas/BehaviorPolicyUpdateFailureError' - https://hivemq.com/edge/api/model/ClientDisconnectedError: '#/components/schemas/ClientDisconnectedError' - https://hivemq.com/edge/api/model/ClientNotFoundError: '#/components/schemas/ClientNotFoundError' - https://hivemq.com/edge/api/model/DataPolicyAlreadyPresentError: '#/components/schemas/DataPolicyAlreadyPresentError' - https://hivemq.com/edge/api/model/DataPolicyCreationFailureError: '#/components/schemas/DataPolicyCreationFailureError' - https://hivemq.com/edge/api/model/DataPolicyInvalidErrors: '#/components/schemas/DataPolicyInvalidErrors' - https://hivemq.com/edge/api/model/DataPolicyNotFoundError: '#/components/schemas/DataPolicyNotFoundError' - https://hivemq.com/edge/api/model/DataPolicyRejectedError: '#/components/schemas/DataPolicyRejectedError' - https://hivemq.com/edge/api/model/DataPolicyUpdateFailureError: '#/components/schemas/DataPolicyUpdateFailureError' - https://hivemq.com/edge/api/model/PolicyIdMismatchError: '#/components/schemas/PolicyIdMismatchError' - https://hivemq.com/edge/api/model/PolicyInsufficientStorageError: '#/components/schemas/PolicyInsufficientStorageError' - https://hivemq.com/edge/api/model/PolicyNotFoundError: '#/components/schemas/PolicyNotFoundError' - https://hivemq.com/edge/api/model/SchemaAlreadyPresentError: '#/components/schemas/SchemaAlreadyPresentError' - https://hivemq.com/edge/api/model/SchemaEtagMismatchError: '#/components/schemas/SchemaEtagMismatchError' - https://hivemq.com/edge/api/model/SchemaInsufficientStorageError: '#/components/schemas/SchemaInsufficientStorageError' - https://hivemq.com/edge/api/model/SchemaInvalidErrors: '#/components/schemas/SchemaInvalidErrors' - https://hivemq.com/edge/api/model/SchemaNotFoundError: '#/components/schemas/SchemaNotFoundError' - https://hivemq.com/edge/api/model/SchemaParsingFailureError: '#/components/schemas/SchemaParsingFailureError' - https://hivemq.com/edge/api/model/SchemaReferencedError: '#/components/schemas/SchemaReferencedError' - https://hivemq.com/edge/api/model/ScriptAlreadyPresentError: '#/components/schemas/ScriptAlreadyPresentError' - https://hivemq.com/edge/api/model/ScriptCreationFailureError: '#/components/schemas/ScriptCreationFailureError' - https://hivemq.com/edge/api/model/ScriptEtagMismatchError: '#/components/schemas/ScriptEtagMismatchError' - https://hivemq.com/edge/api/model/ScriptInsufficientStorageError: '#/components/schemas/ScriptInsufficientStorageError' - https://hivemq.com/edge/api/model/ScriptInvalidErrors: '#/components/schemas/ScriptInvalidErrors' - https://hivemq.com/edge/api/model/ScriptNotFoundError: '#/components/schemas/ScriptNotFoundError' - https://hivemq.com/edge/api/model/ScriptParsingFailureError: '#/components/schemas/ScriptParsingFailureError' - https://hivemq.com/edge/api/model/ScriptReferencedError: '#/components/schemas/ScriptReferencedError' - https://hivemq.com/edge/api/model/ScriptSanitationFailureError: '#/components/schemas/ScriptSanitationFailureError' - https://hivemq.com/edge/api/model/TopicFilterMismatchError: '#/components/schemas/TopicFilterMismatchError' - https://hivemq.com/edge/api/model/InsufficientStorageError: '#/components/schemas/InsufficientStorageError' - https://hivemq.com/edge/api/model/InternalServerError: '#/components/schemas/InternalServerError' - https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' - https://hivemq.com/edge/api/model/PreconditionFailedError: '#/components/schemas/PreconditionFailedError' - https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' - https://hivemq.com/edge/api/model/RequestBodyParameterMissingError: '#/components/schemas/RequestBodyParameterMissingError' - https://hivemq.com/edge/api/model/TemporaryNotAvailableError: '#/components/schemas/TemporaryNotAvailableError' - https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' - BehaviorPolicyAlreadyPresentError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The behavior policy id. - example: abc - required: - - id - example: - general: - status: 409 - title: Behavior Policy Already Present - detail: The given behavior policy 'abc' is already present. - id: abc - type: https://hivemq.com/edge/api/model/BehaviorPolicyAlreadyPresentError - BehaviorPolicyCreationFailureError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 400 - title: Behavior Policy Creation Failed - detail: 'Behavior policy creation failed: The policy was rejected.' - type: https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError - AtLeastOneFieldMissingValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - paths: - type: array - description: The missing json paths. - items: - type: string - format: json-path - description: The json path. - example: - - $.field1 - - $.field2 - required: - - paths - example: - general: - detail: 'At least one of the fields must be present: ''$.field1'', ''$.field2''.' - paths: - - $.field1 - - $.field2 - type: https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError - ValidationError: - type: object - properties: - detail: - type: string - description: Detailed contextual description of the validation error. - type: - type: string - format: uri - description: Type of the validation error. - required: - - detail - - type - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError: '#/components/schemas/AtLeastOneFieldMissingValidationError' - https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError: '#/components/schemas/AtMostOneFunctionValidationError' - https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' - https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError: '#/components/schemas/FunctionMustBePairedValidationError' - https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError: '#/components/schemas/IllegalEventTransitionValidationError' - https://hivemq.com/edge/api/model/IllegalFunctionValidationError: '#/components/schemas/IllegalFunctionValidationError' - https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' - https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' - https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError: '#/components/schemas/InvalidFunctionOrderValidationError' - https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' - https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError: '#/components/schemas/InvalidSchemaVersionValidationError' - https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' - https://hivemq.com/edge/api/model/UnknownVariableValidationError: '#/components/schemas/UnknownVariableValidationError' - https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' - AtMostOneFunctionValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - function: - type: string - description: The function. - example: function1 - occurrences: - type: integer - format: int32 - description: The occurrences of the function. - minimum: 0 - example: 3 - paths: - type: array - items: - type: string - format: json-path - description: The json paths where the function occurs. - example: - - $.path1 - - $.path2 - - $.path3 - required: - - function - - occurrences - - paths - example: - general: - detail: The pipeline must contain at most one 'function1' function, but 3 were found at ['$.path1', '$.path2', '$.path3']. - function: function1 - occurrences: 3 - paths: - - $.path1 - - $.path2 - - $.path3 - type: https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError - EmptyFieldValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - path: - type: string - format: json-path - description: The missing field. - example: $.field - required: - - path - example: - general: - detail: Required field '$.field' is empty. - path: $.field - type: https://hivemq.com/edge/api/model/EmptyFieldValidationError - FunctionMustBePairedValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - existingFunction: - type: string - description: The existing function. - example: function1 - missingFunction: - type: string - description: The missing function. - example: function2 - required: - - existingFunction - - missingFunction - example: - general: - detail: If 'function1' function is present in the pipeline, 'function2' function must be present as well. - existingFunction: function1 - missingFunction: function2 - type: https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError - IllegalEventTransitionValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - event: - type: string - description: The event name. - example: event1 - fromState: - type: string - description: The event from state. - example: state1 - id: - type: string - description: The event id. - example: abc - path: - type: string - description: The path. - example: $.event - toState: - type: string - description: The event to state. - example: state2 - required: - - event - - fromState - - id - - path - - toState - example: - general: - detail: The transition from state 'state1' to state 'state2' on event 'event1' in '$.event' is not defined for behavior 'abc'. - event: event1 - fromState: state1 - toState: state2 - id: abc - path: $.event - type: https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError - IllegalFunctionValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - event: - type: string - description: The event name. - example: event1 - id: - type: string - description: The function id. - example: abc - path: - type: string - format: json-path - description: The json path. - example: $.event - required: - - event - - id - - path - example: - general: - detail: The function 'abc' is not allowed for event 'event1' in '$.event'. - event: event1 - id: abc - path: $.event - type: https://hivemq.com/edge/api/model/IllegalFunctionValidationError - InvalidFieldLengthValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - actualLength: - type: integer - format: int32 - description: The actual length of the field value. - example: 10 - expectedMinimumLength: - type: integer - format: int32 - description: The minimum length expected for the field value. - minimum: 0 - example: 5 - expectedMaximumLength: - type: integer - format: int32 - description: The maximum length expected for the field value. - minimum: 0 - example: 20 - path: - type: string - format: json-path - description: The invalid json path. - example: $.field - value: - type: string - description: The invalid value. - example: function transform() { return 'Hello, World!'; } - required: - - actualLength - - expectedMinimumLength - - expectedMaximumLength - - path - - value - example: - general: - detail: The length of script field '$.transform' 48 must be between 0 and 20. - actualLength: 48 - minimumLength: 0 - maximumLength: 20 - path: $.transform - value: function transform() { return 'Hello, World!'; } - type: https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError - InvalidFieldValueValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - path: - type: string - format: json-path - description: The invalid json path. - example: $.action.pipeline[1].field - value: - type: string - description: The invalid value. - example: functionDoesNotExist - required: - - path - example: - general: - detail: Referenced function does not exist. - path: $.action.pipeline[1].field - value: functionDoesNotExist - type: https://hivemq.com/edge/api/model/InvalidFieldValueValidationError - InvalidFunctionOrderValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - function: - type: string - description: The function. - example: transform - path: - type: string - format: json-path - description: The json path. - example: $.path - previousFunction: - type: string - description: The previous function. - example: init - required: - - function - - path - - previousFunction - example: - general: - detail: The operation at '$.path' with the functionId 'transform' must be after a 'init' operation. - function: transform - path: $.path - previousFunction: init - type: https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError - InvalidIdentifierValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - path: - type: string - format: json-path - description: The invalid identifier path. - example: $.id - value: - type: string - description: The invalid identifier value. - example: invalidId - required: - - path - - value - example: - general: - detail: Identifier script 'id' must begin with a letter and may only consist of lowercase letters, uppercase letters, numbers, periods, hyphens, and underscores. - path: $.id - value: invalidId - type: https://hivemq.com/edge/api/model/InvalidIdentifierValidationError - InvalidSchemaVersionValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - id: - type: string - description: The schema id. - example: abc - version: - type: string - description: The schema version. - example: '2' - required: - - id - - version - example: - general: - detail: The referenced schema with id 'abc' and version '2' was not found. - id: abc - version: '2' - type: https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError - MissingFieldValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - path: - type: string - format: json-path - description: The missing path. - example: $.id - required: - - path - example: - general: - detail: Required field '$.id' is missing. - path: $.id - type: https://hivemq.com/edge/api/model/MissingFieldValidationError - UnknownVariableValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - path: - type: string - description: The json path of the field. - example: $.path - variables: - type: array - items: - type: string - description: The unknown variables. - example: - - a - - b - - c - required: - - path - - variables - example: - general: - detail: 'Field ''$.path'' contains unknown variables: [a, b, c].' - path: $.path - variables: - - a - - b - - c - type: https://hivemq.com/edge/api/model/UnknownVariableValidationError - UnsupportedFieldValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - type: object - properties: - actualValue: - type: string - description: The actual value. - expectedValue: - type: string - description: The expected value. - path: - type: string - format: json-path - description: The json path. - example: $.id - required: - - actualValue - - expectedValue - - path - example: - general: - detail: Unsupported type 'String' for field '$.id'. Expected type is 'Object'. - actualValue: String - expectedValue: Object - path: $.id - type: https://hivemq.com/edge/api/model/UnsupportedFieldValidationError - BehaviorPolicyValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - oneOf: - - $ref: '#/components/schemas/IllegalEventTransitionValidationError' - - $ref: '#/components/schemas/IllegalFunctionValidationError' - - $ref: '#/components/schemas/InvalidSchemaVersionValidationError' - - $ref: '#/components/schemas/AtLeastOneFieldMissingValidationError' - - $ref: '#/components/schemas/EmptyFieldValidationError' - - $ref: '#/components/schemas/InvalidFieldLengthValidationError' - - $ref: '#/components/schemas/InvalidFieldValueValidationError' - - $ref: '#/components/schemas/InvalidIdentifierValidationError' - - $ref: '#/components/schemas/MissingFieldValidationError' - - $ref: '#/components/schemas/UnsupportedFieldValidationError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError: '#/components/schemas/AtLeastOneFieldMissingValidationError' - https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' - https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError: '#/components/schemas/IllegalEventTransitionValidationError' - https://hivemq.com/edge/api/model/IllegalFunctionValidationError: '#/components/schemas/IllegalFunctionValidationError' - https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' - https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' - https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' - https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError: '#/components/schemas/InvalidSchemaVersionValidationError' - https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' - https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' - BehaviorPolicyInvalidErrors: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - childErrors: - type: array - description: List of child validation errors. - items: - $ref: '#/components/schemas/BehaviorPolicyValidationError' - required: - - childErrors - example: - general: - status: 400 - title: Behavior Policy Invalid - detail: Behavior policy is invalid due to validation errors. - type: https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors - childErrors: - - detail: The transition from state 'state1' to state 'state2' on event 'event1' in '$.path' is not defined for behavior 'id1'. - fromState: state1 - toState: state2 - path: $.path - id: id1 - type: https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError - BehaviorPolicyNotFoundError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The data policy id. - example: abc - required: - - id - example: - general: - status: 404 - title: Behavior Policy Not Found - detail: Behavior policy with ID 'abc' is not found. - id: abc - type: https://hivemq.com/edge/api/model/BehaviorPolicyNotFoundError - BehaviorPolicyRejectedError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 400 - title: Behavior Policy Rejected - detail: Behavior policy is rejected. - type: https://hivemq.com/edge/api/model/BehaviorPolicyRejectedError - BehaviorPolicyUpdateFailureError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The ID of the policy that failed to update. - example: abc - required: - - id - example: - general: - status: 400 - title: Behavior Policy Update Failed - detail: Behavior policy with ID 'abc' update failed. - id: abc - type: https://hivemq.com/edge/api/model/BehaviorPolicyUpdateFailureError - ClientDisconnectedError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The client id. - example: abc - required: - - id - example: - general: - status: 404 - title: Client Disconnected - detail: Client with ID 'abc' is disconnected. - id: abc - type: https://hivemq.com/edge/api/model/ClientDisconnectedError - ClientNotFoundError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The client id. - example: abc - required: - - id - example: - general: - status: 404 - title: Client Not Found - detail: Client with ID 'abc' is not found. - id: abc - type: https://hivemq.com/edge/api/model/ClientNotFoundError - DataPolicyAlreadyPresentError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The data policy id. - example: abc - required: - - id - example: - general: - status: 409 - title: Data Policy Already Present - detail: The given data policy 'abc' is already present. - id: abc - type: https://hivemq.com/edge/api/model/DataPolicyAlreadyPresentError - DataPolicyCreationFailureError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 400 - title: Data Policy Creation Failed - detail: 'Data policy creation failed: The policy was rejected.' - type: https://hivemq.com/edge/api/model/DataPolicyCreationFailureError - DataPolicyValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - oneOf: - - $ref: '#/components/schemas/AtMostOneFunctionValidationError' - - $ref: '#/components/schemas/FunctionMustBePairedValidationError' - - $ref: '#/components/schemas/InvalidFunctionOrderValidationError' - - $ref: '#/components/schemas/InvalidSchemaVersionValidationError' - - $ref: '#/components/schemas/UnknownVariableValidationError' - - $ref: '#/components/schemas/EmptyFieldValidationError' - - $ref: '#/components/schemas/InvalidFieldLengthValidationError' - - $ref: '#/components/schemas/InvalidFieldValueValidationError' - - $ref: '#/components/schemas/InvalidIdentifierValidationError' - - $ref: '#/components/schemas/MissingFieldValidationError' - - $ref: '#/components/schemas/UnsupportedFieldValidationError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError: '#/components/schemas/AtMostOneFunctionValidationError' - https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' - https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError: '#/components/schemas/FunctionMustBePairedValidationError' - https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' - https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' - https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError: '#/components/schemas/InvalidFunctionOrderValidationError' - https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' - https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError: '#/components/schemas/InvalidSchemaVersionValidationError' - https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' - https://hivemq.com/edge/api/model/UnknownVariableValidationError: '#/components/schemas/UnknownVariableValidationError' - https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' - DataPolicyInvalidErrors: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - childErrors: - type: array - description: List of child validation errors. - items: - $ref: '#/components/schemas/DataPolicyValidationError' - required: - - childErrors - example: - general: - status: 400 - title: Data Policy Invalid - detail: Data policy is invalid due to validation errors. - type: https://hivemq.com/edge/api/model/DataPolicyInvalidErrors - childErrors: - - detail: The pipeline must contain at most one 'function1' function, but 3 were found at ['$.path1', '$.path2', '$.path3']. - function: function1 - occurrences: 3 - paths: - - $.path1 - - $.path2 - - $.path3 - type: https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError - DataPolicyNotFoundError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The data policy id. - example: abc - required: - - id - example: - general: - status: 404 - title: Data Policy Not Found - detail: Data policy with ID 'abc' is not found. - id: abc - type: https://hivemq.com/edge/api/model/DataPolicyNotFoundError - DataPolicyRejectedError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 400 - title: Data Policy Rejected - detail: Data policy is rejected. - type: https://hivemq.com/edge/api/model/DataPolicyRejectedError - DataPolicyUpdateFailureError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The ID of the policy that failed to update. - example: abc - required: - - id - example: - general: - status: 400 - title: Data Policy Update Failed - detail: Data policy with ID 'abc' update failed. - id: abc - type: https://hivemq.com/edge/api/model/DataPolicyUpdateFailureError - PolicyIdMismatchError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - actualId: - type: string - description: The actual id. - example: id1 - expectedId: - type: string - description: The expected id. - example: id2 - required: - - actualId - - expectedId - example: - general: - status: 400 - title: Policy ID Mismatch - detail: The policy ID 'id1' in the request parameter does not match the policy ID 'id2' in the policy request body. - id: abc - type: https://hivemq.com/edge/api/model/PolicyIdMismatchError - PolicyInsufficientStorageError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The policy id. - example: abc - required: - - id - example: - general: - status: 507 - title: Policy Insufficient Storage - detail: Policy with ID '123' could not be added because of insufficient server storage. - id: abc - type: https://hivemq.com/edge/api/model/PolicyInsufficientStorageError - PolicyNotFoundError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The policy id. - example: abc - required: - - id - example: - general: - status: 404 - title: Policy Not Found - detail: Policy with ID 'abc' is not found. - id: abc - type: https://hivemq.com/edge/api/model/PolicyNotFoundError - SchemaAlreadyPresentError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The schema id. - example: abc - required: - - id - example: - general: - status: 409 - title: Schema Already Present - detail: The given schema is already present as the latest version for the schema id 'abc'. - id: abc - type: https://hivemq.com/edge/api/model/SchemaAlreadyPresentError - SchemaEtagMismatchError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The schema id. - example: abc - eTag: - type: string - description: The eTag. - example: 33a64df551425fcc55e4d42a148795d9f25f89d4 - required: - - id - example: - general: - status: 412 - title: Schema eTag Mismatch - detail: Schema with id 'abc' does not match the given etag '33a64df551425fcc55e4d42a148795d9f25f89d4'. - id: abc - eTag: 33a64df551425fcc55e4d42a148795d9f25f89d4 - type: https://hivemq.com/edge/api/model/SchemaEtagMismatchError - SchemaInsufficientStorageError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The policy id. - example: abc - required: - - id - example: - general: - status: 507 - title: Schema Insufficient Storage - detail: Schema with ID '123' could not be added because of insufficient server storage. - id: abc - type: https://hivemq.com/edge/api/model/SchemaInsufficientStorageError - SchemaValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - oneOf: - - $ref: '#/components/schemas/EmptyFieldValidationError' - - $ref: '#/components/schemas/InvalidFieldLengthValidationError' - - $ref: '#/components/schemas/InvalidFieldValueValidationError' - - $ref: '#/components/schemas/InvalidIdentifierValidationError' - - $ref: '#/components/schemas/MissingFieldValidationError' - - $ref: '#/components/schemas/UnsupportedFieldValidationError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' - https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' - https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' - https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' - https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' - https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' - SchemaInvalidErrors: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - childErrors: - type: array - description: List of child validation errors. - items: - $ref: '#/components/schemas/SchemaValidationError' - required: - - childErrors - example: - general: - status: 400 - title: Schema Invalid - detail: Schema is invalid due to validation errors. - type: https://hivemq.com/edge/api/model/SchemaInvalidErrors - childErrors: - - detail: The length of script field '$.id' 1025 must be between 0 and 1024. - paths: $.id - value: aaa...aaa - actualLength: 1025 - expectedMinimumLength: 0 - expectedMaximumLength: 1024 - type: https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError - SchemaNotFoundError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The schema ID. - example: abc - required: - - id - example: - general: - status: 404 - title: Schema Not Found - detail: Schema with ID 'abc' is not found. - id: abc - type: https://hivemq.com/edge/api/model/SchemaNotFoundError - SchemaParsingFailureError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - alias: - type: string - description: The schema alias. - example: abc - required: - - alias - example: - general: - status: 400 - title: Schema Parsing Failure - detail: The given schema 'abc' could not be parsed. - alias: abc - type: https://hivemq.com/edge/api/model/SchemaParsingFailureError - SchemaReferencedError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The schema ID. - example: abc - required: - - id - example: - general: - status: 400 - title: Schema Referenced - detail: Schema with ID 'abc' is referenced. - id: abc - type: https://hivemq.com/edge/api/model/SchemaReferencedError - ScriptAlreadyPresentError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The script id. - example: abc - required: - - id - example: - general: - status: 409 - title: Script Already Present - detail: The given script 'abc' is already present. - id: abc - type: https://hivemq.com/edge/api/model/ScriptAlreadyPresentError - ScriptCreationFailureError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 400 - title: Script Creation Failure - detail: The given script could not be created. - type: https://hivemq.com/edge/api/model/ScriptCreationFailureError - ScriptEtagMismatchError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The script id. - example: abc - eTag: - type: string - description: The eTag. - example: 33a64df551425fcc55e4d42a148795d9f25f89d4 - required: - - id - example: - general: - status: 412 - title: Script eTag Mismatch - detail: Script with id 'abc' does not match the given etag '33a64df551425fcc55e4d42a148795d9f25f89d4'. - id: abc - eTag: 33a64df551425fcc55e4d42a148795d9f25f89d4 - type: https://hivemq.com/edge/api/model/ScriptEtagMismatchError - ScriptInsufficientStorageError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The policy id. - example: abc - required: - - id - example: - general: - status: 507 - title: Script Insufficient Storage - detail: Script with ID '123' could not be added because of insufficient server storage. - id: abc - type: https://hivemq.com/edge/api/model/ScriptInsufficientStorageError - ScriptValidationError: - allOf: - - $ref: '#/components/schemas/ValidationError' - - oneOf: - - $ref: '#/components/schemas/InvalidFieldLengthValidationError' - - $ref: '#/components/schemas/InvalidFieldValueValidationError' - - $ref: '#/components/schemas/InvalidIdentifierValidationError' - - $ref: '#/components/schemas/MissingFieldValidationError' - - $ref: '#/components/schemas/UnsupportedFieldValidationError' - discriminator: - propertyName: type - mapping: - https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' - https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' - https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' - https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' - https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' - ScriptInvalidErrors: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - childErrors: - type: array - description: List of child validation errors. - items: - $ref: '#/components/schemas/ScriptValidationError' - required: - - childErrors - example: - general: - status: 400 - title: Script Invalid - detail: Script is invalid due to validation errors. - type: https://hivemq.com/edge/api/model/ScriptInvalidErrors - childErrors: - - detail: The length of script field '$.id' 1025 must be between 0 and 1024. - paths: $.id - value: aaa...aaa - actualLength: 1025 - expectedMinimumLength: 0 - expectedMaximumLength: 1024 - type: https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError - ScriptNotFoundError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The script ID. - example: abc - required: - - id - example: - general: - status: 404 - title: Script Not Found - detail: Script with ID 'abc' is not found. - id: abc - type: https://hivemq.com/edge/api/model/ScriptNotFoundError - ScriptParsingFailureError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 400 - title: Script Parsing Failure - detail: The given script 'abc' could not be parsed. - type: https://hivemq.com/edge/api/model/ScriptParsingFailureError - ScriptReferencedError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - id: - type: string - description: The script ID. - example: abc - required: - - id - example: - general: - status: 400 - title: Script Referenced - detail: Script with ID 'abc' is referenced. - id: abc - type: https://hivemq.com/edge/api/model/ScriptReferencedError - ScriptSanitationFailureError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 400 - title: Script Sanitation Failure - detail: The given script could not be sanitized. - type: https://hivemq.com/edge/api/model/ScriptSanitationFailureError - TopicFilterMismatchError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - path: - type: string - description: The json path of the topic filter. - example: $.filter - required: - - path - example: - general: - status: 400 - title: Topic Filter Mismatch - detail: The topic filter '$.filter' mismatches. - type: https://hivemq.com/edge/api/model/TopicFilterMismatchError - InsufficientStorageError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 507 - title: Insufficient Storage - detail: Insufficient Storage. - type: https://hivemq.com/edge/api/model/InsufficientStorageError - InternalServerError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 500 - title: Internal Server Error - detail: An unexpected error occurred, check the logs. - type: https://hivemq.com/edge/api/model/InternalServerError - creation: - status: 500 - title: Internal Server Error - detail: 'An unexpected error occurred: Exception during creation of the Json Schema for functions.' - type: https://hivemq.com/edge/api/model/InternalServerError - InvalidQueryParameterError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - parameter: - type: string - description: The query parameter. - required: - - parameter - example: - general: - status: 400 - title: Query Parameter is Invalid - detail: 'Query parameter ''a'' is invalid: ''a'' could not be parsed.' - parameter: a - type: https://hivemq.com/edge/api/model/InvalidQueryParameterError - PreconditionFailedError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 412 - title: Precondition Failed - detail: 'A precondition required for fulfilling the request was not fulfilled: Policy does not match the given etag ''abc''.' - type: https://hivemq.com/edge/api/model/PreconditionFailedError - RequestBodyMissingError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 400 - title: Required Request Body Missing - detail: Required request body is missing. - type: https://hivemq.com/edge/api/model/RequestBodyMissingError - RequestBodyParameterMissingError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - parameter: - type: string - description: The the missing request body parameter. - required: - - parameter - example: - general: - status: 400 - title: Required Request Body Parameter Missing - detail: Required request body parameter 'a' is missing. - parameter: a - type: https://hivemq.com/edge/api/model/RequestBodyParameterMissingError - TemporaryNotAvailableError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - example: - general: - status: 503 - title: Endpoint Temporarily not Available - detail: The endpoint is temporarily not available, please try again later. - type: https://hivemq.com/edge/api/model/TemporaryNotAvailableError - UrlParameterMissingError: - allOf: - - $ref: '#/components/schemas/ApiProblemDetails' - - type: object - properties: - parameter: - type: string - description: The name of the missing parameter. - required: - - parameter - example: - general: - status: 400 - title: Required URL Parameter Missing - detail: Required URL parameter 'a' is missing. - parameter: a - type: https://hivemq.com/edge/api/model/UrlParameterMissingError JsonNode: type: object description: The arguments of the fsm derived from the behavior policy. @@ -6658,6 +5201,8 @@ components: description: List of result items that are returned by this endpoint items: $ref: '#/components/schemas/DataPolicy' + Errors: + type: object PolicyType: description: The type of policy in Data Hub type: string @@ -7905,44 +6450,6 @@ components: $ref: '#/components/schemas/DomainTag' required: - items - NorthboundMappingOwnerList: - type: object - properties: - items: - type: array - description: List of result items that are returned by this endpoint - items: - type: object - required: - - adapterId - - mapping - properties: - adapterId: - type: string - description: The id of the adapter owning the mapping - mapping: - $ref: '#/components/schemas/NorthboundMapping' - required: - - items - SouthboundMappingOwnerList: - type: object - properties: - items: - type: array - description: List of result items that are returned by this endpoint - items: - type: object - required: - - adapterId - - mapping - properties: - adapterId: - type: string - description: The id of the adapter owning the mapping - mapping: - $ref: '#/components/schemas/SouthboundMapping' - required: - - items TagSchema: type: object properties: @@ -7951,25 +6458,6 @@ components: protocolId: type: string description: The id assigned to the protocol adapter type - DomainTagOwnerList: - type: object - properties: - items: - type: array - description: List of result items that are returned by this endpoint - items: - type: object - required: - - adapterId - - mapping - properties: - adapterId: - type: string - description: The id of the adapter owning the tag - mapping: - $ref: '#/components/schemas/DomainTag' - required: - - items ProtocolAdapterCategory: type: object description: The category of the adapter diff --git a/ext/hivemq-edge-openapi-2025.19-SNAPSHOT.yaml b/ext/hivemq-edge-openapi-2025.19-SNAPSHOT.yaml index 03762a9caa..2d3fbff985 100644 --- a/ext/hivemq-edge-openapi-2025.19-SNAPSHOT.yaml +++ b/ext/hivemq-edge-openapi-2025.19-SNAPSHOT.yaml @@ -94,6 +94,9 @@ tags: These endpoints can be used to retrieve states of clients for the Data Hub. name: Data Hub - State + - description: | + These endpoints can be used to retrieve the different elements of the Edge topology + name: Domain - description: | These endpoints can be used to manage Pulse and its assets. name: Pulse @@ -357,12 +360,23 @@ paths: schema: $ref: '#/components/schemas/BehaviorPolicyList' description: Success + '400': + content: + application/problem+json: + schema: + oneOf: + - $ref: '#/components/schemas/InvalidQueryParameterError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' + description: URL parameter missing '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporarily not available + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Get all policies tags: - Data Hub - Behavior Policies @@ -447,34 +461,45 @@ paths: description: Success '400': content: - application/json: - schema: - $ref: '#/components/schemas/ProblemDetails' + application/problem+json: + schema: + oneOf: + - $ref: '#/components/schemas/BehaviorPolicyCreationFailureError' + - $ref: '#/components/schemas/BehaviorPolicyInvalidErrors' + - $ref: '#/components/schemas/BehaviorPolicyRejectedError' + - $ref: '#/components/schemas/RequestBodyMissingError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError: '#/components/schemas/BehaviorPolicyCreationFailureError' + https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors: '#/components/schemas/BehaviorPolicyInvalidErrors' + https://hivemq.com/edge/api/model/BehaviorPolicyRejectedError: '#/components/schemas/BehaviorPolicyRejectedError' + https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' description: Policy creation failed '409': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Already exists + $ref: '#/components/schemas/BehaviorPolicyAlreadyPresentError' + description: Behavior policy already present '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Internal error + $ref: '#/components/schemas/InternalServerError' + description: Internal server error '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporarily unavailable + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable '507': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Insufficient storage error + $ref: '#/components/schemas/PolicyInsufficientStorageError' + description: Insufficient storage summary: Create a new policy tags: - Data Hub - Behavior Policies @@ -504,34 +529,39 @@ paths: description: Success, no response body '400': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Policy not found + $ref: '#/components/schemas/PolicyNotFoundError' + description: Behavior policy not found '412': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/PreconditionFailedError' description: Precondition failed '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Internal error + $ref: '#/components/schemas/InternalServerError' + description: Internal server error '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporarily not available + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Delete a behavior policy tags: - Data Hub - Behavior Policies @@ -599,16 +629,33 @@ paths: description: Success '400': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Invalid query parameter + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + description: Bad request '404': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/BehaviorPolicyNotFoundError' description: Policy not found + '500': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/InternalServerError' + description: Internal server error + '503': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Get a policy tags: - Data Hub - Behavior Policies @@ -709,41 +756,56 @@ paths: description: Success '400': content: - application/json: - schema: - $ref: '#/components/schemas/ProblemDetails' - description: Policy creation failed + application/problem+json: + schema: + oneOf: + - $ref: '#/components/schemas/RequestBodyMissingError' + - $ref: '#/components/schemas/UrlParameterMissingError' + - $ref: '#/components/schemas/BehaviorPolicyCreationFailureError' + - $ref: '#/components/schemas/BehaviorPolicyInvalidErrors' + - $ref: '#/components/schemas/BehaviorPolicyUpdateFailureError' + - $ref: '#/components/schemas/PolicyIdMismatchError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError: '#/components/schemas/BehaviorPolicyCreationFailureError' + https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors: '#/components/schemas/BehaviorPolicyInvalidErrors' + https://hivemq.com/edge/api/model/BehaviorPolicyUpdateFailureError: '#/components/schemas/BehaviorPolicyUpdateFailureError' + https://hivemq.com/edge/api/model/PolicyIdMismatchError: '#/components/schemas/PolicyIdMismatchError' + description: Behavior policy creation failed '404': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Policy not found + $ref: '#/components/schemas/BehaviorPolicyNotFoundError' + description: Data policy not found '412': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/PreconditionFailedError' description: Precondition failed '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Internal error + $ref: '#/components/schemas/InternalServerError' + description: Internal server error '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporarily unavailable + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable '507': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Insufficient storage error - summary: Update an existing policy + $ref: '#/components/schemas/PolicyInsufficientStorageError' + description: Insufficient storage + summary: Update an existing behavior policy tags: - Data Hub - Behavior Policies /api/v1/data-hub/behavior-validation/states/{clientId}: @@ -787,22 +849,34 @@ paths: description: Success '400': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' description: URL parameter missing '404': content: - application/json: - schema: - $ref: '#/components/schemas/ProblemDetails' - description: Client is disconnected + application/problem+json: + schema: + oneOf: + - $ref: '#/components/schemas/ClientDisconnectedError' + - $ref: '#/components/schemas/ClientNotFoundError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/ClientDisconnectedError: '#/components/schemas/ClientDisconnectedError' + https://hivemq.com/edge/api/model/ClientNotFoundError: '#/components/schemas/ClientNotFoundError' + description: Client error '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Internal Server error + $ref: '#/components/schemas/InternalServerError' + description: Internal server error summary: Get the state of a client tags: - Data Hub - State @@ -1051,27 +1125,20 @@ paths: description: Success '400': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + oneOf: + - $ref: '#/components/schemas/InvalidQueryParameterError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' description: URL parameter missing - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/ProblemDetails' - description: DataPolicy not found - '500': - content: - application/json: - schema: - $ref: '#/components/schemas/ProblemDetails' - description: Internal server error '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable summary: Get all data policies tags: @@ -1155,33 +1222,44 @@ paths: description: Success '400': content: - application/json: - schema: - $ref: '#/components/schemas/ProblemDetails' - description: DataPolicy creation failed + application/problem+json: + schema: + oneOf: + - $ref: '#/components/schemas/RequestBodyMissingError' + - $ref: '#/components/schemas/DataPolicyCreationFailureError' + - $ref: '#/components/schemas/DataPolicyInvalidErrors' + - $ref: '#/components/schemas/DataPolicyRejectedError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' + https://hivemq.com/edge/api/model/DataPolicyCreationFailureError: '#/components/schemas/DataPolicyCreationFailureError' + https://hivemq.com/edge/api/model/DataPolicyInvalidErrors: '#/components/schemas/DataPolicyInvalidErrors' + https://hivemq.com/edge/api/model/DataPolicyRejectedError: '#/components/schemas/DataPolicyRejectedError' + description: Data policy creation failed '409': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: DataPolicy already present + $ref: '#/components/schemas/DataPolicyAlreadyPresentError' + description: Data policy already present '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable '507': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/PolicyInsufficientStorageError' description: Insufficient storage summary: Create a new data policy tags: @@ -1212,27 +1290,38 @@ paths: description: Success, no response body '400': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: DataPolicy not found + $ref: '#/components/schemas/PolicyNotFoundError' + description: Data policy not found + '412': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/PreconditionFailedError' + description: Precondition failed '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable summary: Delete a data policy tags: @@ -1300,32 +1389,33 @@ paths: description: Success '400': content: - application/json: - examples: - param-missing: - description: Example response when a required parameter is missing. - summary: Required URL parameter missing - value: - errors: - - title: Required parameter missing - detail: Required URL parameter 'parameterName' is missing + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' description: Bad request '404': content: - application/json: - examples: - not-found: - description: Policy not found - summary: Not found - value: - errors: - - title: Resource not found - detail: Resource with id 'my-resource-id' not found + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/PolicyNotFoundError' description: Resource not found + '500': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/InternalServerError' + description: Internal server error + '503': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Get a data policy tags: - Data Hub - Data Policies @@ -1425,33 +1515,56 @@ paths: description: Success '400': content: - application/json: - schema: - $ref: '#/components/schemas/ProblemDetails' - description: DataPolicy creation failed + application/problem+json: + schema: + oneOf: + - $ref: '#/components/schemas/RequestBodyMissingError' + - $ref: '#/components/schemas/UrlParameterMissingError' + - $ref: '#/components/schemas/DataPolicyCreationFailureError' + - $ref: '#/components/schemas/DataPolicyInvalidErrors' + - $ref: '#/components/schemas/DataPolicyUpdateFailureError' + - $ref: '#/components/schemas/PolicyIdMismatchError' + - $ref: '#/components/schemas/TopicFilterMismatchError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + https://hivemq.com/edge/api/model/DataPolicyCreationFailureError: '#/components/schemas/DataPolicyCreationFailureError' + https://hivemq.com/edge/api/model/DataPolicyInvalidErrors: '#/components/schemas/DataPolicyInvalidErrors' + https://hivemq.com/edge/api/model/DataPolicyUpdateFailureError: '#/components/schemas/DataPolicyUpdateFailureError' + https://hivemq.com/edge/api/model/PolicyIdMismatchError: '#/components/schemas/PolicyIdMismatchError' + https://hivemq.com/edge/api/model/TopicFilterMismatchError: '#/components/schemas/TopicFilterMismatchError' + description: Data policy creation failed '404': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: DataPolicy not found + $ref: '#/components/schemas/DataPolicyNotFoundError' + description: Data policy not found + '412': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/PreconditionFailedError' + description: Precondition failed '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable '507': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/PolicyInsufficientStorageError' description: Insufficient storage summary: Update an existing data policy tags: @@ -1537,9 +1650,9 @@ paths: description: Success '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/Errors' + $ref: '#/components/schemas/InternalServerError' description: Internal server error summary: Get all FSMs as a JSON Schema tags: @@ -1699,9 +1812,9 @@ paths: description: Success '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error summary: Get all functions as a JSON Schema tags: @@ -1719,9 +1832,9 @@ paths: description: Success '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error summary: Get all interpolation variables tags: @@ -1739,9 +1852,9 @@ paths: description: Success '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error summary: Get all functions as a list of function specifications tags: @@ -1876,11 +1989,22 @@ paths: schema: $ref: '#/components/schemas/SchemaList' description: Success + '400': + content: + application/problem+json: + schema: + oneOf: + - $ref: '#/components/schemas/InvalidQueryParameterError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' + description: URL parameter missing '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable summary: Get all schemas tags: @@ -1927,33 +2051,48 @@ paths: description: Success '400': content: - application/json: - schema: - $ref: '#/components/schemas/ProblemDetails' - description: Schema could not be validatetd + application/problem+json: + schema: + oneOf: + - $ref: '#/components/schemas/RequestBodyParameterMissingError' + - $ref: '#/components/schemas/SchemaInvalidErrors' + - $ref: '#/components/schemas/SchemaParsingFailureError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/RequestBodyParameterMissingError: '#/components/schemas/RequestBodyParameterMissingError' + https://hivemq.com/edge/api/model/SchemaInvalidErrors: '#/components/schemas/SchemaInvalidErrors' + https://hivemq.com/edge/api/model/SchemaParsingFailureError: '#/components/schemas/SchemaParsingFailureError' + description: Schema creation failed '409': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Schema already exists + $ref: '#/components/schemas/SchemaAlreadyPresentError' + description: Schema is already present '412': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Mismatch between schema and etag + $ref: '#/components/schemas/SchemaEtagMismatchError' + description: Schema doesn't match etag '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error + '503': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable '507': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/SchemaInsufficientStorageError' description: Insufficient storage summary: Create a new schema tags: @@ -1984,33 +2123,40 @@ paths: description: Success, no response body '400': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Schema referenced + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + - $ref: '#/components/schemas/SchemaReferencedError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + https://hivemq.com/edge/api/model/SchemaReferencedError: '#/components/schemas/SchemaReferencedError' + description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/SchemaNotFoundError' description: Schema not found '412': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Mismatch between schema and etag + $ref: '#/components/schemas/SchemaEtagMismatchError' + description: Schema doesn't match etag '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Internal server error + $ref: '#/components/schemas/InternalServerError' + description: Internal Server error '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/TemporaryNotAvailableError' description: Request resource temporary unavailable summary: Delete all versions of the schema tags: @@ -2056,22 +2202,33 @@ paths: description: Success '400': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: A url parameter is missing + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/SchemaNotFoundError' description: Schema not found '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error + '503': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Get a schema tags: - Data Hub - Schemas @@ -2192,12 +2349,23 @@ paths: schema: $ref: '#/components/schemas/ScriptList' description: Success + '400': + content: + application/problem+json: + schema: + oneOf: + - $ref: '#/components/schemas/InvalidQueryParameterError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' + description: URL parameter missing '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporary not available + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Get all scripts tags: - Data Hub - Scripts @@ -2243,39 +2411,52 @@ paths: description: Success '400': content: - application/json: - schema: - $ref: '#/components/schemas/ProblemDetails' - description: Script is invalid + application/problem+json: + schema: + oneOf: + - $ref: '#/components/schemas/RequestBodyParameterMissingError' + - $ref: '#/components/schemas/ScriptCreationFailureError' + - $ref: '#/components/schemas/ScriptInvalidErrors' + - $ref: '#/components/schemas/ScriptParsingFailureError' + - $ref: '#/components/schemas/ScriptSanitationFailureError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/RequestBodyParameterMissingError: '#/components/schemas/RequestBodyParameterMissingError' + https://hivemq.com/edge/api/model/ScriptCreationFailureError: '#/components/schemas/ScriptCreationFailureError' + https://hivemq.com/edge/api/model/ScriptInvalidErrors: '#/components/schemas/ScriptInvalidErrors' + https://hivemq.com/edge/api/model/ScriptParsingFailureError: '#/components/schemas/ScriptParsingFailureError' + https://hivemq.com/edge/api/model/ScriptSanitationFailureError: '#/components/schemas/ScriptSanitationFailureError' + description: Script creation failed '409': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/ScriptAlreadyPresentError' description: Script is already present '412': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/ScriptEtagMismatchError' description: Script doesn't match etag '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal server error '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporary not available + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable '507': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/ScriptInsufficientStorageError' description: Insufficient storage summary: Create a new script tags: @@ -2303,34 +2484,41 @@ paths: description: Success, no response body '400': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Script is referenced + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + - $ref: '#/components/schemas/ScriptReferencedError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + https://hivemq.com/edge/api/model/ScriptReferencedError: '#/components/schemas/ScriptReferencedError' + description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/ScriptNotFoundError' description: Script not found '412': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/ScriptEtagMismatchError' description: Script doesn't match etag '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal Server error '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporary not available + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Delete a script tags: - Data Hub - Scripts @@ -2371,28 +2559,33 @@ paths: description: Success '400': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + oneOf: + - $ref: '#/components/schemas/UrlParameterMissingError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' description: URL parameter missing '404': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/ScriptNotFoundError' description: Script not found '500': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' + $ref: '#/components/schemas/InternalServerError' description: Internal Server error '503': content: - application/json: + application/problem+json: schema: - $ref: '#/components/schemas/ProblemDetails' - description: Temporary not available + $ref: '#/components/schemas/TemporaryNotAvailableError' + description: Request resource temporary unavailable summary: Get a script tags: - Data Hub - Scripts @@ -3697,7 +3890,7 @@ paths: summary: Add a new Adapter tags: - Protocol Adapters - /api/v1/management/protocol-adapters/northboundMappings: + /api/v1/management/protocol-adapters/mappings/northboundMappings: get: description: Get all northbound mappings operationId: get-northboundMappings @@ -3706,12 +3899,13 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/NorthboundMappingList' + $ref: '#/components/schemas/NorthboundMappingOwnerList' description: Success - summary: Get the mappings for northbound messages. + summary: Get all the northbound mappings. tags: - Protocol Adapters - /api/v1/management/protocol-adapters/southboundMappings: + - Domain + /api/v1/management/protocol-adapters/mappings/southboundMappings: get: description: Get all southbound mappings. operationId: get-southboundMappings @@ -3720,11 +3914,12 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/SouthboundMappingList' + $ref: '#/components/schemas/SouthboundMappingOwnerList' description: Success - summary: Get all southbound mappings. + summary: Get all the southbound mappings. tags: - Protocol Adapters + - Domain /api/v1/management/protocol-adapters/status: get: description: Obtain the details. @@ -3796,11 +3991,12 @@ paths: node: ns=2;i=test2 name: tag2 schema: - $ref: '#/components/schemas/DomainTagList' + $ref: '#/components/schemas/DomainTagOwnerList' description: Success - summary: Get the list of all domain tags created in this Edge instance + summary: Get the list of all tags created in this Edge instance tags: - Protocol Adapters + - Domain /api/v1/management/protocol-adapters/tags/{tagName}: get: description: Get a domain tag created in this Edge instance @@ -4060,6 +4256,7 @@ paths: summary: Get the list of all topic filters created in this Edge instance tags: - Topic Filters + - Domain post: description: Add a new topic filter. operationId: add-topicFilters @@ -4583,6 +4780,7 @@ paths: operationId: get-managed-assets tags: - Pulse + - Domain responses: '200': content: @@ -4916,6 +5114,7 @@ components: detail: type: string errors: + deprecated: true type: array items: $ref: '#/components/schemas/Error' @@ -5080,20 +5279,1278 @@ components: description: List of result items that are returned by this endpoint items: $ref: '#/components/schemas/BehaviorPolicy' - JsonNode: - type: object - description: The arguments of the fsm derived from the behavior policy. - FsmStateInformationItem: - type: object - description: List of result items that are returned by this endpoint - properties: - arguments: - $ref: '#/components/schemas/JsonNode' - behaviorId: - type: string - description: The unique identifier of the policy. - firstSetAt: - type: string + ApiProblemDetails: + allOf: + - $ref: '#/components/schemas/ProblemDetails' + - type: object + required: + - detail + - status + - type + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/BehaviorPolicyAlreadyPresentError: '#/components/schemas/BehaviorPolicyAlreadyPresentError' + https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError: '#/components/schemas/BehaviorPolicyCreationFailureError' + https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors: '#/components/schemas/BehaviorPolicyInvalidErrors' + https://hivemq.com/edge/api/model/BehaviorPolicyNotFoundError: '#/components/schemas/BehaviorPolicyNotFoundError' + https://hivemq.com/edge/api/model/BehaviorPolicyRejectedError: '#/components/schemas/BehaviorPolicyRejectedError' + https://hivemq.com/edge/api/model/BehaviorPolicyUpdateFailureError: '#/components/schemas/BehaviorPolicyUpdateFailureError' + https://hivemq.com/edge/api/model/ClientDisconnectedError: '#/components/schemas/ClientDisconnectedError' + https://hivemq.com/edge/api/model/ClientNotFoundError: '#/components/schemas/ClientNotFoundError' + https://hivemq.com/edge/api/model/DataPolicyAlreadyPresentError: '#/components/schemas/DataPolicyAlreadyPresentError' + https://hivemq.com/edge/api/model/DataPolicyCreationFailureError: '#/components/schemas/DataPolicyCreationFailureError' + https://hivemq.com/edge/api/model/DataPolicyInvalidErrors: '#/components/schemas/DataPolicyInvalidErrors' + https://hivemq.com/edge/api/model/DataPolicyNotFoundError: '#/components/schemas/DataPolicyNotFoundError' + https://hivemq.com/edge/api/model/DataPolicyRejectedError: '#/components/schemas/DataPolicyRejectedError' + https://hivemq.com/edge/api/model/DataPolicyUpdateFailureError: '#/components/schemas/DataPolicyUpdateFailureError' + https://hivemq.com/edge/api/model/PolicyIdMismatchError: '#/components/schemas/PolicyIdMismatchError' + https://hivemq.com/edge/api/model/PolicyInsufficientStorageError: '#/components/schemas/PolicyInsufficientStorageError' + https://hivemq.com/edge/api/model/PolicyNotFoundError: '#/components/schemas/PolicyNotFoundError' + https://hivemq.com/edge/api/model/SchemaAlreadyPresentError: '#/components/schemas/SchemaAlreadyPresentError' + https://hivemq.com/edge/api/model/SchemaEtagMismatchError: '#/components/schemas/SchemaEtagMismatchError' + https://hivemq.com/edge/api/model/SchemaInsufficientStorageError: '#/components/schemas/SchemaInsufficientStorageError' + https://hivemq.com/edge/api/model/SchemaInvalidErrors: '#/components/schemas/SchemaInvalidErrors' + https://hivemq.com/edge/api/model/SchemaNotFoundError: '#/components/schemas/SchemaNotFoundError' + https://hivemq.com/edge/api/model/SchemaParsingFailureError: '#/components/schemas/SchemaParsingFailureError' + https://hivemq.com/edge/api/model/SchemaReferencedError: '#/components/schemas/SchemaReferencedError' + https://hivemq.com/edge/api/model/ScriptAlreadyPresentError: '#/components/schemas/ScriptAlreadyPresentError' + https://hivemq.com/edge/api/model/ScriptCreationFailureError: '#/components/schemas/ScriptCreationFailureError' + https://hivemq.com/edge/api/model/ScriptEtagMismatchError: '#/components/schemas/ScriptEtagMismatchError' + https://hivemq.com/edge/api/model/ScriptInsufficientStorageError: '#/components/schemas/ScriptInsufficientStorageError' + https://hivemq.com/edge/api/model/ScriptInvalidErrors: '#/components/schemas/ScriptInvalidErrors' + https://hivemq.com/edge/api/model/ScriptNotFoundError: '#/components/schemas/ScriptNotFoundError' + https://hivemq.com/edge/api/model/ScriptParsingFailureError: '#/components/schemas/ScriptParsingFailureError' + https://hivemq.com/edge/api/model/ScriptReferencedError: '#/components/schemas/ScriptReferencedError' + https://hivemq.com/edge/api/model/ScriptSanitationFailureError: '#/components/schemas/ScriptSanitationFailureError' + https://hivemq.com/edge/api/model/TopicFilterMismatchError: '#/components/schemas/TopicFilterMismatchError' + https://hivemq.com/edge/api/model/InsufficientStorageError: '#/components/schemas/InsufficientStorageError' + https://hivemq.com/edge/api/model/InternalServerError: '#/components/schemas/InternalServerError' + https://hivemq.com/edge/api/model/InvalidQueryParameterError: '#/components/schemas/InvalidQueryParameterError' + https://hivemq.com/edge/api/model/PreconditionFailedError: '#/components/schemas/PreconditionFailedError' + https://hivemq.com/edge/api/model/RequestBodyMissingError: '#/components/schemas/RequestBodyMissingError' + https://hivemq.com/edge/api/model/RequestBodyParameterMissingError: '#/components/schemas/RequestBodyParameterMissingError' + https://hivemq.com/edge/api/model/TemporaryNotAvailableError: '#/components/schemas/TemporaryNotAvailableError' + https://hivemq.com/edge/api/model/UrlParameterMissingError: '#/components/schemas/UrlParameterMissingError' + BehaviorPolicyAlreadyPresentError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The behavior policy id. + example: abc + required: + - id + example: + general: + status: 409 + title: Behavior Policy Already Present + detail: The given behavior policy 'abc' is already present. + id: abc + type: https://hivemq.com/edge/api/model/BehaviorPolicyAlreadyPresentError + BehaviorPolicyCreationFailureError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 400 + title: Behavior Policy Creation Failed + detail: 'Behavior policy creation failed: The policy was rejected.' + type: https://hivemq.com/edge/api/model/BehaviorPolicyCreationFailureError + AtLeastOneFieldMissingValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + paths: + type: array + description: The missing json paths. + items: + type: string + format: json-path + description: The json path. + example: + - $.field1 + - $.field2 + required: + - paths + example: + general: + detail: 'At least one of the fields must be present: ''$.field1'', ''$.field2''.' + paths: + - $.field1 + - $.field2 + type: https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError + ValidationError: + type: object + properties: + detail: + type: string + description: Detailed contextual description of the validation error. + type: + type: string + format: uri + description: Type of the validation error. + required: + - detail + - type + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError: '#/components/schemas/AtLeastOneFieldMissingValidationError' + https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError: '#/components/schemas/AtMostOneFunctionValidationError' + https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' + https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError: '#/components/schemas/FunctionMustBePairedValidationError' + https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError: '#/components/schemas/IllegalEventTransitionValidationError' + https://hivemq.com/edge/api/model/IllegalFunctionValidationError: '#/components/schemas/IllegalFunctionValidationError' + https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' + https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' + https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError: '#/components/schemas/InvalidFunctionOrderValidationError' + https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' + https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError: '#/components/schemas/InvalidSchemaVersionValidationError' + https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' + https://hivemq.com/edge/api/model/UnknownVariableValidationError: '#/components/schemas/UnknownVariableValidationError' + https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' + AtMostOneFunctionValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + function: + type: string + description: The function. + example: function1 + occurrences: + type: integer + format: int32 + description: The occurrences of the function. + minimum: 0 + example: 3 + paths: + type: array + items: + type: string + format: json-path + description: The json paths where the function occurs. + example: + - $.path1 + - $.path2 + - $.path3 + required: + - function + - occurrences + - paths + example: + general: + detail: The pipeline must contain at most one 'function1' function, but 3 were found at ['$.path1', '$.path2', '$.path3']. + function: function1 + occurrences: 3 + paths: + - $.path1 + - $.path2 + - $.path3 + type: https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError + EmptyFieldValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + path: + type: string + format: json-path + description: The missing field. + example: $.field + required: + - path + example: + general: + detail: Required field '$.field' is empty. + path: $.field + type: https://hivemq.com/edge/api/model/EmptyFieldValidationError + FunctionMustBePairedValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + existingFunction: + type: string + description: The existing function. + example: function1 + missingFunction: + type: string + description: The missing function. + example: function2 + required: + - existingFunction + - missingFunction + example: + general: + detail: If 'function1' function is present in the pipeline, 'function2' function must be present as well. + existingFunction: function1 + missingFunction: function2 + type: https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError + IllegalEventTransitionValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + event: + type: string + description: The event name. + example: event1 + fromState: + type: string + description: The event from state. + example: state1 + id: + type: string + description: The event id. + example: abc + path: + type: string + description: The path. + example: $.event + toState: + type: string + description: The event to state. + example: state2 + required: + - event + - fromState + - id + - path + - toState + example: + general: + detail: The transition from state 'state1' to state 'state2' on event 'event1' in '$.event' is not defined for behavior 'abc'. + event: event1 + fromState: state1 + toState: state2 + id: abc + path: $.event + type: https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError + IllegalFunctionValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + event: + type: string + description: The event name. + example: event1 + id: + type: string + description: The function id. + example: abc + path: + type: string + format: json-path + description: The json path. + example: $.event + required: + - event + - id + - path + example: + general: + detail: The function 'abc' is not allowed for event 'event1' in '$.event'. + event: event1 + id: abc + path: $.event + type: https://hivemq.com/edge/api/model/IllegalFunctionValidationError + InvalidFieldLengthValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + actualLength: + type: integer + format: int32 + description: The actual length of the field value. + example: 10 + expectedMinimumLength: + type: integer + format: int32 + description: The minimum length expected for the field value. + minimum: 0 + example: 5 + expectedMaximumLength: + type: integer + format: int32 + description: The maximum length expected for the field value. + minimum: 0 + example: 20 + path: + type: string + format: json-path + description: The invalid json path. + example: $.field + value: + type: string + description: The invalid value. + example: function transform() { return 'Hello, World!'; } + required: + - actualLength + - expectedMinimumLength + - expectedMaximumLength + - path + - value + example: + general: + detail: The length of script field '$.transform' 48 must be between 0 and 20. + actualLength: 48 + minimumLength: 0 + maximumLength: 20 + path: $.transform + value: function transform() { return 'Hello, World!'; } + type: https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError + InvalidFieldValueValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + path: + type: string + format: json-path + description: The invalid json path. + example: $.action.pipeline[1].field + value: + type: string + description: The invalid value. + example: functionDoesNotExist + required: + - path + example: + general: + detail: Referenced function does not exist. + path: $.action.pipeline[1].field + value: functionDoesNotExist + type: https://hivemq.com/edge/api/model/InvalidFieldValueValidationError + InvalidFunctionOrderValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + function: + type: string + description: The function. + example: transform + path: + type: string + format: json-path + description: The json path. + example: $.path + previousFunction: + type: string + description: The previous function. + example: init + required: + - function + - path + - previousFunction + example: + general: + detail: The operation at '$.path' with the functionId 'transform' must be after a 'init' operation. + function: transform + path: $.path + previousFunction: init + type: https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError + InvalidIdentifierValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + path: + type: string + format: json-path + description: The invalid identifier path. + example: $.id + value: + type: string + description: The invalid identifier value. + example: invalidId + required: + - path + - value + example: + general: + detail: Identifier script 'id' must begin with a letter and may only consist of lowercase letters, uppercase letters, numbers, periods, hyphens, and underscores. + path: $.id + value: invalidId + type: https://hivemq.com/edge/api/model/InvalidIdentifierValidationError + InvalidSchemaVersionValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + id: + type: string + description: The schema id. + example: abc + version: + type: string + description: The schema version. + example: '2' + required: + - id + - version + example: + general: + detail: The referenced schema with id 'abc' and version '2' was not found. + id: abc + version: '2' + type: https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError + MissingFieldValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + path: + type: string + format: json-path + description: The missing path. + example: $.id + required: + - path + example: + general: + detail: Required field '$.id' is missing. + path: $.id + type: https://hivemq.com/edge/api/model/MissingFieldValidationError + UnknownVariableValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + path: + type: string + description: The json path of the field. + example: $.path + variables: + type: array + items: + type: string + description: The unknown variables. + example: + - a + - b + - c + required: + - path + - variables + example: + general: + detail: 'Field ''$.path'' contains unknown variables: [a, b, c].' + path: $.path + variables: + - a + - b + - c + type: https://hivemq.com/edge/api/model/UnknownVariableValidationError + UnsupportedFieldValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - type: object + properties: + actualValue: + type: string + description: The actual value. + expectedValue: + type: string + description: The expected value. + path: + type: string + format: json-path + description: The json path. + example: $.id + required: + - actualValue + - expectedValue + - path + example: + general: + detail: Unsupported type 'String' for field '$.id'. Expected type is 'Object'. + actualValue: String + expectedValue: Object + path: $.id + type: https://hivemq.com/edge/api/model/UnsupportedFieldValidationError + BehaviorPolicyValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - oneOf: + - $ref: '#/components/schemas/IllegalEventTransitionValidationError' + - $ref: '#/components/schemas/IllegalFunctionValidationError' + - $ref: '#/components/schemas/InvalidSchemaVersionValidationError' + - $ref: '#/components/schemas/AtLeastOneFieldMissingValidationError' + - $ref: '#/components/schemas/EmptyFieldValidationError' + - $ref: '#/components/schemas/InvalidFieldLengthValidationError' + - $ref: '#/components/schemas/InvalidFieldValueValidationError' + - $ref: '#/components/schemas/InvalidIdentifierValidationError' + - $ref: '#/components/schemas/MissingFieldValidationError' + - $ref: '#/components/schemas/UnsupportedFieldValidationError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/AtLeastOneFieldMissingValidationError: '#/components/schemas/AtLeastOneFieldMissingValidationError' + https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' + https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError: '#/components/schemas/IllegalEventTransitionValidationError' + https://hivemq.com/edge/api/model/IllegalFunctionValidationError: '#/components/schemas/IllegalFunctionValidationError' + https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' + https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' + https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' + https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError: '#/components/schemas/InvalidSchemaVersionValidationError' + https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' + https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' + BehaviorPolicyInvalidErrors: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + childErrors: + type: array + description: List of child validation errors. + items: + $ref: '#/components/schemas/BehaviorPolicyValidationError' + required: + - childErrors + example: + general: + status: 400 + title: Behavior Policy Invalid + detail: Behavior policy is invalid due to validation errors. + type: https://hivemq.com/edge/api/model/BehaviorPolicyInvalidErrors + childErrors: + - detail: The transition from state 'state1' to state 'state2' on event 'event1' in '$.path' is not defined for behavior 'id1'. + fromState: state1 + toState: state2 + path: $.path + id: id1 + type: https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError + BehaviorPolicyNotFoundError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The data policy id. + example: abc + required: + - id + example: + general: + status: 404 + title: Behavior Policy Not Found + detail: Behavior policy with ID 'abc' is not found. + id: abc + type: https://hivemq.com/edge/api/model/BehaviorPolicyNotFoundError + BehaviorPolicyRejectedError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 400 + title: Behavior Policy Rejected + detail: Behavior policy is rejected. + type: https://hivemq.com/edge/api/model/BehaviorPolicyRejectedError + BehaviorPolicyUpdateFailureError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The ID of the policy that failed to update. + example: abc + required: + - id + example: + general: + status: 400 + title: Behavior Policy Update Failed + detail: Behavior policy with ID 'abc' update failed. + id: abc + type: https://hivemq.com/edge/api/model/BehaviorPolicyUpdateFailureError + ClientDisconnectedError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The client id. + example: abc + required: + - id + example: + general: + status: 404 + title: Client Disconnected + detail: Client with ID 'abc' is disconnected. + id: abc + type: https://hivemq.com/edge/api/model/ClientDisconnectedError + ClientNotFoundError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The client id. + example: abc + required: + - id + example: + general: + status: 404 + title: Client Not Found + detail: Client with ID 'abc' is not found. + id: abc + type: https://hivemq.com/edge/api/model/ClientNotFoundError + DataPolicyAlreadyPresentError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The data policy id. + example: abc + required: + - id + example: + general: + status: 409 + title: Data Policy Already Present + detail: The given data policy 'abc' is already present. + id: abc + type: https://hivemq.com/edge/api/model/DataPolicyAlreadyPresentError + DataPolicyCreationFailureError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 400 + title: Data Policy Creation Failed + detail: 'Data policy creation failed: The policy was rejected.' + type: https://hivemq.com/edge/api/model/DataPolicyCreationFailureError + DataPolicyValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - oneOf: + - $ref: '#/components/schemas/AtMostOneFunctionValidationError' + - $ref: '#/components/schemas/FunctionMustBePairedValidationError' + - $ref: '#/components/schemas/InvalidFunctionOrderValidationError' + - $ref: '#/components/schemas/InvalidSchemaVersionValidationError' + - $ref: '#/components/schemas/UnknownVariableValidationError' + - $ref: '#/components/schemas/EmptyFieldValidationError' + - $ref: '#/components/schemas/InvalidFieldLengthValidationError' + - $ref: '#/components/schemas/InvalidFieldValueValidationError' + - $ref: '#/components/schemas/InvalidIdentifierValidationError' + - $ref: '#/components/schemas/MissingFieldValidationError' + - $ref: '#/components/schemas/UnsupportedFieldValidationError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError: '#/components/schemas/AtMostOneFunctionValidationError' + https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' + https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError: '#/components/schemas/FunctionMustBePairedValidationError' + https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' + https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' + https://hivemq.com/edge/api/model/InvalidFunctionOrderValidationError: '#/components/schemas/InvalidFunctionOrderValidationError' + https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' + https://hivemq.com/edge/api/model/InvalidSchemaVersionValidationError: '#/components/schemas/InvalidSchemaVersionValidationError' + https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' + https://hivemq.com/edge/api/model/UnknownVariableValidationError: '#/components/schemas/UnknownVariableValidationError' + https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' + DataPolicyInvalidErrors: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + childErrors: + type: array + description: List of child validation errors. + items: + $ref: '#/components/schemas/DataPolicyValidationError' + required: + - childErrors + example: + general: + status: 400 + title: Data Policy Invalid + detail: Data policy is invalid due to validation errors. + type: https://hivemq.com/edge/api/model/DataPolicyInvalidErrors + childErrors: + - detail: The pipeline must contain at most one 'function1' function, but 3 were found at ['$.path1', '$.path2', '$.path3']. + function: function1 + occurrences: 3 + paths: + - $.path1 + - $.path2 + - $.path3 + type: https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError + DataPolicyNotFoundError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The data policy id. + example: abc + required: + - id + example: + general: + status: 404 + title: Data Policy Not Found + detail: Data policy with ID 'abc' is not found. + id: abc + type: https://hivemq.com/edge/api/model/DataPolicyNotFoundError + DataPolicyRejectedError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 400 + title: Data Policy Rejected + detail: Data policy is rejected. + type: https://hivemq.com/edge/api/model/DataPolicyRejectedError + DataPolicyUpdateFailureError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The ID of the policy that failed to update. + example: abc + required: + - id + example: + general: + status: 400 + title: Data Policy Update Failed + detail: Data policy with ID 'abc' update failed. + id: abc + type: https://hivemq.com/edge/api/model/DataPolicyUpdateFailureError + PolicyIdMismatchError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + actualId: + type: string + description: The actual id. + example: id1 + expectedId: + type: string + description: The expected id. + example: id2 + required: + - actualId + - expectedId + example: + general: + status: 400 + title: Policy ID Mismatch + detail: The policy ID 'id1' in the request parameter does not match the policy ID 'id2' in the policy request body. + id: abc + type: https://hivemq.com/edge/api/model/PolicyIdMismatchError + PolicyInsufficientStorageError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The policy id. + example: abc + required: + - id + example: + general: + status: 507 + title: Policy Insufficient Storage + detail: Policy with ID '123' could not be added because of insufficient server storage. + id: abc + type: https://hivemq.com/edge/api/model/PolicyInsufficientStorageError + PolicyNotFoundError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The policy id. + example: abc + required: + - id + example: + general: + status: 404 + title: Policy Not Found + detail: Policy with ID 'abc' is not found. + id: abc + type: https://hivemq.com/edge/api/model/PolicyNotFoundError + SchemaAlreadyPresentError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The schema id. + example: abc + required: + - id + example: + general: + status: 409 + title: Schema Already Present + detail: The given schema is already present as the latest version for the schema id 'abc'. + id: abc + type: https://hivemq.com/edge/api/model/SchemaAlreadyPresentError + SchemaEtagMismatchError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The schema id. + example: abc + eTag: + type: string + description: The eTag. + example: 33a64df551425fcc55e4d42a148795d9f25f89d4 + required: + - id + example: + general: + status: 412 + title: Schema eTag Mismatch + detail: Schema with id 'abc' does not match the given etag '33a64df551425fcc55e4d42a148795d9f25f89d4'. + id: abc + eTag: 33a64df551425fcc55e4d42a148795d9f25f89d4 + type: https://hivemq.com/edge/api/model/SchemaEtagMismatchError + SchemaInsufficientStorageError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The policy id. + example: abc + required: + - id + example: + general: + status: 507 + title: Schema Insufficient Storage + detail: Schema with ID '123' could not be added because of insufficient server storage. + id: abc + type: https://hivemq.com/edge/api/model/SchemaInsufficientStorageError + SchemaValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - oneOf: + - $ref: '#/components/schemas/EmptyFieldValidationError' + - $ref: '#/components/schemas/InvalidFieldLengthValidationError' + - $ref: '#/components/schemas/InvalidFieldValueValidationError' + - $ref: '#/components/schemas/InvalidIdentifierValidationError' + - $ref: '#/components/schemas/MissingFieldValidationError' + - $ref: '#/components/schemas/UnsupportedFieldValidationError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/EmptyFieldValidationError: '#/components/schemas/EmptyFieldValidationError' + https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' + https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' + https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' + https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' + https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' + SchemaInvalidErrors: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + childErrors: + type: array + description: List of child validation errors. + items: + $ref: '#/components/schemas/SchemaValidationError' + required: + - childErrors + example: + general: + status: 400 + title: Schema Invalid + detail: Schema is invalid due to validation errors. + type: https://hivemq.com/edge/api/model/SchemaInvalidErrors + childErrors: + - detail: The length of script field '$.id' 1025 must be between 0 and 1024. + paths: $.id + value: aaa...aaa + actualLength: 1025 + expectedMinimumLength: 0 + expectedMaximumLength: 1024 + type: https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError + SchemaNotFoundError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The schema ID. + example: abc + required: + - id + example: + general: + status: 404 + title: Schema Not Found + detail: Schema with ID 'abc' is not found. + id: abc + type: https://hivemq.com/edge/api/model/SchemaNotFoundError + SchemaParsingFailureError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + alias: + type: string + description: The schema alias. + example: abc + required: + - alias + example: + general: + status: 400 + title: Schema Parsing Failure + detail: The given schema 'abc' could not be parsed. + alias: abc + type: https://hivemq.com/edge/api/model/SchemaParsingFailureError + SchemaReferencedError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The schema ID. + example: abc + required: + - id + example: + general: + status: 400 + title: Schema Referenced + detail: Schema with ID 'abc' is referenced. + id: abc + type: https://hivemq.com/edge/api/model/SchemaReferencedError + ScriptAlreadyPresentError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The script id. + example: abc + required: + - id + example: + general: + status: 409 + title: Script Already Present + detail: The given script 'abc' is already present. + id: abc + type: https://hivemq.com/edge/api/model/ScriptAlreadyPresentError + ScriptCreationFailureError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 400 + title: Script Creation Failure + detail: The given script could not be created. + type: https://hivemq.com/edge/api/model/ScriptCreationFailureError + ScriptEtagMismatchError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The script id. + example: abc + eTag: + type: string + description: The eTag. + example: 33a64df551425fcc55e4d42a148795d9f25f89d4 + required: + - id + example: + general: + status: 412 + title: Script eTag Mismatch + detail: Script with id 'abc' does not match the given etag '33a64df551425fcc55e4d42a148795d9f25f89d4'. + id: abc + eTag: 33a64df551425fcc55e4d42a148795d9f25f89d4 + type: https://hivemq.com/edge/api/model/ScriptEtagMismatchError + ScriptInsufficientStorageError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The policy id. + example: abc + required: + - id + example: + general: + status: 507 + title: Script Insufficient Storage + detail: Script with ID '123' could not be added because of insufficient server storage. + id: abc + type: https://hivemq.com/edge/api/model/ScriptInsufficientStorageError + ScriptValidationError: + allOf: + - $ref: '#/components/schemas/ValidationError' + - oneOf: + - $ref: '#/components/schemas/InvalidFieldLengthValidationError' + - $ref: '#/components/schemas/InvalidFieldValueValidationError' + - $ref: '#/components/schemas/InvalidIdentifierValidationError' + - $ref: '#/components/schemas/MissingFieldValidationError' + - $ref: '#/components/schemas/UnsupportedFieldValidationError' + discriminator: + propertyName: type + mapping: + https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError: '#/components/schemas/InvalidFieldLengthValidationError' + https://hivemq.com/edge/api/model/InvalidFieldValueValidationError: '#/components/schemas/InvalidFieldValueValidationError' + https://hivemq.com/edge/api/model/InvalidIdentifierValidationError: '#/components/schemas/InvalidIdentifierValidationError' + https://hivemq.com/edge/api/model/MissingFieldValidationError: '#/components/schemas/MissingFieldValidationError' + https://hivemq.com/edge/api/model/UnsupportedFieldValidationError: '#/components/schemas/UnsupportedFieldValidationError' + ScriptInvalidErrors: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + childErrors: + type: array + description: List of child validation errors. + items: + $ref: '#/components/schemas/ScriptValidationError' + required: + - childErrors + example: + general: + status: 400 + title: Script Invalid + detail: Script is invalid due to validation errors. + type: https://hivemq.com/edge/api/model/ScriptInvalidErrors + childErrors: + - detail: The length of script field '$.id' 1025 must be between 0 and 1024. + paths: $.id + value: aaa...aaa + actualLength: 1025 + expectedMinimumLength: 0 + expectedMaximumLength: 1024 + type: https://hivemq.com/edge/api/model/InvalidFieldLengthValidationError + ScriptNotFoundError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The script ID. + example: abc + required: + - id + example: + general: + status: 404 + title: Script Not Found + detail: Script with ID 'abc' is not found. + id: abc + type: https://hivemq.com/edge/api/model/ScriptNotFoundError + ScriptParsingFailureError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 400 + title: Script Parsing Failure + detail: The given script 'abc' could not be parsed. + type: https://hivemq.com/edge/api/model/ScriptParsingFailureError + ScriptReferencedError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + id: + type: string + description: The script ID. + example: abc + required: + - id + example: + general: + status: 400 + title: Script Referenced + detail: Script with ID 'abc' is referenced. + id: abc + type: https://hivemq.com/edge/api/model/ScriptReferencedError + ScriptSanitationFailureError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 400 + title: Script Sanitation Failure + detail: The given script could not be sanitized. + type: https://hivemq.com/edge/api/model/ScriptSanitationFailureError + TopicFilterMismatchError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + path: + type: string + description: The json path of the topic filter. + example: $.filter + required: + - path + example: + general: + status: 400 + title: Topic Filter Mismatch + detail: The topic filter '$.filter' mismatches. + type: https://hivemq.com/edge/api/model/TopicFilterMismatchError + InsufficientStorageError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 507 + title: Insufficient Storage + detail: Insufficient Storage. + type: https://hivemq.com/edge/api/model/InsufficientStorageError + InternalServerError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 500 + title: Internal Server Error + detail: An unexpected error occurred, check the logs. + type: https://hivemq.com/edge/api/model/InternalServerError + creation: + status: 500 + title: Internal Server Error + detail: 'An unexpected error occurred: Exception during creation of the Json Schema for functions.' + type: https://hivemq.com/edge/api/model/InternalServerError + InvalidQueryParameterError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + parameter: + type: string + description: The query parameter. + required: + - parameter + example: + general: + status: 400 + title: Query Parameter is Invalid + detail: 'Query parameter ''a'' is invalid: ''a'' could not be parsed.' + parameter: a + type: https://hivemq.com/edge/api/model/InvalidQueryParameterError + PreconditionFailedError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 412 + title: Precondition Failed + detail: 'A precondition required for fulfilling the request was not fulfilled: Policy does not match the given etag ''abc''.' + type: https://hivemq.com/edge/api/model/PreconditionFailedError + RequestBodyMissingError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 400 + title: Required Request Body Missing + detail: Required request body is missing. + type: https://hivemq.com/edge/api/model/RequestBodyMissingError + RequestBodyParameterMissingError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + parameter: + type: string + description: The the missing request body parameter. + required: + - parameter + example: + general: + status: 400 + title: Required Request Body Parameter Missing + detail: Required request body parameter 'a' is missing. + parameter: a + type: https://hivemq.com/edge/api/model/RequestBodyParameterMissingError + TemporaryNotAvailableError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + example: + general: + status: 503 + title: Endpoint Temporarily not Available + detail: The endpoint is temporarily not available, please try again later. + type: https://hivemq.com/edge/api/model/TemporaryNotAvailableError + UrlParameterMissingError: + allOf: + - $ref: '#/components/schemas/ApiProblemDetails' + - type: object + properties: + parameter: + type: string + description: The name of the missing parameter. + required: + - parameter + example: + general: + status: 400 + title: Required URL Parameter Missing + detail: Required URL parameter 'a' is missing. + parameter: a + type: https://hivemq.com/edge/api/model/UrlParameterMissingError + JsonNode: + type: object + description: The arguments of the fsm derived from the behavior policy. + FsmStateInformationItem: + type: object + description: List of result items that are returned by this endpoint + properties: + arguments: + $ref: '#/components/schemas/JsonNode' + behaviorId: + type: string + description: The unique identifier of the policy. + firstSetAt: + type: string description: The timestamp when this state was set the first time. policyId: type: string @@ -5201,8 +6658,6 @@ components: description: List of result items that are returned by this endpoint items: $ref: '#/components/schemas/DataPolicy' - Errors: - type: object PolicyType: description: The type of policy in Data Hub type: string @@ -6450,6 +7905,44 @@ components: $ref: '#/components/schemas/DomainTag' required: - items + NorthboundMappingOwnerList: + type: object + properties: + items: + type: array + description: List of result items that are returned by this endpoint + items: + type: object + required: + - adapterId + - mapping + properties: + adapterId: + type: string + description: The id of the adapter owning the mapping + mapping: + $ref: '#/components/schemas/NorthboundMapping' + required: + - items + SouthboundMappingOwnerList: + type: object + properties: + items: + type: array + description: List of result items that are returned by this endpoint + items: + type: object + required: + - adapterId + - mapping + properties: + adapterId: + type: string + description: The id of the adapter owning the mapping + mapping: + $ref: '#/components/schemas/SouthboundMapping' + required: + - items TagSchema: type: object properties: @@ -6458,6 +7951,25 @@ components: protocolId: type: string description: The id assigned to the protocol adapter type + DomainTagOwnerList: + type: object + properties: + items: + type: array + description: List of result items that are returned by this endpoint + items: + type: object + required: + - adapterId + - mapping + properties: + adapterId: + type: string + description: The id of the adapter owning the tag + mapping: + $ref: '#/components/schemas/DomainTag' + required: + - items ProtocolAdapterCategory: type: object description: The category of the adapter diff --git a/hivemq-edge-openapi/openapi/openapi.yaml b/hivemq-edge-openapi/openapi/openapi.yaml index c9595b9574..a063b46b72 100644 --- a/hivemq-edge-openapi/openapi/openapi.yaml +++ b/hivemq-edge-openapi/openapi/openapi.yaml @@ -30,7 +30,7 @@ info: imported into popular API tooling (e.g. Postman) or can be used to generate client-code for multiple programming languages. title: HiveMQ Edge REST API - version: 2025.18-SNAPSHOT + version: 2025.19-SNAPSHOT x-logo: url: https://www.hivemq.com/img/svg/hivemq-bee.svg tags: From 0f671108f467a466b09b6388c4075cbd4de47546 Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Wed, 29 Oct 2025 10:26:00 +0100 Subject: [PATCH 120/121] refactor: Add JsonInclude(JsonInclude.Include.NON_NULL) --- hivemq-edge-openapi/openapi/templates/Java/README.md | 9 +++++++-- .../openapi/templates/Java/typeInfoAnnotation.mustache | 3 ++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/hivemq-edge-openapi/openapi/templates/Java/README.md b/hivemq-edge-openapi/openapi/templates/Java/README.md index 2b408e9b31..af0b0a5635 100644 --- a/hivemq-edge-openapi/openapi/templates/Java/README.md +++ b/hivemq-edge-openapi/openapi/templates/Java/README.md @@ -20,10 +20,15 @@ The discriminator name `type` conflicts with the JackSon `type`. This patch chan @JsonIgnoreProperties( - value = "{{{discriminator.propertyBaseName}}}", // ignore manually set {{{discriminator.propertyBaseName}}}, it will be automatically generated by Jackson during serialization - allowSetters = true // allows the {{{discriminator.propertyBaseName}}} to be set during deserialization - value = "json{{{discriminator.propertyBaseName}}}", // ignore manually set json{{{discriminator.propertyBaseName}}}, it will be automatically generated by Jackson during serialization - allowSetters = true // allows the json{{{discriminator.propertyBaseName}}} to be set during deserialization ++ value = "json{{{discriminator.propertyBaseName}}}", // ignore manually set json{{{discriminator.propertyBaseName}}}, it will be automatically generated by Jackson during serialization ++ allowSetters = true // allows the json{{{discriminator.propertyBaseName}}} to be set during deserialization ) - @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "{{{discriminator.propertyBaseName}}}", visible = true) + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "json{{{discriminator.propertyBaseName}}}", visible = true) + +{{#discriminator.mappedModels}} +{{#-first}} ++ @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) +@JsonSubTypes({ ``` diff --git a/hivemq-edge-openapi/openapi/templates/Java/typeInfoAnnotation.mustache b/hivemq-edge-openapi/openapi/templates/Java/typeInfoAnnotation.mustache index 76594d1956..154f75c728 100644 --- a/hivemq-edge-openapi/openapi/templates/Java/typeInfoAnnotation.mustache +++ b/hivemq-edge-openapi/openapi/templates/Java/typeInfoAnnotation.mustache @@ -8,6 +8,7 @@ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "json{{{discriminator.propertyBaseName}}}", visible = true) {{#discriminator.mappedModels}} {{#-first}} +@com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) @JsonSubTypes({ {{/-first}} @JsonSubTypes.Type(value = {{modelName}}.class, name = "{{^vendorExtensions.x-discriminator-value}}{{mappingName}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{vendorExtensions.x-discriminator-value}}}{{/vendorExtensions.x-discriminator-value}}"), @@ -21,4 +22,4 @@ {{/-first}} @JsonbSubtype(alias = "{{^vendorExtensions.x-discriminator-value}}{{mappingName}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{vendorExtensions.x-discriminator-value}}}{{/vendorExtensions.x-discriminator-value}}", type = {{modelName}}.class), {{#-last}} -}{{/-last}}{{/discriminator.mappedModels}}){{/jsonbPolymorphism}} \ No newline at end of file +}{{/-last}}{{/discriminator.mappedModels}}){{/jsonbPolymorphism}} From 35d9cce2aead6e58669b62c32213d01441f3fd2e Mon Sep 17 00:00:00 2001 From: Sam Cao Date: Wed, 29 Oct 2025 12:23:52 +0100 Subject: [PATCH 121/121] Revert "refactor: Add JsonInclude(JsonInclude.Include.NON_NULL)" This reverts commit 539072af766adefc4a7a9de827537f737fdebfb5. --- hivemq-edge-openapi/openapi/templates/Java/README.md | 9 ++------- .../openapi/templates/Java/typeInfoAnnotation.mustache | 3 +-- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/hivemq-edge-openapi/openapi/templates/Java/README.md b/hivemq-edge-openapi/openapi/templates/Java/README.md index af0b0a5635..2b408e9b31 100644 --- a/hivemq-edge-openapi/openapi/templates/Java/README.md +++ b/hivemq-edge-openapi/openapi/templates/Java/README.md @@ -20,15 +20,10 @@ The discriminator name `type` conflicts with the JackSon `type`. This patch chan @JsonIgnoreProperties( - value = "{{{discriminator.propertyBaseName}}}", // ignore manually set {{{discriminator.propertyBaseName}}}, it will be automatically generated by Jackson during serialization - allowSetters = true // allows the {{{discriminator.propertyBaseName}}} to be set during deserialization -+ value = "json{{{discriminator.propertyBaseName}}}", // ignore manually set json{{{discriminator.propertyBaseName}}}, it will be automatically generated by Jackson during serialization -+ allowSetters = true // allows the json{{{discriminator.propertyBaseName}}} to be set during deserialization + value = "json{{{discriminator.propertyBaseName}}}", // ignore manually set json{{{discriminator.propertyBaseName}}}, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the json{{{discriminator.propertyBaseName}}} to be set during deserialization ) - @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "{{{discriminator.propertyBaseName}}}", visible = true) + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "json{{{discriminator.propertyBaseName}}}", visible = true) - -{{#discriminator.mappedModels}} -{{#-first}} -+ @com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) -@JsonSubTypes({ ``` diff --git a/hivemq-edge-openapi/openapi/templates/Java/typeInfoAnnotation.mustache b/hivemq-edge-openapi/openapi/templates/Java/typeInfoAnnotation.mustache index 154f75c728..76594d1956 100644 --- a/hivemq-edge-openapi/openapi/templates/Java/typeInfoAnnotation.mustache +++ b/hivemq-edge-openapi/openapi/templates/Java/typeInfoAnnotation.mustache @@ -8,7 +8,6 @@ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "json{{{discriminator.propertyBaseName}}}", visible = true) {{#discriminator.mappedModels}} {{#-first}} -@com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL) @JsonSubTypes({ {{/-first}} @JsonSubTypes.Type(value = {{modelName}}.class, name = "{{^vendorExtensions.x-discriminator-value}}{{mappingName}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{vendorExtensions.x-discriminator-value}}}{{/vendorExtensions.x-discriminator-value}}"), @@ -22,4 +21,4 @@ {{/-first}} @JsonbSubtype(alias = "{{^vendorExtensions.x-discriminator-value}}{{mappingName}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{vendorExtensions.x-discriminator-value}}}{{/vendorExtensions.x-discriminator-value}}", type = {{modelName}}.class), {{#-last}} -}{{/-last}}{{/discriminator.mappedModels}}){{/jsonbPolymorphism}} +}{{/-last}}{{/discriminator.mappedModels}}){{/jsonbPolymorphism}} \ No newline at end of file