Fix Platform Details API Pydantic validation failure #45
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Desired Outcome
Fix the
ArkPCloudPlatformsService.platform()method that fails with Pydantic validation errors when calling the Platform Details API endpoint. The SDK was attempting to validate the API response against an incorrect model structure.Implemented Changes
What's changed:
ArkPCloudPlatformDetailsmodel that matches the actual Platform Details API response format ({"PlatformID": "X", "Active": true, "Details": {...}})platform()method to returnArkPCloudPlatformDetailsinstead ofArkPCloudPlatformimport_platform()method to return platform ID string (matching Import Platform API response) instead of attempting to fetch platform detailsWhy these changes were made:
The Platform Details API (
/platforms/{id}) returns a different structure than the List Platforms API (/platforms). The SDK was incorrectly trying to parse the flat Platform Details response against the nested List Platforms model structure.How to review:
ArkPCloudPlatformDetailsmodel correctly maps to the API response from issue Platform Details API Pydantic validation fails in v2.0.14 #44platform()method now successfully parses Platform Details API responsesimport_platform()correctly returns the platform ID string as per Import Platform API specificationConnected Issue/Story
Resolves #44
CyberArk internal issue ID: N/A
Definition of Done
Changelog
Test coverage
Documentation
READMEs) were updated in this PRBehavior
Security