Skip to content

fix: strip null optional config fields before validation and include field path in error messages#1046

Closed
devin-ai-integration[bot] wants to merge 4 commits into
mainfrom
devin/1780998700-fix-config-null-validation
Closed

fix: strip null optional config fields before validation and include field path in error messages#1046
devin-ai-integration[bot] wants to merge 4 commits into
mainfrom
devin/1780998700-fix-config-null-validation

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes production config validation errors ("Config validation error: None is not of type 'string'") affecting 103+ Amazon Seller Partner connections since 2026-06-08. The platform passes explicit null for unset optional config fields; JSON Schema rejects null unless the type includes "null", causing previously-working syncs to fail.

Three changes to check_config_against_spec_or_exit:

  1. Strip null optional fields — before validation, remove keys whose value is None and which are not in the schema's required list. Absent keys are not validated by JSON Schema, so this correctly treats null-unset as absent-unset:
def _strip_nulls_from_optional_fields(config, spec_schema):
    required = set(spec_schema.get("required", []))
    return {k: v for k, v in config.items() if v is not None or k in required}
  1. Report ALL validation errors — uses Draft7Validator.iter_errors() instead of validate() so all failing fields are reported at once, not just the first:
# Before
Config validation error: None is not of type 'string'

# After (multiple fields)
Config validation error: 'api_token' - None is not of type 'string'; 'region' - None is not of type 'string'
  1. Include field path in error messages — uses ValidationError.absolute_path so errors are actionable.

Requested by @gl_anatolii.yatsuk via Metabase error dashboard.

Link to Devin session: https://app.devin.ai/sessions/24208f15bf9f4713bff165f51e1f18b3

…field path in error messages

Config validation now strips null-valued non-required fields before
running jsonschema validation. This prevents spurious 'None is not of
type string' errors when the platform passes null for unset optional
fields.

Additionally, validation error messages now include the JSON path to
the failing field, making config errors actionable for users.

Co-Authored-By: gl_anatolii.yatsuk <gl_anatolii.yatsuk@airbyte.io>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

👋 Greetings, Airbyte Team Member!

Here are some helpful tips and reminders for your convenience.

💡 Show Tips and Tricks

Testing This CDK Version

You 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@devin/1780998700-fix-config-null-validation#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 devin/1780998700-fix-config-null-validation

PR Slash Commands

Airbyte Maintainers can execute the following slash commands on your PR:

  • /autofix - Fixes most formatting and linting issues
  • /poetry-lock - Updates poetry.lock file
  • /test - Runs connector tests with the updated CDK
  • /prerelease - Triggers a prerelease publish with default arguments
  • /poe build - Regenerate git-committed build artifacts, such as the pydantic models which are generated from the manifest JSON schema in YAML.
  • /poe <command> - Runs any poe command in the CDK environment
📚 Show Repo Guidance

Helpful Resources

📝 Edit this welcome message.

devin-ai-integration Bot and others added 3 commits June 9, 2026 09:54
Co-Authored-By: gl_anatolii.yatsuk <gl_anatolii.yatsuk@airbyte.io>
Uses Draft7Validator.iter_errors() to collect all config validation
failures and reports them in a single error message separated by
semicolons.

Co-Authored-By: gl_anatolii.yatsuk <gl_anatolii.yatsuk@airbyte.io>
Co-Authored-By: gl_anatolii.yatsuk <gl_anatolii.yatsuk@airbyte.io>
@tolik0

Anatolii Yatsuk (tolik0) commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

/prerelease

Prerelease Job Info

This job triggers the publish workflow with default arguments to create a prerelease.

Prerelease job started... Check job output.

✅ Prerelease workflow triggered successfully.

View the publish workflow run: https://github.com/airbytehq/airbyte-python-cdk/actions/runs/27198638142

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

PyTest Results (Fast)

4 100 tests  +6   4 088 ✅ +6   7m 8s ⏱️ -28s
    1 suites ±0      12 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit d0d91d3. ± Comparison against base commit 7da322d.

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

PyTest Results (Full)

4 103 tests  +6   4 091 ✅ +6   9m 17s ⏱️ -7s
    1 suites ±0      12 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit d0d91d3. ± Comparison against base commit 7da322d.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant