diff --git a/polyapi/deployables.py b/polyapi/deployables.py index f41d90a..a3feb61 100644 --- a/polyapi/deployables.py +++ b/polyapi/deployables.py @@ -31,6 +31,7 @@ class ParsedDeployableConfig(TypedDict): context: str name: str type: DeployableTypes + description: Optional[str] disableAi: Optional[bool] config: Dict[str, Any] diff --git a/polyapi/parser.py b/polyapi/parser.py index 8ae3397..f474693 100644 --- a/polyapi/parser.py +++ b/polyapi/parser.py @@ -513,7 +513,13 @@ def generic_visit(self, node): deployable["context"] = context or deployable["config"].get("context", "") deployable["name"] = name or deployable["config"].get("name", "") deployable["disableAi"] = deployable["config"].get("disableAi", False) - deployable["description"] = deployable["types"].get("description", "") + deployable["description"] = deployable["config"].get("description", "") + if deployable["description"]: + if deployable["description"] != deployable["types"].get("description", ""): + deployable["types"]["description"] = deployable["description"] + deployable["dirty"] = True + else: + deployable["description"] = deployable["types"].get("description", "") if not deployable["name"]: print_red("ERROR") print("Function config is missing a name.") diff --git a/polyapi/typedefs.py b/polyapi/typedefs.py index 6d6ff18..b887103 100644 --- a/polyapi/typedefs.py +++ b/polyapi/typedefs.py @@ -78,6 +78,7 @@ class SchemaSpecDto(TypedDict): class PolyDeployable(TypedDict, total=False): context: str name: str + description: NotRequired[str] disable_ai: NotRequired[bool] # Optional field to disable AI diff --git a/pyproject.toml b/pyproject.toml index 05cb142..70f460a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires = ["setuptools>=61.2", "wheel"] [project] name = "polyapi-python" -version = "0.3.8.dev8" +version = "0.3.8.dev9" description = "The Python Client for PolyAPI, the IPaaS by Developers for Developers" authors = [{ name = "Dan Fellin", email = "dan@polyapi.io" }] dependencies = [