Skip to content

Commit 06ad06e

Browse files
authored
feat(specs): update transformation specs for no-code (#4901)
1 parent 13ce98d commit 06ad06e

File tree

3 files changed

+60
-6
lines changed

3 files changed

+60
-6
lines changed

specs/ingestion/common/schemas/transformation.yml

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ Transformation:
88
$ref: '#/AuthenticationIDs'
99
code:
1010
$ref: '#/Code'
11+
type:
12+
$ref: '#/TransformationType'
13+
input:
14+
$ref: '#/TransformationInput'
1115
name:
1216
$ref: '#/Name'
1317
description:
@@ -25,9 +29,50 @@ Transformation:
2529
- createdAt
2630
- updatedAt
2731

32+
TransformationType:
33+
type: string
34+
description: The type of transformation, which can be either 'code' or 'noCode'.
35+
enum:
36+
- code
37+
- noCode
38+
39+
TransformationInput:
40+
description: The input for the transformation, which can be either code or a no-code configuration.
41+
oneOf:
42+
- $ref: '#/TransformationCode'
43+
- $ref: '#/TransformationNoCode'
44+
45+
TransformationCode:
46+
type: object
47+
additionalProperties: false
48+
description: Input for a transformation that contains the source code of the transformation.
49+
properties:
50+
code:
51+
type: string
52+
description: The source code of the transformation.
53+
required:
54+
- code
55+
56+
TransformationNoCode:
57+
type: object
58+
additionalProperties: false
59+
description: Input for a no-code transformation that contains a series of steps.
60+
properties:
61+
steps:
62+
type: array
63+
items:
64+
$ref: '#/TransformationNoCodeStep'
65+
required:
66+
- steps
67+
68+
TransformationNoCodeStep:
69+
type: object
70+
description: A step in a no-code transformation.
71+
2872
Code:
2973
type: string
30-
description: The source code of the transformation.
74+
deprecated: true
75+
description: It is deprecated. Use the `input` field with proper `type` instead to specify the transformation code.
3176

3277
Name:
3378
type: string
@@ -52,13 +97,18 @@ TransformationCreate:
5297
$ref: '#/Code'
5398
name:
5499
$ref: '#/Name'
100+
type:
101+
$ref: '#/TransformationType'
102+
input:
103+
$ref: '#/TransformationInput'
55104
description:
56105
$ref: '#/Description'
57106
authenticationIDs:
58107
$ref: '#/AuthenticationIDs'
59108
required:
60-
- code
61109
- name
110+
- type
111+
- input
62112

63113
TransformationCreateResponse:
64114
type: object

tests/CTS/requests/ingestion/createTransformation.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
[
22
{
33
"parameters": {
4-
"code": "foo",
4+
"input": {"code": "foo"},
5+
"type": "code",
56
"name": "bar",
67
"description": "baz"
78
},
89
"request": {
910
"path": "/1/transformations",
1011
"method": "POST",
1112
"body": {
12-
"code": "foo",
13+
"input": {"code": "foo"},
14+
"type": "code",
1315
"name": "bar",
1416
"description": "baz"
1517
}

tests/CTS/requests/ingestion/updateTransformation.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"parameters": {
55
"transformationID": "6c02aeb1-775e-418e-870b-1faccd4b2c0f",
66
"transformationCreate": {
7-
"code": "foo",
7+
"input": {"code": "foo"},
8+
"type": "code",
89
"name": "bar",
910
"description": "baz"
1011
}
@@ -13,7 +14,8 @@
1314
"path": "/1/transformations/6c02aeb1-775e-418e-870b-1faccd4b2c0f",
1415
"method": "PUT",
1516
"body": {
16-
"code": "foo",
17+
"input": {"code": "foo"},
18+
"type": "code",
1719
"name": "bar",
1820
"description": "baz"
1921
}

0 commit comments

Comments
 (0)