You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix Platform Details API Pydantic validation failure (#45)
* Fix Platform Details API Pydantic validation failure (#44)
The ArkPCloudPlatformsService.platform() method was failing with Pydantic
validation errors because it tried to validate the Platform Details API
response against the wrong model structure.
Root cause:
- Platform Details API (/platforms/{id}) returns:
{"PlatformID": "X", "Active": true, "Details": {...}}
- List Platforms API (/platforms) returns structured data that fits
ArkPCloudPlatform model with nested sections
Changes:
- Add new ArkPCloudPlatformDetails model matching actual API response format
- Update platform() method to return ArkPCloudPlatformDetails instead of ArkPCloudPlatform
- Update import_platform() method return type for consistency
- Add model exports to __init__.py
This preserves the existing List Platforms functionality while correctly
handling the Platform Details API response structure.
Fixes#44
* Bump version to 2.0.15 for platform details API fix
* Fix import_platform return type to match API response
The Import Platform API only returns {"PlatformID": "{PlatformID}"},
so the method should return the platform ID string rather than trying
to fetch platform details. This removes the type mismatch and correctly
reflects what the API actually provides.
Users can call platform() separately if they need platform details.
* Fix Platform Details API validation with Union approach
Use Union[ArkPCloudPlatform, ArkPCloudPlatformDetails] return type with
try/fallback logic to maintain backward compatibility while fixing
Pydantic validation failures for Details API endpoint.
Addresses reviewer feedback on PR #45.
* Prioritize ArkPCloudPlatform validation for backward compatibility
0 commit comments