-
Notifications
You must be signed in to change notification settings - Fork 36
Refactor Errors for DataHub Validation #993
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
caoccao
wants to merge
116
commits into
master
Choose a base branch
from
refactor/29914-error-redesign-v2
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
116 commits
Select commit
Hold shift + click to select a range
10b3ad9
refactor: Add RequestBodyMissingError, TemporaryNotAvailableError
caoccao ef7ea90
refactor: Support both behavior and data policies
caoccao e9a340e
feat: Add equals(), hashCode(), toString()
caoccao cb58566
refactor: Rename to ApiError
caoccao f6f0a2b
refactor: Add type auto-generation
caoccao 6941ef6
fix: Fix a typo
caoccao 2b7ed23
feat: Add some valication errors for DataHub
caoccao 0d63ce4
refactor: Move DataHub errors
caoccao 6ebde9d
feat: Add more common errors
caoccao c3635d8
refactor: Replace common errors with generated ones
caoccao cf9912e
refactor: Refactor validation errors 1
caoccao 1a82472
refactor: Refactor DataHub errors 1
caoccao 0c9b2a3
refactor: Refactor DataHub errors 2
caoccao 00e50a5
refactor: Refactor DataHub errors 3
caoccao f56b7ae
refactor: Clean up ApiError
caoccao 7f73a24
refactor: Update get by id for behavior policy
caoccao 8967c27
refactor: Resolve comments from PR
caoccao ed87f5f
refactor: Update put by id for behavior policy
caoccao d4fb25c
refactor: Update post by id for behavior policy
caoccao f13657d
refactor: Update get, delete for behavior policy
caoccao f43306a
refactor: Add client errors for behavior validation states
caoccao 4bb6082
refactor: Refactor post for script
caoccao 2631977
refactor: Refactor get for script
caoccao 67e31db
refactor: Refactor get all for script
caoccao 9ee7def
refactor: Refactor delete for script
caoccao 2a4895f
refactor: Refactor post for schema
caoccao 4f68ca2
refactor: Refactor get for schema
caoccao ef358c3
refactor: Refactor get all for schema
caoccao f824f82
refactor: Refactor delete for schema
caoccao 974b568
refactor: Refactor get for fsm
caoccao 2eb5362
refactor: Refactor for functions
caoccao d49f787
refactor: Mark errors in ProblemDetails as @Deprecated
caoccao bd12d17
Merge pull request #995
vanch3d f4e23e4
Merge pull request #997
vanch3d 93ca866
Merge pull request #998
vanch3d c01961f
refactor: Reuse ProblemDetails, add RequestBodyParameterMissingError
caoccao 1c0ebf8
refactor: Remove x-implements: - com.hivemq.api.errors.OpenApiValida…
caoccao d402916
refactor: Remove x-implements: - com.hivemq.api.errors.OpenApiError
caoccao 9bba335
refactor: Restore errors, remove childErrors
caoccao 3227b43
fix: Fix function specs
caoccao 9fddb73
fix: Remove default status from errors
caoccao abb54cf
refactor: Add childErrors
caoccao 2fae0de
refactor: Remove ValidationErrors
caoccao b64017b
refactor: field to path
caoccao 49b3499
fix: Revert application/problem+json to application/json
caoccao 994cd44
feat: Add mapping to datahub API schema responses
caoccao 15344e8
Merge pull request #999
vanch3d 86da335
refactor: Remove title from GeneralPolicyValidationError
caoccao 54cc530
refactor: Add example to InsufficientStorageError
caoccao 0262ed2
refactor: Add example to InternalServerError
caoccao e12d1c8
refactor: Add example to InvalidQueryParameterError
caoccao f0b549c
refactor: Add example to PreconditionFailedError
caoccao 54cf7ae
refactor: Add example to RequestBodyMissingError
caoccao ec4d465
refactor: Add example to RequestBodyParameterMissingError
caoccao 067f33a
refactor: Add example to TemporaryNotAvailableError
caoccao a2062f1
refactor: Add example to UrlParameterMissingError
caoccao 627bf5c
refactor: Add example to AtLeastOneFieldMissingValidationError
caoccao 6dde9d5
refactor: Add example to EmptyFieldValidationError
caoccao f638674
refactor: Add example to InvalidFieldLengthValidationError
caoccao e1216b8
refactor: Add example to InvalidFieldValueValidationError
caoccao f6a3e3e
refactor: Add example to InvalidIdentifierValidationError
caoccao fdff373
refactor: Add example to MissingFieldValidationError, UnsupportedFiel…
caoccao fbb9d8f
refactor: Add example to BehaviorPolicyAlreadyPresentError
caoccao 49c3604
refactor: Add example to BehaviorPolicyCreationFailureError
caoccao fd15549
refactor: Add example to BehaviorPolicyInvalidErrors
caoccao 6e0c54e
refactor: Add example to BehaviorPolicyNotFoundError
caoccao 2310319
refactor: Add example to BehaviorPolicyRejectedError, BehaviorPolicyU…
caoccao 0ec52ea
refactor: Add example to ClientDisconnectedError, ClientNotFoundError
caoccao 05a6ca9
refactor: Add example to DataPolicyAlreadyPresentError
caoccao 24f4779
refactor: Add example to DataPolicyCreationFailureError
caoccao 459ea9a
refactor: Add example to DataPolicyInvalidErrors
caoccao 562976d
refactor: Add example to DataPolicyNotFoundError, DataPolicyRejectedE…
caoccao 15f93b6
refactor: Add example to PolicyIdMismatchError, PolicyNotFoundError
caoccao 7ca9d81
refactor: Add example to SchemaAlreadyPresentError, SchemaEtagMismatc…
caoccao 5e4775b
refactor: Add example to SchemaInvalidErrors
caoccao 89f23f5
refactor: Add example to SchemaNotFoundError
caoccao 10030ee
refactor: Add example to SchemaParsingFailureError, SchemaReferencedE…
caoccao 1809468
refactor: Add example to ScriptAlreadyPresentError, ScriptCreationFai…
caoccao d704f6b
refactor: Add example to ScriptEtagMismatchError
caoccao 6beb557
refactor: Add example to ScriptInvalidErrors
caoccao c371ab6
refactor: Add example to ScriptNotFoundError, ScriptParsingFailureError
caoccao b4a0490
refactor: Add example to ScriptReferencedError, ScriptSanitationFailu…
caoccao f32eb41
refactor: Add example to TopicFilterMismatchError
caoccao 20497d2
refactor: Add example to DataHub validation errors 1
caoccao 652c4fe
refactor: Add example to DataHub validation errors 2
caoccao a3c54e3
refactor: Remove GeneralPolicyValidationError
caoccao dae95be
refactor: Add PolicyInsufficientStorageError, SchemaInsufficientStora…
caoccao 6da3d67
feat: add a root file for the data hub paths
vanch3d df4a50c
fix: Generate openapi spec
caoccao de5db93
fix: Remove duplicated const
caoccao 4d232d1
refactor: Change 500 for /api/v1/data-hub/interpolation-variables
caoccao b85a4ba
feat: Add openAPI/templates/Java/typeInfoAnnotation.mustache
caoccao 0de054e
fix: Change openapi to openAPI
caoccao 4dd57a0
chorg: Rebase from master
caoccao 8430b99
feat: Add problem+json to all DataHub REST API errors
caoccao 817b940
fix: Fix assertion for problem+json
caoccao 0c7921d
refactor: Move problem+json to HttpContants
caoccao 813fdf4
refactor: Add http error 500 to resources
caoccao 38dedaa
refactor: Add all http errors to resources
caoccao 6b75608
fix: Fix typo
caoccao 9e647a2
test: Add whenLocaleIsEnUS_thenErrorCountShouldMatch()
caoccao 3d88130
refactor: Rename all related classes to I18n
caoccao 0c965e3
fix: Exclude .properties from license check
caoccao 7bcf9ed
refactor: Rename to http-errors-en_US.properties
caoccao e834788
refactor: Log stack trace in the error log
caoccao 78c9b30
refactor: Revise the i18n error template to be thread-safe
caoccao 233f59a
refactor: Revise error enum key generation
caoccao f2b98fc
refactor: Move get() to I18nError
caoccao 5d24ee1
refactor: Rename some errors to be more specific
caoccao bf72642
fix: Add classloader to i18n
caoccao fb2c2e3
refactor: Rename ApiError to ApiProblemDetails
caoccao 44ecb6b
fix: Remove ApiError from ErrorResponseUtil
caoccao ef7dd77
fix: Regenerate openapi spec
caoccao d4d5254
feat: Update openapi spec
caoccao 6e8d383
fix: Reorg the openapi spec
caoccao defdcb4
[frontend] enable problem+json in the request headers of the HTTP client
vanch3d File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
hivemq-edge-frontend/src/extensions/datahub/hooks/useGetFilteredFunctions.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 } | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ properties: | |
detail: | ||
type: string | ||
errors: | ||
deprecated: true | ||
type: array | ||
items: | ||
$ref: ./Error.yaml | ||
|
54 changes: 54 additions & 0 deletions
54
hivemq-edge-openapi/openapi/components/schemas/errors/ApiProblemDetails.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
allOf: | ||
- $ref: "../ProblemDetails.yaml" | ||
- type: object | ||
required: | ||
- detail | ||
- status | ||
- type | ||
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/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" | ||
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/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" | ||
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" | ||
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/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" | ||
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" |
38 changes: 38 additions & 0 deletions
38
...e-openapi/openapi/components/schemas/errors/datahub/AtMostOneFunctionValidationError.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
allOf: | ||
- $ref: "../validation/ValidationError.yaml" | ||
- 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 | ||
caoccao marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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" |
17 changes: 17 additions & 0 deletions
17
...-openapi/openapi/components/schemas/errors/datahub/BehaviorPolicyAlreadyPresentError.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
allOf: | ||
- $ref: "../ApiProblemDetails.yaml" | ||
- 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" |
8 changes: 8 additions & 0 deletions
8
...openapi/openapi/components/schemas/errors/datahub/BehaviorPolicyCreationFailureError.yaml
caoccao marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
allOf: | ||
- $ref: "../ApiProblemDetails.yaml" | ||
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" |
24 changes: 24 additions & 0 deletions
24
...q-edge-openapi/openapi/components/schemas/errors/datahub/BehaviorPolicyInvalidErrors.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
allOf: | ||
- $ref: "../ApiProblemDetails.yaml" | ||
- type: object | ||
properties: | ||
childErrors: | ||
type: array | ||
description: List of child validation errors. | ||
items: | ||
$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" |
17 changes: 17 additions & 0 deletions
17
...q-edge-openapi/openapi/components/schemas/errors/datahub/BehaviorPolicyNotFoundError.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
allOf: | ||
- $ref: "../ApiProblemDetails.yaml" | ||
- 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" |
8 changes: 8 additions & 0 deletions
8
...q-edge-openapi/openapi/components/schemas/errors/datahub/BehaviorPolicyRejectedError.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
allOf: | ||
- $ref: "../ApiProblemDetails.yaml" | ||
example: | ||
general: | ||
status: 400 | ||
title: "Behavior Policy Rejected" | ||
detail: "Behavior policy is rejected." | ||
type: "https://hivemq.com/edge/api/model/BehaviorPolicyRejectedError" |
17 changes: 17 additions & 0 deletions
17
...e-openapi/openapi/components/schemas/errors/datahub/BehaviorPolicyUpdateFailureError.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
allOf: | ||
- $ref: "../ApiProblemDetails.yaml" | ||
- 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" |
26 changes: 26 additions & 0 deletions
26
...edge-openapi/openapi/components/schemas/errors/datahub/BehaviorPolicyValidationError.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
allOf: | ||
caoccao marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- $ref: "../validation/ValidationError.yaml" | ||
- oneOf: | ||
- $ref: "./IllegalEventTransitionValidationError.yaml" | ||
- $ref: "./IllegalFunctionValidationError.yaml" | ||
- $ref: "./InvalidSchemaVersionValidationError.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/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" |
17 changes: 17 additions & 0 deletions
17
hivemq-edge-openapi/openapi/components/schemas/errors/datahub/ClientDisconnectedError.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
allOf: | ||
- $ref: "../ApiProblemDetails.yaml" | ||
- 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" |
17 changes: 17 additions & 0 deletions
17
hivemq-edge-openapi/openapi/components/schemas/errors/datahub/ClientNotFoundError.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
allOf: | ||
- $ref: "../ApiProblemDetails.yaml" | ||
- 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" |
17 changes: 17 additions & 0 deletions
17
...edge-openapi/openapi/components/schemas/errors/datahub/DataPolicyAlreadyPresentError.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
allOf: | ||
- $ref: "../ApiProblemDetails.yaml" | ||
- 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" |
8 changes: 8 additions & 0 deletions
8
...dge-openapi/openapi/components/schemas/errors/datahub/DataPolicyCreationFailureError.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
allOf: | ||
- $ref: "../ApiProblemDetails.yaml" | ||
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" |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.