diff --git a/airbyte-config/init/src/main/resources/seed/source_definitions.yaml b/airbyte-config/init/src/main/resources/seed/source_definitions.yaml index a2eaf409d3be..8124ee3d9dde 100644 --- a/airbyte-config/init/src/main/resources/seed/source_definitions.yaml +++ b/airbyte-config/init/src/main/resources/seed/source_definitions.yaml @@ -98,7 +98,7 @@ - name: Braintree sourceDefinitionId: 63cea06f-1c75-458d-88fe-ad48c7cb27fd dockerRepository: airbyte/source-braintree - dockerImageTag: 0.1.0 + dockerImageTag: 0.1.2 documentationUrl: https://docs.airbyte.io/integrations/sources/braintree icon: braintree.svg sourceType: api diff --git a/airbyte-config/init/src/main/resources/seed/source_specs.yaml b/airbyte-config/init/src/main/resources/seed/source_specs.yaml index 56e0adeb6afd..ebfc393efd7b 100644 --- a/airbyte-config/init/src/main/resources/seed/source_specs.yaml +++ b/airbyte-config/init/src/main/resources/seed/source_specs.yaml @@ -827,7 +827,7 @@ supportsNormalization: false supportsDBT: false supported_destination_sync_modes: [] -- dockerImage: "airbyte/source-braintree:0.1.0" +- dockerImage: "airbyte/source-braintree:0.1.2" spec: documentationUrl: "https://docs.airbyte.io/integrations/sources/braintree" connectionSpecification: @@ -870,23 +870,18 @@ - "production" - "qa" - "development" - allOf: - - $ref: "#/definitions/Environment" - required: - - "merchant_id" - - "public_key" - - "private_key" - - "environment" - definitions: - Environment: title: "Environment" - description: "An enumeration." enum: - "Development" - "Sandbox" - "Qa" - "Production" type: "string" + required: + - "merchant_id" + - "public_key" + - "private_key" + - "environment" supportsNormalization: false supportsDBT: false supported_destination_sync_modes: [] diff --git a/airbyte-integrations/connectors/source-braintree/Dockerfile b/airbyte-integrations/connectors/source-braintree/Dockerfile index 04b757a16ea6..13f7117b5c46 100644 --- a/airbyte-integrations/connectors/source-braintree/Dockerfile +++ b/airbyte-integrations/connectors/source-braintree/Dockerfile @@ -12,5 +12,5 @@ RUN pip install . ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py" ENTRYPOINT ["python", "/airbyte/integration_code/main.py"] -LABEL io.airbyte.version=0.1.1 +LABEL io.airbyte.version=0.1.2 LABEL io.airbyte.name=airbyte/source-braintree diff --git a/airbyte-integrations/connectors/source-braintree/integration_tests/spec.json b/airbyte-integrations/connectors/source-braintree/integration_tests/spec.json index f076ba7448ac..a0105e1abd4e 100644 --- a/airbyte-integrations/connectors/source-braintree/integration_tests/spec.json +++ b/airbyte-integrations/connectors/source-braintree/integration_tests/spec.json @@ -35,21 +35,11 @@ "description": "Environment specifies where the data will come from.", "name": "Environment", "examples": ["sandbox", "production", "qa", "development"], - "allOf": [ - { - "$ref": "#/definitions/Environment" - } - ] - } - }, - "required": ["merchant_id", "public_key", "private_key", "environment"], - "definitions": { - "Environment": { "title": "Environment", - "description": "An enumeration.", "enum": ["Development", "Sandbox", "Qa", "Production"], "type": "string" } - } + }, + "required": ["merchant_id", "public_key", "private_key", "environment"] } -} +} \ No newline at end of file diff --git a/airbyte-integrations/connectors/source-braintree/source_braintree/schemas/common.py b/airbyte-integrations/connectors/source-braintree/source_braintree/schemas/common.py index fe83843eaf91..225ab050f4d1 100644 --- a/airbyte-integrations/connectors/source-braintree/source_braintree/schemas/common.py +++ b/airbyte-integrations/connectors/source-braintree/source_braintree/schemas/common.py @@ -6,6 +6,7 @@ from typing import Any, Dict, Optional, Type import pydantic +from airbyte_cdk.sources.utils.schema_helpers import expand_refs from pydantic import BaseModel from pydantic.typing import resolve_annotations @@ -61,6 +62,12 @@ def schema_extra(cls, schema: Dict[str, Any], model: Type["BaseModel"]) -> None: ref = prop.pop("$ref") prop["oneOf"] = [{"type": "null"}, {"$ref": ref}] + @classmethod + def schema(cls, **kwargs) -> Dict[str, Any]: + schema = super().schema(**kwargs) + expand_refs(schema) + return schema + class AddOn(CatalogModel): amount: Decimal diff --git a/airbyte-integrations/connectors/source-braintree/source_braintree/spec.py b/airbyte-integrations/connectors/source-braintree/source_braintree/spec.py index 5a63d81210d0..cbbb743d81f1 100644 --- a/airbyte-integrations/connectors/source-braintree/source_braintree/spec.py +++ b/airbyte-integrations/connectors/source-braintree/source_braintree/spec.py @@ -45,3 +45,13 @@ def to_lower_case(cls, v): @validator("environment", pre=True) def to_camel_case(cls, v): return camelize(v) + + @classmethod + def schema(cls, **kwargs): + schema = super().schema(**kwargs) + if "definitions" in schema: + schema["definitions"]["Environment"].pop("description") + schema["properties"]["environment"].update(schema["definitions"]["Environment"]) + schema["properties"]["environment"].pop("allOf", None) + del schema["definitions"] + return schema diff --git a/docs/integrations/sources/braintree.md b/docs/integrations/sources/braintree.md index d6c5f6042c60..624b4be699b3 100644 --- a/docs/integrations/sources/braintree.md +++ b/docs/integrations/sources/braintree.md @@ -58,5 +58,7 @@ We recommend creating a restricted, read-only key specifically for Airbyte acces | Version | Date | Pull Request | Subject | | :--- | :--- | :--- | :--- | +| 0.1.2 | 2021-12-22 | [9042](https://github.com/airbytehq/airbyte/pull/9042) | Fix `$ref` in schema and spec | +| 0.1.1 | 2021-10-27 | [7432](https://github.com/airbytehq/airbyte/pull/7432) | Dispute model should accept multiple Evidences | | 0.1.0 | 2021-08-17 | [5362](https://github.com/airbytehq/airbyte/pull/5362) | Initial version |