diff --git a/specs/ingestion/common/schemas/transformation.yml b/specs/ingestion/common/schemas/transformation.yml index c36dca2918a..e65af3c4472 100644 --- a/specs/ingestion/common/schemas/transformation.yml +++ b/specs/ingestion/common/schemas/transformation.yml @@ -8,6 +8,10 @@ Transformation: $ref: '#/AuthenticationIDs' code: $ref: '#/Code' + type: + $ref: '#/TransformationType' + input: + $ref: '#/TransformationInput' name: $ref: '#/Name' description: @@ -25,9 +29,50 @@ Transformation: - createdAt - updatedAt +TransformationType: + type: string + description: The type of transformation, which can be either 'code' or 'noCode'. + enum: + - code + - noCode + +TransformationInput: + description: The input for the transformation, which can be either code or a no-code configuration. + oneOf: + - $ref: '#/TransformationCode' + - $ref: '#/TransformationNoCode' + +TransformationCode: + type: object + additionalProperties: false + description: Input for a transformation that contains the source code of the transformation. + properties: + code: + type: string + description: The source code of the transformation. + required: + - code + +TransformationNoCode: + type: object + additionalProperties: false + description: Input for a no-code transformation that contains a series of steps. + properties: + steps: + type: array + items: + $ref: '#/TransformationNoCodeStep' + required: + - steps + +TransformationNoCodeStep: + type: object + description: A step in a no-code transformation. + Code: type: string - description: The source code of the transformation. + deprecated: true + description: It is deprecated. Use the `input` field with proper `type` instead to specify the transformation code. Name: type: string @@ -52,13 +97,18 @@ TransformationCreate: $ref: '#/Code' name: $ref: '#/Name' + type: + $ref: '#/TransformationType' + input: + $ref: '#/TransformationInput' description: $ref: '#/Description' authenticationIDs: $ref: '#/AuthenticationIDs' required: - - code - name + - type + - input TransformationCreateResponse: type: object diff --git a/tests/CTS/requests/ingestion/createTransformation.json b/tests/CTS/requests/ingestion/createTransformation.json index 716380117e4..98eafedc9bf 100644 --- a/tests/CTS/requests/ingestion/createTransformation.json +++ b/tests/CTS/requests/ingestion/createTransformation.json @@ -1,7 +1,8 @@ [ { "parameters": { - "code": "foo", + "input": {"code": "foo"}, + "type": "code", "name": "bar", "description": "baz" }, @@ -9,7 +10,8 @@ "path": "/1/transformations", "method": "POST", "body": { - "code": "foo", + "input": {"code": "foo"}, + "type": "code", "name": "bar", "description": "baz" } diff --git a/tests/CTS/requests/ingestion/updateTransformation.json b/tests/CTS/requests/ingestion/updateTransformation.json index afd8bbed625..c138d7922eb 100644 --- a/tests/CTS/requests/ingestion/updateTransformation.json +++ b/tests/CTS/requests/ingestion/updateTransformation.json @@ -4,7 +4,8 @@ "parameters": { "transformationID": "6c02aeb1-775e-418e-870b-1faccd4b2c0f", "transformationCreate": { - "code": "foo", + "input": {"code": "foo"}, + "type": "code", "name": "bar", "description": "baz" } @@ -13,7 +14,8 @@ "path": "/1/transformations/6c02aeb1-775e-418e-870b-1faccd4b2c0f", "method": "PUT", "body": { - "code": "foo", + "input": {"code": "foo"}, + "type": "code", "name": "bar", "description": "baz" }