Skip to content

Commit d3287a1

Browse files
committed
add declarative component schema
1 parent 53a5724 commit d3287a1

File tree

4 files changed

+436
-61
lines changed

4 files changed

+436
-61
lines changed

airbyte_cdk/sources/declarative/declarative_component_schema.yaml

Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3803,6 +3803,33 @@ definitions:
38033803
title: Advanced Auth
38043804
description: Advanced specification for configuring the authentication flow.
38053805
"$ref": "#/definitions/AuthFlow"
3806+
config_normalization_rules:
3807+
title: Config Normalization Rules
3808+
type: object
3809+
additional_properties: false
3810+
properties:
3811+
config_migrations:
3812+
title: Config Migrations
3813+
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'
3818+
transformations:
3819+
title: Transformations
3820+
description: The list of transformations that will be applied on the incoming config at the start of a sync.
3821+
type: array
3822+
items:
3823+
anyOf:
3824+
- "$ref": '#/definitions/ConfigTransformations/RemapField'
3825+
validations:
3826+
title: Validations
3827+
description: The list of validations that will be performed on the incoming config before starting a sync
3828+
type: array
3829+
items:
3830+
anyOf:
3831+
- "$ref": "#/definitions/DpathValidator"
3832+
- "$ref": "#/definitions/PredicateValidator"
38063833
SubstreamPartitionRouter:
38073834
title: Substream Partition Router
38083835
description: Partition router that is used to retrieve records that have been partitioned according to records from the specified parent streams. An example of a parent stream is automobile brands and the substream would be the various car models associated with each branch.
@@ -4164,6 +4191,159 @@ definitions:
41644191
description: The GraphQL query to be executed
41654192
default: {}
41664193
additionalProperties: true
4194+
DpathValidator:
4195+
title: Dpath Validator
4196+
description: Validator that extracts the value located at a given field path.
4197+
type: object
4198+
required:
4199+
- type
4200+
- field_path
4201+
- validation_strategy
4202+
properties:
4203+
type:
4204+
type: string
4205+
enum: [ DpathValidation ]
4206+
field_path:
4207+
title: Field Path
4208+
description: List of potentially nested fields describing the full path of the field to validate. Use "*" to validate all values from an array.
4209+
type: array
4210+
items:
4211+
type: string
4212+
interpolation_context:
4213+
- config
4214+
examples:
4215+
- [ "data" ]
4216+
- [ "data", "records" ]
4217+
- [ "data", "{{ parameters.name }}" ]
4218+
- [ "data", "*", "record" ]
4219+
validation_strategy:
4220+
title: Validation Stragey
4221+
description: The condition that the specified config value will be evaluated against
4222+
anyOf:
4223+
- "$ref": "#/definitions/ValidateAdheresToSchema"
4224+
PredicateValidator:
4225+
title: Predicate Validator
4226+
description: Validator that applies a validation strategy to a specified value.
4227+
type: object
4228+
required:
4229+
- type
4230+
- value
4231+
- validation_strategy
4232+
properties:
4233+
type:
4234+
type: string
4235+
enum: [PredicateValidator]
4236+
value:
4237+
title: Value
4238+
description: The value to be validated. Can be a literal value or interpolated from configuration.
4239+
type:
4240+
- string
4241+
- number
4242+
- object
4243+
- array
4244+
- boolean
4245+
- "null"
4246+
interpolation_context:
4247+
- config
4248+
examples:
4249+
- "test-value"
4250+
- "{{ config['api_version'] }}"
4251+
- "{{ config['tenant_id'] }}"
4252+
- 123
4253+
validation_strategy:
4254+
title: Validation Strategy
4255+
description: The validation strategy to apply to the value.
4256+
anyOf:
4257+
- "$ref": "#/definitions/ValidateAdheresToSchema"
4258+
ValidateAdheresToSchema:
4259+
title: Validate Adheres To Schema
4260+
description: Validates that a user-provided schema adheres to a specified JSON schema.
4261+
type: object
4262+
required:
4263+
- type
4264+
- schema
4265+
properties:
4266+
type:
4267+
type: string
4268+
enum: [ValidateAdheresToSchema]
4269+
schema:
4270+
title: JSON Schema
4271+
description: The JSON schema used for validation.
4272+
type:
4273+
- string
4274+
- object
4275+
interpolation_context:
4276+
- config
4277+
examples:
4278+
- "{{ config['report_validation_schema'] }}"
4279+
- |
4280+
'{
4281+
"$schema": "http://json-schema.org/draft-07/schema#",
4282+
"title": "Person",
4283+
"type": "object",
4284+
"properties": {
4285+
"name": {
4286+
"type": "string",
4287+
"description": "The person's name"
4288+
},
4289+
"age": {
4290+
"type": "integer",
4291+
"minimum": 0,
4292+
"description": "The person's age"
4293+
}
4294+
},
4295+
"required": ["name", "age"]
4296+
}'
4297+
- $schema: "http://json-schema.org/draft-07/schema#"
4298+
title: Person
4299+
type: object
4300+
properties:
4301+
name:
4302+
type: string
4303+
description: "The person's name"
4304+
age:
4305+
type: integer
4306+
minimum: 0
4307+
description: "The person's age"
4308+
required:
4309+
- name
4310+
- 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:
4321+
type:
4322+
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"]
41674347
interpolation:
41684348
variables:
41694349
- title: config

0 commit comments

Comments
 (0)