I am building a low code source connector for an API. I am running in to an issue when creating a docker container for it.
Running Airbyte 0.41.0.
First, when I run the connector like this:
python3 main.py read --config secrets/config.json --catalog integration_tests/configured_catalog.json
It runs OK. But when I run docker build and update the tag in Airbyte UI I get the following error:
airbyte-worker | 2023-02-25 23:38:14 ERROR i.a.c.i.LineGobbler(voidCall):114 - jsonschema.exceptions.ValidationError: '*ref(definitions.consultations_stream)' is not of type 'object'
airbyte-worker | 2023-02-25 23:38:14 ERROR i.a.c.i.LineGobbler(voidCall):114 -
airbyte-worker | 2023-02-25 23:38:14 ERROR i.a.c.i.LineGobbler(voidCall):114 - Failed validating 'type' in schema['properties']['streams']['items']:
airbyte-worker | 2023-02-25 23:38:14 ERROR i.a.c.i.LineGobbler(voidCall):114 - {'additionalProperties': True,
airbyte-worker | 2023-02-25 23:38:14 ERROR i.a.c.i.LineGobbler(voidCall):114 - 'description': 'A stream whose behavior is described by a set of '
airbyte-worker | 2023-02-25 23:38:14 ERROR i.a.c.i.LineGobbler(voidCall):114 - 'declarative low code components',
airbyte-worker | 2023-02-25 23:38:14 ERROR i.a.c.i.LineGobbler(voidCall):114 - 'properties': {'$parameters': {'additional_properties': True,
airbyte-worker | 2023-02-25 23:38:14 ERROR i.a.c.i.LineGobbler(voidCall):114 - 'type': 'object'},
airbyte-worker | 2023-02-25 23:38:14 ERROR i.a.c.i.LineGobbler(voidCall):114 - 'incremental_sync': {'anyOf': [{'$ref': '#/definitions/CustomIncrementalSync'},
airbyte-worker | 2023-02-25 23:38:14 ERROR i.a.c.i.LineGobbler(voidCall):114 - {'$ref': '#/definitions/DatetimeBasedCursor'}]},
airbyte-worker | 2023-02-25 23:38:14 ERROR i.a.c.i.LineGobbler(voidCall):114 - 'name': {'default': '',
airbyte-worker | 2023-02-25 23:38:14 ERROR i.a.c.i.LineGobbler(voidCall):114 - 'definition': 'The stream name',
airbyte-worker | 2023-02-25 23:38:14 ERROR i.a.c.i.LineGobbler(voidCall):114 - 'type': 'string'},
airbyte-worker | 2023-02-25 23:38:14 ERROR i.a.c.i.LineGobbler(voidCall):114 - 'primary_key': {'$ref': '#/definitions/PrimaryKey',
airbyte-worker | 2023-02-25 23:38:14 ERROR i.a.c.i.LineGobbler(voidCall):114 - 'default': '',
airbyte-worker | 2023-02-25 23:38:14 ERROR i.a.c.i.LineGobbler(voidCall):114 - 'definition': 'The primary key of the '
airbyte-worker | 2023-02-25 23:38:14 ERROR i.a.c.i.LineGobbler(voidCall):114 - 'stream'},
airbyte-worker | 2023-02-25 23:38:14 ERROR i.a.c.i.LineGobbler(voidCall):114 - 'retriever': {'anyOf': [{'$ref': '#/definitions/CustomRetriever'},
airbyte-worker | 2023-02-25 23:38:14 ERROR i.a.c.i.LineGobbler(voidCall):114 - {'$ref': '#/definitions/SimpleRetriever'}],
airbyte-worker | 2023-02-25 23:38:14 ERROR i.a.c.i.LineGobbler(voidCall):114 - 'definition': 'Component used to '
airbyte-worker | 2023-02-25 23:38:14 ERROR i.a.c.i.LineGobbler(voidCall):114 - 'coordinate how records '
airbyte-worker | 2023-02-25 23:38:14 ERROR i.a.c.i.LineGobbler(voidCall):114 - 'are extracted across '
airbyte-worker | 2023-02-25 23:38:14 ERROR i.a.c.i.LineGobbler(voidCall):114 - 'stream slices and request '
airbyte-worker | 2023-02-25 23:38:14 ERROR i.a.c.i.LineGobbler(voidCall):114 - 'pages'},
airbyte-worker | 2023-02-25 23:38:14 ERROR i.a.c.i.LineGobbler(voidCall):114 - 'schema_loader': {'anyOf': [{'$ref': '#/definitions/InlineSchemaLoader'},
airbyte-worker | 2023-02-25 23:38:14 ERROR i.a.c.i.LineGobbler(voidCall):114 - {'$ref': '#/definitions/JsonFileSchemaLoader'}],
airbyte-worker | 2023-02-25 23:38:14 ERROR i.a.c.i.LineGobbler(voidCall):114 - 'definition': 'The schema loader '
airbyte-worker | 2023-02-25 23:38:14 ERROR i.a.c.i.LineGobbler(voidCall):114 - 'used to retrieve the '
airbyte-worker | 2023-02-25 23:38:14 ERROR i.a.c.i.LineGobbler(voidCall):114 - 'schema for the '
airbyte-worker | 2023-02-25 23:38:14 ERROR i.a.c.i.LineGobbler(voidCall):114 - 'current stream'},
airbyte-worker | 2023-02-25 23:38:14 ERROR i.a.c.i.LineGobbler(voidCall):114 - 'transformations': {'definition': 'A list of '
airbyte-worker | 2023-02-25 23:38:14 ERROR i.a.c.i.LineGobbler(voidCall):114 - 'transformations to '
airbyte-worker | 2023-02-25 23:38:14 ERROR i.a.c.i.LineGobbler(voidCall):114 - 'be applied to each '
airbyte-worker | 2023-02-25 23:38:14 ERROR i.a.c.i.LineGobbler(voidCall):114 - 'output record in '
airbyte-worker | 2023-02-25 23:38:14 ERROR i.a.c.i.LineGobbler(voidCall):114 - 'the',
airbyte-worker | 2023-02-25 23:38:14 ERROR i.a.c.i.LineGobbler(voidCall):114 - 'items': {'anyOf': [{'$ref': '#/definitions/AddFields'},
airbyte-worker | 2023-02-25 23:38:14 ERROR i.a.c.i.LineGobbler(voidCall):114 - {'$ref': '#/definitions/CustomTransformation'},
airbyte-worker | 2023-02-25 23:38:14 ERROR i.a.c.i.LineGobbler(voidCall):114 - {'$ref': '#/definitions/RemoveFields'}]},
airbyte-worker | 2023-02-25 23:38:14 ERROR i.a.c.i.LineGobbler(voidCall):114 - 'type': 'array'},
airbyte-worker | 2023-02-25 23:38:14 ERROR i.a.c.i.LineGobbler(voidCall):114 - 'type': {'enum': ['DeclarativeStream'],
airbyte-worker | 2023-02-25 23:38:14 ERROR i.a.c.i.LineGobbler(voidCall):114 - 'type': 'string'}},
airbyte-worker | 2023-02-25 23:38:14 ERROR i.a.c.i.LineGobbler(voidCall):114 - 'required': ['type', 'retriever'],
airbyte-worker | 2023-02-25 23:38:14 ERROR i.a.c.i.LineGobbler(voidCall):114 - 'type': 'object'}
airbyte-worker | 2023-02-25 23:38:14 ERROR i.a.c.i.LineGobbler(voidCall):114 -
airbyte-worker | 2023-02-25 23:38:14 ERROR i.a.c.i.LineGobbler(voidCall):114 - On instance['streams'][0]:
airbyte-worker | 2023-02-25 23:38:14 ERROR i.a.c.i.LineGobbler(voidCall):114 - '*ref(definitions.consultations_stream)'
I have previously had a working manifest.yaml where I wasn’t using refs. That manifest was generated by the connector builder UI. Now I need to modularize it to be able to reuse configuration blocks for more streams.
Here is my manifest.yaml:
version: 0.28.0
type: DeclarativeSource
check:
type: CheckStream
stream_names:
- consultations
definitions:
url_base: "https://provetcloud.com/{{ config['clinic_id'] }}/api/0.1/"
base_paginator:
type: DefaultPaginator
page_token_option:
type: RequestOption
inject_into: request_parameter
field_name: page
pagination_strategy:
type: "CursorPagination"
cursor_value: "{{ last_records['next'] }}"
url_base: "*ref(definitions.url_base)"
base_record_selector:
type: RecordSelector
extractor:
type: DpathExtractor
field_path: [ "results" ]
field_pointer: [ "results" ] # To make local validator happy
base_requester:
type: HttpRequester
name: Base retriever
url_base: "*ref(definitions.url_base)"
path: "{{ options['path'] }}"
http_method: GET
authenticator:
type: ApiKeyAuthenticator
api_token: 'Token {{ config[''api_key''] }}'
header: Authorization
base_incremental_sync:
type: DatetimeBasedCursor
cursor_field: admitted_time
datetime_format: '%Y-%m-%d'
cursor_granularity: P1D
end_datetime:
datetime: "{{ now_utc() }}"
datetime_format: "%Y-%m-%d %H:%M:%S.%f+00:00"
start_datetime:
datetime: "{{ config['start_date'] }}"
datetime_format: "%Y-%m-%d"
step: P1D
start_time_option:
inject_into: request_parameter
type: RequestOption
field_name: "{{ options['stream_cursor_field'] }}__gte"
base_stream:
type: DeclarativeStream
primary_key:
- id
schema_loader:
type: JsonFileSchemaLoader
file_path: "source_provet_cloud/schemas/{{ options['name'] }}.json"
retriever:
type: SimpleRetriever
requester:
"*ref(definitions.base_requester)"
record_selector:
"*ref(definitions.base_record_selector)"
paginator:
"*ref(definitions.base_paginator)"
# incremental_sync:
# "*ref(definitions.base_incremental_sync)"
consultations_stream:
$ref: "*ref(definitions.base_stream)"
$options:
name: "consultations"
path: "/consultation"
stream_cursor_field: "admitted_time"
streams:
- $ref: "*ref(definitions.consultations_stream)"
spec:
connection_specification:
$schema: http://json-schema.org/draft-07/schema#
type: object
required:
- clinic_id
- start_date
- api_key
properties:
clinic_id:
title: Clinic ID
airbyte_secret: true
type: string
start_date:
title: Start date
type: string
api_key:
type: string
title: API Key
airbyte_secret: true
additionalProperties: true
documentation_url: https://example.org
type: Spec
Can anybody help me figure out what is wrong here?