Skip to content

Commit e84651a

Browse files
committed
refactor: Add example to DataHub validation errors 1
1 parent db41268 commit e84651a

File tree

5 files changed

+98
-8
lines changed

5 files changed

+98
-8
lines changed

ext/hivemq-edge-openapi-2025.9-SNAPSHOT.yaml

Lines changed: 49 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4971,20 +4971,37 @@ components:
49714971
function:
49724972
type: string
49734973
description: The function.
4974+
example: function1
49744975
occurrences:
49754976
type: integer
49764977
format: int32
49774978
description: The occurrences of the function.
4979+
minimum: 0
4980+
example: 3
49784981
paths:
49794982
type: array
49804983
items:
49814984
type: string
49824985
format: json-path
49834986
description: The json paths where the function occurs.
4987+
example:
4988+
- $.path1
4989+
- $.path2
4990+
- $.path3
49844991
required:
49854992
- function
49864993
- occurrences
49874994
- paths
4995+
example:
4996+
general:
4997+
detail: The pipeline must contain at most one 'function1' function, but 3 were found at ['$.path1', '$.path2', '$.path3'].
4998+
function: function1
4999+
occurrences: 3
5000+
paths:
5001+
- $.path1
5002+
- $.path2
5003+
- $.path3
5004+
type: https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError
49885005
EmptyFieldValidationError:
49895006
allOf:
49905007
- $ref: '#/components/schemas/ValidationError'
@@ -5010,12 +5027,20 @@ components:
50105027
existingFunction:
50115028
type: string
50125029
description: The existing function.
5030+
example: function1
50135031
missingFunction:
50145032
type: string
50155033
description: The missing function.
5034+
example: function2
50165035
required:
50175036
- existingFunction
50185037
- missingFunction
5038+
example:
5039+
general:
5040+
detail: If 'function1' function is present in the pipeline, 'function2' function must be present as well.
5041+
existingFunction: function1
5042+
missingFunction: function2
5043+
type: https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError
50195044
GeneralPolicyValidationError:
50205045
allOf:
50215046
- $ref: '#/components/schemas/ValidationError'
@@ -5027,24 +5052,38 @@ components:
50275052
event:
50285053
type: string
50295054
description: The event name.
5055+
example: event1
50305056
fromState:
50315057
type: string
50325058
description: The event from state.
5059+
example: state1
50335060
id:
50345061
type: string
50355062
description: The event id.
5063+
example: abc
50365064
path:
50375065
type: string
50385066
description: The path.
5067+
example: $.event
50395068
toState:
50405069
type: string
50415070
description: The event to state.
5071+
example: state2
50425072
required:
50435073
- event
50445074
- fromState
50455075
- id
50465076
- path
50475077
- toState
5078+
example:
5079+
general:
5080+
detail: The transition from state 'state1' to state 'state2' on event 'event1' in '$.event' is not defined for behavior 'abc'.
5081+
event: event1
5082+
fromState: state1
5083+
toState: state2
5084+
id: abc
5085+
path: $.event
5086+
type: https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError
50485087
IllegalFunctionValidationError:
50495088
allOf:
50505089
- $ref: '#/components/schemas/ValidationError'
@@ -5053,21 +5092,27 @@ components:
50535092
event:
50545093
type: string
50555094
description: The event name.
5095+
example: event1
50565096
id:
50575097
type: string
50585098
description: The function id.
5059-
message:
5060-
type: string
5061-
description: The error message.
5099+
example: abc
50625100
path:
50635101
type: string
50645102
format: json-path
50655103
description: The json path.
5104+
example: $.event
50665105
required:
50675106
- event
50685107
- id
5069-
- message
50705108
- path
5109+
example:
5110+
general:
5111+
detail: The function 'abc' is not allowed for event 'event1' in '$.event'.
5112+
event: event1
5113+
id: abc
5114+
path: $.event
5115+
type: https://hivemq.com/edge/api/model/IllegalFunctionValidationError
50715116
InvalidFieldLengthValidationError:
50725117
allOf:
50735118
- $ref: '#/components/schemas/ValidationError'

ext/openAPI/components/schemas/errors/datahub/AtMostOneFunctionValidationError.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,34 @@ allOf:
55
function:
66
type: string
77
description: The function.
8+
example: "function1"
89
occurrences:
910
type: integer
1011
format: int32
1112
description: The occurrences of the function.
13+
minimum: 0
14+
example: 3
1215
paths:
1316
type: array
1417
items:
1518
type: string
1619
format: json-path
1720
description: The json paths where the function occurs.
21+
example:
22+
- "$.path1"
23+
- "$.path2"
24+
- "$.path3"
1825
required:
1926
- function
2027
- occurrences
2128
- paths
29+
example:
30+
general:
31+
detail: "The pipeline must contain at most one 'function1' function, but 3 were found at ['$.path1', '$.path2', '$.path3']."
32+
function: "function1"
33+
occurrences: 3
34+
paths:
35+
- "$.path1"
36+
- "$.path2"
37+
- "$.path3"
38+
type: "https://hivemq.com/edge/api/model/AtMostOneFunctionValidationError"

ext/openAPI/components/schemas/errors/datahub/FunctionMustBePairedValidationError.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,17 @@ allOf:
55
existingFunction:
66
type: string
77
description: The existing function.
8+
example: "function1"
89
missingFunction:
910
type: string
1011
description: The missing function.
12+
example: "function2"
1113
required:
1214
- existingFunction
1315
- missingFunction
16+
example:
17+
general:
18+
detail: "If 'function1' function is present in the pipeline, 'function2' function must be present as well."
19+
existingFunction: "function1"
20+
missingFunction: "function2"
21+
type: "https://hivemq.com/edge/api/model/FunctionMustBePairedValidationError"

ext/openAPI/components/schemas/errors/datahub/IllegalEventTransitionValidationError.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,35 @@ allOf:
55
event:
66
type: string
77
description: The event name.
8+
example: "event1"
89
fromState:
910
type: string
1011
description: The event from state.
12+
example: "state1"
1113
id:
1214
type: string
1315
description: The event id.
16+
example: "abc"
1417
path:
1518
type: string
1619
description: The path.
20+
example: "$.event"
1721
toState:
1822
type: string
1923
description: The event to state.
24+
example: "state2"
2025
required:
2126
- event
2227
- fromState
2328
- id
2429
- path
2530
- toState
31+
example:
32+
general:
33+
detail: "The transition from state 'state1' to state 'state2' on event 'event1' in '$.event' is not defined for behavior 'abc'."
34+
event: "event1"
35+
fromState: "state1"
36+
toState: "state2"
37+
id: "abc"
38+
path: "$.event"
39+
type: "https://hivemq.com/edge/api/model/IllegalEventTransitionValidationError"

ext/openAPI/components/schemas/errors/datahub/IllegalFunctionValidationError.yaml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,24 @@ allOf:
55
event:
66
type: string
77
description: The event name.
8+
example: "event1"
89
id:
910
type: string
1011
description: The function id.
11-
message:
12-
type: string
13-
description: The error message.
12+
example: "abc"
1413
path:
1514
type: string
1615
format: json-path
1716
description: The json path.
17+
example: "$.event"
1818
required:
1919
- event
2020
- id
21-
- message
2221
- path
22+
example:
23+
general:
24+
detail: "The function 'abc' is not allowed for event 'event1' in '$.event'."
25+
event: "event1"
26+
id: "abc"
27+
path: "$.event"
28+
type: "https://hivemq.com/edge/api/model/IllegalFunctionValidationError"

0 commit comments

Comments
 (0)