-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Summary
The validate_manifest tool rejects manifests that use $ref to reference other parts of the manifest, but the runtime successfully executes these manifests. This appears to be a global issue with $ref validation, not specific to any particular component.
Reproduction
Example: Using $ref in SubstreamPartitionRouter
streams:
- type: DeclarativeStream
name: repositories
# ... parent stream definition ...
- type: DeclarativeStream
name: issues
retriever:
type: SimpleRetriever
partition_router:
- type: SubstreamPartitionRouter
parent_stream_configs:
- type: ParentStreamConfig
stream:
$ref: "#/streams/0" # Reference to repositories streamError from validate_manifest:
JSON schema validation failed at field 'retriever': {...} is not valid under any of the given schemas
The error message shows the $ref in the output, indicating the validator is seeing the unresolved reference.
Runtime behavior:
execute_stream_test_read works perfectly with the same manifest - all streams read data successfully.
Suspected Root Cause
- JSON schema doesn't know how to properly validate manifests with $refs - The schema validator is running on the raw manifest before $refs are resolved
- Validation tool calls the JSON schema validator directly - Without resolving $refs first
Proposed Mitigations
Option 1 (Best): Fix JSON schema to respect $refs
Come up with a version of the JSON schema which correctly respects the $refs syntax.
Option 2 (Workaround): Resolve manifest before validation
Within the validate_manifest tool, run "resolve manifest" or "fully resolve manifest" inline before JSON schema validation.
Impact
Without this fix, developers must either:
- Inline definitions everywhere (massive duplication)
- Skip validation and rely only on runtime testing
This significantly impacts maintainability for complex connectors.
Context
- Manifest version: 6.42.1
- CDK version: 6.61.6
- The connector builder UI itself generates manifests with
$refpatterns - Multiple existing connectors use $ref patterns
Requested By
@aaronsteers while working on source-github-gen2: https://app.devin.ai/sessions/175c32a9b87647a3830163fba2a3a55e