diff --git a/airbyte-cdk/python/.bumpversion.cfg b/airbyte-cdk/python/.bumpversion.cfg index 49a00e29f9cc..c0c9e5ce3dd2 100644 --- a/airbyte-cdk/python/.bumpversion.cfg +++ b/airbyte-cdk/python/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.19.0 +current_version = 0.19.1 commit = False [bumpversion:file:setup.py] diff --git a/airbyte-cdk/python/CHANGELOG.md b/airbyte-cdk/python/CHANGELOG.md index b8a48367d4f8..cf57eeddf771 100644 --- a/airbyte-cdk/python/CHANGELOG.md +++ b/airbyte-cdk/python/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 0.19.1 +Low-code: Make documentation_url in the Spec be optional + ## 0.19.0 Low-Code: Handle forward references in manifest diff --git a/airbyte-cdk/python/airbyte_cdk/sources/declarative/declarative_component_schema.yaml b/airbyte-cdk/python/airbyte_cdk/sources/declarative/declarative_component_schema.yaml index 9d005d999b4b..d74e86bb65fb 100644 --- a/airbyte-cdk/python/airbyte_cdk/sources/declarative/declarative_component_schema.yaml +++ b/airbyte-cdk/python/airbyte_cdk/sources/declarative/declarative_component_schema.yaml @@ -1024,7 +1024,6 @@ definitions: required: - type - connection_specification - - documentation_url properties: type: type: string diff --git a/airbyte-cdk/python/airbyte_cdk/sources/declarative/models/declarative_component_schema.py b/airbyte-cdk/python/airbyte_cdk/sources/declarative/models/declarative_component_schema.py index c7b849242ee6..6e9f48144535 100644 --- a/airbyte-cdk/python/airbyte_cdk/sources/declarative/models/declarative_component_schema.py +++ b/airbyte-cdk/python/airbyte_cdk/sources/declarative/models/declarative_component_schema.py @@ -299,7 +299,7 @@ class SingleSlice(BaseModel): class Spec(BaseModel): type: Literal["Spec"] connection_specification: Dict[str, Any] - documentation_url: str + documentation_url: Optional[str] = None class WaitTimeFromHeader(BaseModel): diff --git a/airbyte-cdk/python/airbyte_cdk/sources/declarative/spec/spec.py b/airbyte-cdk/python/airbyte_cdk/sources/declarative/spec/spec.py index d5ac6a1d586d..fd3b67f13861 100644 --- a/airbyte-cdk/python/airbyte_cdk/sources/declarative/spec/spec.py +++ b/airbyte-cdk/python/airbyte_cdk/sources/declarative/spec/spec.py @@ -3,7 +3,7 @@ # from dataclasses import InitVar, dataclass -from typing import Any, Mapping +from typing import Any, Mapping, Optional from airbyte_cdk.models.airbyte_protocol import ConnectorSpecification from dataclasses_jsonschema import JsonSchemaMixin @@ -15,20 +15,23 @@ class Spec(JsonSchemaMixin): Returns a connection specification made up of information about the connector and how it can be configured Attributes: - documentation_url (str): The link the Airbyte documentation about this connector connection_specification (Mapping[str, Any]): information related to how a connector can be configured + documentation_url (Optional[str]): The link the Airbyte documentation about this connector """ - documentation_url: str connection_specification: Mapping[str, Any] options: InitVar[Mapping[str, Any]] + documentation_url: Optional[str] = None def generate_spec(self) -> ConnectorSpecification: """ Returns the connector specification according the spec block defined in the low code connector manifest. """ + obj = {"connectionSpecification": self.connection_specification} + + if self.documentation_url: + obj["documentationUrl"] = self.documentation_url + # We remap these keys to camel case because that's the existing format expected by the rest of the platform - return ConnectorSpecification.parse_obj( - {"documentationUrl": self.documentation_url, "connectionSpecification": self.connection_specification} - ) + return ConnectorSpecification.parse_obj(obj) diff --git a/airbyte-cdk/python/setup.py b/airbyte-cdk/python/setup.py index ff6346769aec..5cb79a06d947 100644 --- a/airbyte-cdk/python/setup.py +++ b/airbyte-cdk/python/setup.py @@ -15,7 +15,7 @@ setup( name="airbyte-cdk", - version="0.19.0", + version="0.19.1", description="A framework for writing Airbyte Connectors.", long_description=README, long_description_content_type="text/markdown",