fix(validator): change format_version type from str to int#75
Merged
fix(validator): change format_version type from str to int#75
Conversation
- ApiCollection.project_id: Make optional and coerce int to string (API returns int or null) - ApiClient.api_policies/api_collections: Make optional (API can return null)
- Change path from cli/data to cli/resources/data - Update test_helpers.py to match new path
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
The Workato export package API returns format_version as an integer (2), not a string. This caused false validation errors for all exported recipes. Fixes recipe validation error: 'format_version should be string not int'
5905741 to
71bf03a
Compare
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
oalami
previously approved these changes
Mar 26, 2026
Contributor
|
@cmworkato linter is throwing an error |
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
oalami
approved these changes
Mar 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This PR fixes several validation bugs discovered during CLI testing.
Fixes
1. RecipeValidator
format_versiontype mismatchThe Workato export package API returns
format_versionas an integer (2), not a string. This caused false validation errors for all exported recipes.Error:
❌ Recipe validation failed Message: Recipe parsing failed: format_version should be string not int Type: syntax_invalid
Root Cause: The
RecipeLinePydantic model definedformat_versionasstr | None, but the API returns an integer.Fix: Changed the type from
str | Nonetoint | Noneto match the actual API response.2.
api-collections listValidationErrorThe API returns
project_idas an integer or null, but the model expected a string.Error:
ValidationError: 1 validation error for ApiCollection project_id: Input should be a valid string
Fix: Made
project_idoptional and added a validator to coerce int to string.3.
api-clients listValidationErrorThe API can return
nullforapi_policiesandapi_collections, but the model required non-null lists.Error:
ValidationError: 1 validation error for ApiClient api_policies: Input should be a valid list
Fix: Made
api_policiesandapi_collectionsoptional withdefault=None.4.
connections pick-listscommand path errorThe path to
picklist-data.jsonwas incorrect (cli/datainstead ofcli/resources/data).Error:
Picklist data not found. Run 'python scripts/parse_picklist_docs.py' to generate it.
Fix: Corrected the path to
cli/resources/data.Testing
test_recipe_line_accepts_format_version_as_inttest_helpers.pyto use correct data path