Skip to content

Commit b711cd6

Browse files
authored
fix(low-code cdk): Add literal type for ConfigNormalizationRules components (#649)
1 parent 7d045f7 commit b711cd6

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

airbyte_cdk/sources/declarative/declarative_component_schema.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3835,7 +3835,12 @@ definitions:
38353835
title: Config Normalization Rules
38363836
type: object
38373837
additionalProperties: false
3838+
required:
3839+
- type
38383840
properties:
3841+
type:
3842+
type: string
3843+
enum: [ConfigNormalizationRules]
38393844
config_migrations:
38403845
title: Config Migrations
38413846
description: The discrete migrations that will be applied on the incoming config. Each migration will be applied in the order they are defined.

airbyte_cdk/sources/declarative/models/declarative_component_schema.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2176,6 +2176,7 @@ class ConfigNormalizationRules(BaseModel):
21762176
class Config:
21772177
extra = Extra.forbid
21782178

2179+
type: Literal["ConfigNormalizationRules"]
21792180
config_migrations: Optional[List[ConfigMigration]] = Field(
21802181
[],
21812182
description="The discrete migrations that will be applied on the incoming config. Each migration will be applied in the order they are defined.",

unit_tests/sources/declarative/test_manifest_declarative_source.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2488,6 +2488,7 @@ def test_given_unmigrated_config_when_migrating_then_config_is_migrated(migratio
24882488
"documentation_url": "https://example.org",
24892489
"connection_specification": {},
24902490
"config_normalization_rules": {
2491+
"type": "ConfigNormalizationRules",
24912492
"config_migrations": [
24922493
{
24932494
"type": "ConfigMigration",
@@ -2558,6 +2559,7 @@ def test_given_already_migrated_config_no_control_message_is_emitted(migration_m
25582559
"documentation_url": "https://example.org",
25592560
"connection_specification": {},
25602561
"config_normalization_rules": {
2562+
"type": "ConfigNormalizationRules",
25612563
"config_migrations": [
25622564
{
25632565
"type": "ConfigMigration",
@@ -2628,6 +2630,7 @@ def test_given_transformations_config_is_transformed():
26282630
"documentation_url": "https://example.org",
26292631
"connection_specification": {},
26302632
"config_normalization_rules": {
2633+
"type": "ConfigNormalizationRules",
26312634
"transformations": [
26322635
{
26332636
"type": "ConfigAddFields",
@@ -2703,6 +2706,7 @@ def test_given_valid_config_streams_validates_config_and_does_not_raise():
27032706
"connection_specification": {},
27042707
"parameters": {},
27052708
"config_normalization_rules": {
2709+
"type": "ConfigNormalizationRules",
27062710
"validations": [
27072711
{
27082712
"type": "DpathValidator",
@@ -2767,6 +2771,7 @@ def test_given_invalid_config_streams_validates_config_and_raises():
27672771
"connection_specification": {},
27682772
"parameters": {},
27692773
"config_normalization_rules": {
2774+
"type": "ConfigNormalizationRules",
27702775
"validations": [
27712776
{
27722777
"type": "DpathValidator",

0 commit comments

Comments
 (0)