Repository navigation
fix(low-code): keep $parameters out of JSON schemas with a list type - #1206
Merged
Merged
Conversation
`_is_json_schema_object` matched only `type: object` and the exact list `["null", "object"]`. Any other type union, such as `["object", "null"]` or `["object"]`, was treated as a component, so `$parameters` and the parameter keys were written into the schema root and its property schemas. A `properties` map with a property named `type` was polluted the same way. Component types are always strings, so a list or dict `type` now marks JSON schema content.
👋 Greetings, Airbyte Team Member!Here are some helpful tips and reminders for your convenience. 💡 Show Tips and TricksTesting This CDK VersionYou can test this version of the CDK using the following: # Run the CLI from this branch:
uvx 'git+https://github.com/airbytehq/airbyte-python-cdk.git@bazarnov/fix-parameters-json-schema-type#egg=airbyte-python-cdk[dev]' --help
# Update a connector to use the CDK from this branch ref:
cd airbyte-integrations/connectors/source-example
poe use-cdk-branch bazarnov/fix-parameters-json-schema-typePR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR:
|
PyTest Results (Fast)4 986 tests +4 4 974 ✅ +4 7m 44s ⏱️ - 1m 49s Results for commit 27b25df. ± Comparison against base commit d214b0c. This pull request removes 1 and adds 5 tests. Note that renamed tests count towards both. |
PyTest Results (Full)4 989 tests +4 4 977 ✅ +4 16m 26s ⏱️ +22s Results for commit 27b25df. ± Comparison against base commit d214b0c. This pull request removes 1 and adds 5 tests. Note that renamed tests count towards both. |
Anatolii Yatsuk (tolik0)
approved these changes
Oct 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
👉 TL;DR: Parameters declared on a low-code stream are no longer copied into its inline record schema when the schema's type is a list other than exactly "null, object", such as "object, null" or just "object". They are also no longer copied into a schema's list of fields when one of the fields is named "type", where they could show up as extra columns.
Specifically,
ManifestComponentTransformer._is_json_schema_objectnow treats any list or dicttypeas JSON schema content, sopropagate_types_and_parametersreturns those mappings unchanged.Changes
_is_json_schema_objectreturnsTruefor a list or dicttype, not only for"object"and the exact list["null", "object"]. Component types are always strings, so a listtypeis a JSON schema type union in any order, and a dicttypeis apropertiesmap holding a property namedtype.test_do_not_propagate_parameters_on_json_schema_objectruns over five schemas: roottype"object",["null", "object"],["object", "null"]and["object"], plus a root withouttypethat has atypeproperty. Each comes back unchanged while the stream and itsInlineSchemaLoaderstill receive the parameters.Review Spotlight
Reviewers with limited time, please review first:
manifest_component_transformer.py#L193-L198: the predicate; the dict case stops the walk at apropertiesmap reached from a schema root withouttypemanifest_component_transformer.py#L131-L137: its only call site, reached for the whole manifest and again for each resolved dynamic streamRisks
Cleaner discovered schemas in 2 monorepo connectors, once they move to a
source-declarative-manifestbase image with this fix. Custom manifests with these spellings and parameters in scope get the same cleanup.source-jiralabels(roottype: ["object", "null"]):pathand$parametersleave the schema root andproperties.label.source-zendesk-supportsla_policies(roottype: ["object"]):name,path,primary_key,cursor_fieldand$parametersleave the root and 8 property schemas.No property is added or removed and no type changes, so destination columns stay the same. At most, a one-time non-breaking schema change is detected on these 2 streams.
Other mappings with a list or dict
typeare now left as written instead of receiving the parameters, and components nested under them no longer receive them either. No monorepo manifest is affected: the comparison below shows no other change.How the blast radius was counted. All 537
manifest.yamlfiles underairbyte-integrations/connectorson airbytemasteratfc800755went throughManifestReferenceResolverandpropagate_types_and_parametersonce withmainand once with this branch. Only the 2 manifests above differ, and only by removed keys insideschema_loader.schema(plus their unuseddefinitionscopies).InlineSchemaLoaderschemas in stream definitions use these spellings (24["object", "null"], 67["object"]). No parameters are in scope there, so their output does not change.dynamic_streams, the only list-typed schemas in templates and resolver definitions outside anobjectschema are 6["null", "object"]roots insource-linkedin-ads, whichmainalready skips. Values a resolver fetches from an API at runtime are not covered by this count.Unchanged: a mapping with a string
typeother than"object", such as a schema roottype: "array", is still treated as a component.Test plan
main(git checkout origin/main -- airbyte_cdk/sources/declarative/parsers/manifest_component_transformer.py): 3 failed (object_null,object_only,no_root_type_with_type_property), 2 passed.python -m pytest unit_tests/sources/declarative/parsers unit_tests/sources/declarative/resolvers unit_tests/legacy: 583 passed.python -m pytest unit_tests/sources/declarative/test_concurrent_declarative_source.py: 86 passed, 3 failed. The 3 aretest_read_with_concurrent_and_synchronous_streams*, which hitsqlite3.OperationalError: database table is lockedin the shared HTTP cache locally and crash the interpreter with themainsource file as well (Cached parent stream with more than one partition corrupts the shared sqlite request cache under concurrent reads (no such table: responses,file is not a database,no more rows available) #1150).python -m pytest unit_tests/sources/declarative unit_tests/connector_builder unit_tests/source_declarative_manifest -k "not test_read_with_concurrent_and_synchronous_streams": 2408 passed.ConcurrentDeclarativeSource.discoveron a static stream and a dynamic stream template, with$parametersabove anInlineSchemaLoaderwhose schema hasidandtypeproperties:main: roots["object", "null"]and["object"]come back withnameand$parameterson the root, on each property and as extra entries inproperties;["null", "object"]comes back as written.ruff formatandruff checkon the 2 changed files andmypy --config-file mypy.inion the source file: clean.-p no:cacheprovider; the 2408-test run also added-p no:memray, sincepytest-memrayneeds the cache plugin.Fixes #1137