<@U04S8PLJWMT> I’m extending some base lowcode con...
# ask-ai
a
@kapa.ai I’m extending some base lowcode connector streams defined in manifest.yaml with some extra custom streams and had extend authenticator which I would like to use for those base lowcode connector streams too. how to do that in source code?
k
To share an authenticator (such as an API key or OAuth2 configuration) across both your custom streams and the base low-code connector streams in Airbyte, you should configure the authenticator at a shared level and ensure it is referenced by all relevant streams. In the Connector Builder UI: Airbyte provides a "Shared Authenticator" feature. This allows you to define the authenticator once and link it to multiple components (streams, requesters, etc.) in your connector. In the UI, you’ll see a link icon with a toggle next to authenticator fields—enabling this toggle shares the authenticator configuration. Any changes to the shared authenticator will automatically apply to all linked components, ensuring consistency and reducing duplication. If you need to use a different authenticator for a specific stream, you can unlink it and provide a local configuration instead. This is the recommended approach for connectors built or managed via the UI [Shared Authenticator](https://docs.airbyte.com/platform/connector-development/connector-builder-ui/authentication#shared-authenticator). In manifest.yaml (low-code YAML): If you are working directly with the YAML manifest, you should define the authenticator in the
definitions
section and then reference it in each stream or requester that needs it. For example:
Copy code
yaml definitions:   my_authenticator:     type: ApiKeyAuthenticator     api_token: '{{ config["api_key"] }}'     header: Authorization    my_requester:     type: HttpRequester     url_base: 'https://api.example.com'     authenticator:       '*ref(definitions.my_authenticator)'     # ... other requester config  streams:   - type: DeclarativeStream     name: my_stream     retriever:       type: SimpleRetriever       requester:         '*ref(definitions.my_requester)'     # ... other stream config
By referencing the same authenticator definition in multiple places, you ensure all streams use the same authentication logic. This approach is consistent with how Airbyte recommends modularizing and reusing configuration blocks in low-code connectors [Configuring the YAML file](https://docs.airbyte.com/platform/connector-development/config-based/low-code-cdk-overview#configuring-the-yaml-file). Summary: - In the UI: Use the Shared Authenticator toggle to link the authenticator across streams. - In YAML: Define the authenticator in
definitions
and reference it in each stream/requester. This ensures your custom and base streams all use the same authenticator, and you only need to update it in one place if changes are required.
a
@kapa.ai using ‘*ref(definitions.my_requester)’ doesn’t work for me. I’m getting this error:
Copy code
Traceback (most recent call last):
  File "/Users/andrey/Library/Caches/pypoetry/virtualenvs/source-quickbooks-drivepoint-4zeC4cAE-py3.11/lib/python3.11/site-packages/airbyte_cdk/sources/declarative/concurrent_declarative_source.py", line 356, in _validate_source
    validate(self._source_config, self._declarative_component_schema)
  File "/Users/andrey/Library/Caches/pypoetry/virtualenvs/source-quickbooks-drivepoint-4zeC4cAE-py3.11/lib/python3.11/site-packages/jsonschema/validators.py", line 1332, in validate
    raise error
jsonschema.exceptions.ValidationError: '*ref(definitions.my_authenticator)' is not valid under any of the given schemas

Failed validating 'anyOf' in schema[0]['properties']['authenticator']:
    {'title': 'Authenticator',
     'linkable': True,
     'description': 'Authentication method to use for requests sent to the '
                    'API.',
     'anyOf': [{'$ref': '#/definitions/ApiKeyAuthenticator'},
               {'$ref': '#/definitions/BasicHttpAuthenticator'},
               {'$ref': '#/definitions/BearerAuthenticator'},
               {'$ref': '#/definitions/OAuthAuthenticator'},
               {'$ref': '#/definitions/JwtAuthenticator'},
               {'$ref': '#/definitions/SessionTokenAuthenticator'},
               {'$ref': '#/definitions/SelectiveAuthenticator'},
               {'$ref': '#/definitions/CustomAuthenticator'},
               {'$ref': '#/definitions/NoAuth'},
               {'$ref': '#/definitions/LegacySessionTokenAuthenticator'}]}

On instance['authenticator']:
    '*ref(definitions.my_authenticator)'
k
A message from kapa.ai
The error you are seeing:
Copy code
jsonschema.exceptions.ValidationError: '*ref(definitions.drivepoint_quickbooks_authenticator)' is not valid under any of the given schemas
is caused by the use of the
*ref(...)
syntax, which is not the correct way to reference definitions in Airbyte's low-code YAML manifests. Correct Reference Syntax According to the Airbyte documentation and community discussions, you should use the
"#/definitions/..."
syntax for references, not
*ref(...)
. For example:
Copy code
yaml authenticator: "#/definitions/drivepoint_quickbooks_authenticator"
or, if you are using the
$ref
keyword to enhance or extend an object:
Copy code
yaml authenticator:   $ref: "#/definitions/drivepoint_quickbooks_authenticator"   # You can add additional properties here if needed
This is confirmed in both the official documentation and community forum posts, where users resolved similar issues by switching from
*ref(...)
to the
"#/definitions/..."
format. The parser will then correctly dereference the value and validate it against the schema, as shown in the working example from the forum:
Copy code
yaml authenticator:   type: ApiKeyAuthenticator   api_token: 'Token {{ config["api_key"] }}'   header: Authorization
and referenced as:
Copy code
yaml authenticator: "#/definitions/my_authenticator"
or
Copy code
yaml requester:   $ref: "#/definitions/base_requester"
[See forum solution](https://discuss.airbyte.io/t/3981) and [documentation on references](https://docs.airbyte.com/platform/connector-development/config-based/advanced-topics/references). Summary: Replace
*ref(definitions.drivepoint_quickbooks_authenticator)
with
"#/definitions/drivepoint_quickbooks_authenticator"
or use the
$ref
keyword as shown above. This should resolve the validation error.
A message from kapa.ai
The error occurs because the syntax
*ref(definitions.my_authenticator)
is not supported in Airbyte's low-code YAML manifests. According to the official Airbyte documentation, the correct way to reference another definition is to use the string reference syntax:
"#/definitions/my_authenticator"
. For example, you should write:
Copy code
yaml authenticator: "#/definitions/my_authenticator"
or, if you need to extend the referenced object:
Copy code
yaml authenticator:   $ref: "#/definitions/my_authenticator"   # additional properties here
This approach is confirmed in both the documentation and community discussions, where switching from
*ref(...)
to
"#/definitions/..."
resolved similar validation errors. The parser will then correctly dereference the value and validate it against the schema. [See documentation on references](https://docs.airbyte.com/platform/next/connector-development/config-based/advanced-topics/references) and [community example](https://discuss.airbyte.io/t/3981). Summary: Replace
*ref(definitions.my_authenticator)
with
"#/definitions/my_authenticator"
in your manifest. This should resolve the validation error.
a
@kapa.ai I’m now getting this error:
Copy code
Traceback (most recent call last):
  File "/Users/andrey/Library/Caches/pypoetry/virtualenvs/source-quickbooks-drivepoint-4zeC4cAE-py3.11/lib/python3.11/site-packages/airbyte_cdk/sources/declarative/concurrent_declarative_source.py", line 356, in _validate_source
    validate(self._source_config, self._declarative_component_schema)
  File "/Users/andrey/Library/Caches/pypoetry/virtualenvs/source-quickbooks-drivepoint-4zeC4cAE-py3.11/lib/python3.11/site-packages/jsonschema/validators.py", line 1332, in validate
    raise error
jsonschema.exceptions.ValidationError: {'type': 'QuickbooksOauth2Authenticator', 'company_id': "{{ config['company_id'] }}", 'client_id': "{{ config['client_id'] }}", 'client_secret': "{{ config['client_secret'] }}", 'refresh_token': "{{ config['refresh_token'] }}"} is not valid under any of the given schemas

Failed validating 'anyOf' in schema[0]['properties']['authenticator']:
    {'title': 'Authenticator',
     'linkable': True,
     'description': 'Authentication method to use for requests sent to the '
                    'API.',
     'anyOf': [{'$ref': '#/definitions/ApiKeyAuthenticator'},
               {'$ref': '#/definitions/BasicHttpAuthenticator'},
               {'$ref': '#/definitions/BearerAuthenticator'},
               {'$ref': '#/definitions/OAuthAuthenticator'},
               {'$ref': '#/definitions/JwtAuthenticator'},
               {'$ref': '#/definitions/SessionTokenAuthenticator'},
               {'$ref': '#/definitions/SelectiveAuthenticator'},
               {'$ref': '#/definitions/CustomAuthenticator'},
               {'$ref': '#/definitions/NoAuth'},
               {'$ref': '#/definitions/LegacySessionTokenAuthenticator'}]}

On instance['authenticator']:
    {'type': 'QuickbooksOauth2Authenticator',
     'company_id': "{{ config['company_id'] }}",
     'client_id': "{{ config['client_id'] }}",
     'client_secret': "{{ config['client_secret'] }}",
     'refresh_token': "{{ config['refresh_token'] }}"}
k
A message from kapa.ai
New message text here
A message from kapa.ai
The error message you are seeing for the QuickBooks connector:
Copy code
TypeError("'>' not supported between instances of 'AirbyteDateTime' and 'NoneType'")
means that during the sync, the connector attempted to compare a datetime value (
AirbyteDateTime
) with a
None
value. This typically happens when the sync logic tries to determine the latest record or state, but one of the values involved in the comparison is missing (i.e.,
None
). This can occur if the state for the stream is not properly initialized or if some records are missing the expected datetime field. This type of error is similar to issues seen in other connectors, where the state or cursor field is not set or is
None
, leading to a failed comparison during incremental syncs. For example, a related error in the Marketo connector was resolved by ensuring that the state value was always set and not
None
before comparison, as seen in [this forum post](https://discuss.airbyte.io/t/3460). How to address: - Check your connection state for the
accounts
stream and ensure it is properly initialized with a valid datetime value. - If this is the first sync or the state is empty, you may need to reset the connection or manually set the state to a valid datetime. - Review your data to ensure all records have the expected datetime field populated. If the issue persists, it may require a code or manifest update to handle cases where the state or cursor field is
None
before performing comparisons. I'm sorry, but the knowledge sources do not provide a QuickBooks-specific fix for this error, but the root cause and troubleshooting steps are consistent with similar issues in other Airbyte connectors.