Skip to content

Commit 4e6ed3b

Browse files
committed
update component schema for new transformations
1 parent 18154a1 commit 4e6ed3b

File tree

2 files changed

+238
-96
lines changed

2 files changed

+238
-96
lines changed

airbyte_cdk/sources/declarative/declarative_component_schema.yaml

Lines changed: 123 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ definitions:
168168
- X-Auth-Token
169169
inject_into:
170170
title: Inject API Key Into Outgoing HTTP Request
171-
description: Configure how the API Key will be sent in requests to the source API. Either inject_into or header has to be defined.
171+
description: Configure how the API Key will be sent in requests to the source API.
172172
"$ref": "#/definitions/RequestOption"
173173
examples:
174174
- inject_into: header
@@ -3811,17 +3811,31 @@ definitions:
38113811
config_migrations:
38123812
title: Config Migrations
38133813
description: The config will be migrated according to these transformations and updated within the platform for subsequent syncs.
3814-
type: array
3815-
items:
3816-
anyOf:
3817-
- "$ref": '#/definitions/ConfigTransformations/RemapField'
3814+
type: object
3815+
required:
3816+
- description
3817+
- transformations
3818+
properties:
3819+
description:
3820+
type: string
3821+
description: The description/purpose of the config migration.
3822+
transformations:
3823+
type: array
3824+
items:
3825+
anyOf:
3826+
- "$ref": "#/definitions/ConfigRemapField"
3827+
- "$ref": "#/definitions/ConfigAddFields"
3828+
- "$ref": "#/definitions/ConfigRemoveFields"
3829+
default: []
38183830
transformations:
38193831
title: Transformations
38203832
description: The list of transformations that will be applied on the incoming config at the start of a sync.
38213833
type: array
38223834
items:
38233835
anyOf:
3824-
- "$ref": '#/definitions/ConfigTransformations/RemapField'
3836+
- "$ref": "#/definitions/ConfigRemapField"
3837+
- "$ref": "#/definitions/ConfigAddFields"
3838+
- "$ref": "#/definitions/ConfigRemoveFields"
38253839
validations:
38263840
title: Validations
38273841
description: The list of validations that will be performed on the incoming config before starting a sync
@@ -4202,7 +4216,7 @@ definitions:
42024216
properties:
42034217
type:
42044218
type: string
4205-
enum: [ DpathValidator ]
4219+
enum: [DpathValidator]
42064220
field_path:
42074221
title: Field Path
42084222
description: List of potentially nested fields describing the full path of the field to validate. Use "*" to validate all values from an array.
@@ -4212,10 +4226,10 @@ definitions:
42124226
interpolation_context:
42134227
- config
42144228
examples:
4215-
- [ "data" ]
4216-
- [ "data", "records" ]
4217-
- [ "data", "{{ parameters.name }}" ]
4218-
- [ "data", "*", "record" ]
4229+
- ["data"]
4230+
- ["data", "records"]
4231+
- ["data", "{{ parameters.name }}"]
4232+
- ["data", "*", "record"]
42194233
validation_strategy:
42204234
title: Validation Stragey
42214235
description: The condition that the specified config value will be evaluated against
@@ -4308,42 +4322,106 @@ definitions:
43084322
required:
43094323
- name
43104324
- age
4311-
ConfigTransformations:
4312-
RemapField:
4313-
title: Remap Field
4314-
description: Transformation that remaps a field's value to another value based on a static map.
4315-
type: object
4316-
required:
4317-
- type
4318-
- map
4319-
- field_path
4320-
properties:
4325+
ConfigRemapField:
4326+
title: Remap Field
4327+
description: Transformation that remaps a field's value to another value based on a static map.
4328+
type: object
4329+
required:
4330+
- type
4331+
- map
4332+
- field_path
4333+
properties:
4334+
type:
4335+
type: string
4336+
enum: [RemapField]
4337+
map:
4338+
title: Value Mapping
4339+
description: A mapping of original values to new values. When a field value matches a key in this map, it will be replaced with the corresponding value.
4340+
interpolation_context:
4341+
- config
43214342
type:
4343+
- object
4344+
- string
4345+
additionalProperties: true
4346+
examples:
4347+
- pending: "in_progress"
4348+
done: "completed"
4349+
cancelled: "terminated"
4350+
- "{{ config['status_mapping'] }}"
4351+
field_path:
4352+
title: Field Path
4353+
description: The path to the field whose value should be remapped. Specified as a list of path components to navigate through nested objects.
4354+
interpolation_context:
4355+
- config
4356+
type: array
4357+
items:
43224358
type: string
4323-
enum: [RemapField]
4324-
map:
4325-
title: Value Mapping
4326-
description: A mapping of original values to new values. When a field value matches a key in this map, it will be replaced with the corresponding value.
4327-
type:
4328-
- object
4329-
- string
4330-
additionalProperties: true
4331-
examples:
4332-
- pending: "in_progress"
4333-
done: "completed"
4334-
cancelled: "terminated"
4335-
- "{{ config['status_mapping'] }}"
4336-
field_path:
4337-
title: Field Path
4338-
description: The path to the field whose value should be remapped. Specified as a list of path components to navigate through nested objects.
4339-
type: array
4340-
items:
4341-
type: string
4342-
examples:
4343-
- ["status"]
4344-
- ["data", "status"]
4345-
- ["data", "{{ parameters.name }}", "status"]
4346-
- ["data", "*", "status"]
4359+
examples:
4360+
- ["status"]
4361+
- ["data", "status"]
4362+
- ["data", "{{ config.name }}", "status"]
4363+
- ["data", "*", "status"]
4364+
ConfigAddFields:
4365+
title: Config Add Fields
4366+
description: Transformation that adds fields to a config. The path of the added field can be nested.
4367+
type: object
4368+
required:
4369+
- type
4370+
- fields
4371+
properties:
4372+
type:
4373+
type: string
4374+
enum: [ConfigAddFields]
4375+
fields:
4376+
title: Fields
4377+
description: A list of transformations (path and corresponding value) that will be added to the config.
4378+
type: array
4379+
items:
4380+
"$ref": "#/definitions/AddedFieldDefinition"
4381+
condition:
4382+
description: Fields will be added if expression is evaluated to True.
4383+
type: string
4384+
default: ""
4385+
interpolation_context:
4386+
- config
4387+
- property
4388+
examples:
4389+
- "{{ config['environemnt'] == 'sandbox' }}"
4390+
- "{{ property is integer }}"
4391+
- "{{ property|length > 5 }}"
4392+
- "{{ property == 'some_string_to_match' }}"
4393+
ConfigRemoveFields:
4394+
title: Config Remove Fields
4395+
description: Transformation that removes a field from the config.
4396+
type: object
4397+
required:
4398+
- type
4399+
- field_pointers
4400+
properties:
4401+
type:
4402+
type: string
4403+
enum: [ConfigRemoveFields]
4404+
field_pointers:
4405+
title: Field Pointers
4406+
description: A list of field pointers to be removed from the config.
4407+
type: array
4408+
items:
4409+
type: string
4410+
examples:
4411+
- ["marketplace"]
4412+
- [["content", "html"], ["content", "plain_text"]]
4413+
condition:
4414+
description: Fields will be removed if expression is evaluated to True.
4415+
type: string
4416+
default: ""
4417+
interpolation_context:
4418+
- config
4419+
- property
4420+
examples:
4421+
- "{{ config['environemnt'] == 'sandbox' }}"
4422+
- "{{ property is integer }}"
4423+
- "{{ property|length > 5 }}"
4424+
- "{{ property == 'some_string_to_match' }}"
43474425
interpolation:
43484426
variables:
43494427
- title: config

0 commit comments

Comments
 (0)