Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Name | Type | Description | Notes
**id** | **int** | |
**name** | **str** | |
**title** | **str** | |
**latest_released_version** | **int** | |
**latest_released_version** | **int** | Null when the connector has no released versions yet. |
**latest_released_version_note** | **str** | |
**released_versions** | [**List[ConnectorVersion]**](ConnectorVersion.md) | |
**static_webhook_url** | **str** | |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import re # noqa: F401
import json

from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from workato_platform_cli.client.workato_api.models.connector_version import ConnectorVersion
from typing import Optional, Set
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional is imported twice (from typing import ... Optional and from typing import Optional, Set). This is redundant and can be consolidated into a single typing import to keep generated code clean and avoid potential lint churn if rules change.

Suggested change
from typing import Optional, Set
from typing import Set

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The duplicate Optional import is pre-existing on main (a quirk of the python-asyncio generator template), not introduced by this PR — verified with git show main:src/workato_platform_cli/client/workato_api/models/custom_connector.py. Editing it here would diverge from make generate-client output, so the next regen would undo the fix.

Happy to file a separate issue for the generator config cleanup if useful — feels out of scope for this one-field-nullability fix.

Expand All @@ -30,7 +30,7 @@ class CustomConnector(BaseModel):
id: StrictInt
name: StrictStr
title: StrictStr
latest_released_version: StrictInt
latest_released_version: Optional[StrictInt] = Field(description="Null when the connector has no released versions yet.")
latest_released_version_note: Optional[StrictStr]
released_versions: List[ConnectorVersion]
static_webhook_url: Optional[StrictStr]
Expand Down Expand Up @@ -82,6 +82,11 @@ def to_dict(self) -> Dict[str, Any]:
if _item_released_versions:
_items.append(_item_released_versions.to_dict())
_dict['released_versions'] = _items
# set to None if latest_released_version (nullable) is None
# and model_fields_set contains the field
if self.latest_released_version is None and "latest_released_version" in self.model_fields_set:
_dict['latest_released_version'] = None

# set to None if latest_released_version_note (nullable) is None
# and model_fields_set contains the field
if self.latest_released_version_note is None and "latest_released_version_note" in self.model_fields_set:
Expand Down
2 changes: 2 additions & 0 deletions workato-api-spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2532,6 +2532,8 @@ components:
example: "Apps by Workato"
latest_released_version:
type: integer
nullable: true
description: "Null when the connector has no released versions yet."
example: 2
latest_released_version_note:
type: string
Expand Down
Loading