Skip to content

$ref resolver generates unreachable object keys #7169

@monai

Description

@monai

Enviroment

  • Airbyte version: example is 0.30.20-alpha
  • OS Version / Instance: macOS
  • Deployment: Docker
  • Severity: Very Low
  • Step where error happened: Development

Current Behavior

JSON schema $ref resolver naively takes supplied $ref value and uses it as a verbatim definition key, including forward slashes. However, in JSON schema, forward slash denotes access of object key; therefore, such definitions are unreachable.

Expected Behavior

Forward slashes in definition keys should be replaced with safe character, i.e., dash or underscore.

I'm developing a connector for a web service with highly nested data structures, and I want to have JSON schemas mirroring the model structure of that service.

Logs

Schema excerpt

Files:

  • schemas/some_stream.json
  • schemas/shared/nested/model/another_schema.json
{ "name": "some_stream", "json_schema": { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "field": { "$ref": "#/definitions/nested/model/another_schema_" } }, "definitions": { "nested/model/another_schema_": { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "another_field": { "type": "string" } } } } } }

Metadata

Metadata

Assignees

No one assigned

    Labels

    CDKConnector Development Kitarea/connectorsConnector related issuescommunitytype/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions