Skip to content

validate_manifest fails with $ref but runtime works #178

@devin-ai-integration

Description

@devin-ai-integration

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 stream

Error 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

  1. 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
  2. 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:

  1. Inline definitions everywhere (massive duplication)
  2. 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 $ref patterns
  • Multiple existing connectors use $ref patterns

Requested By

@aaronsteers while working on source-github-gen2: https://app.devin.ai/sessions/175c32a9b87647a3830163fba2a3a55e

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions