fix: coerceInputTypes handles flat InputsSchema without properties wrapper#519
Merged
fix: coerceInputTypes handles flat InputsSchema without properties wrapper#519
Conversation
…apper The coerceInputTypes function only checked schema.properties, skipping type coercion entirely for flat schemas (where property definitions sit directly on the schema object). This caused --input key=value to fail validation when the workflow used the common flat input format, since string values were never coerced to their declared types. Use the same schema.properties ?? schema fallback pattern used by InputValidationService and other consumers of InputsSchema. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
✅ Approved
This is a clean, well-tested bug fix.
What's Good
- Pattern consistency: Uses the established
schema?.properties ?? schemafallback pattern already present inInputValidationServiceandworkflow_search.ts - Type safety: Proper import of
JsonSchemaPropertytype and defensiveif (!propSchema?.type)check protects against edge cases - CLAUDE.md compliance: Named exports, no
anytypes, proper copyright header - Test coverage: New test case comprehensively validates flat schema coercion for number, boolean, and string types
- DDD appropriate: CLI-layer utility function is the correct location for input parsing/coercion
No Blocking Issues
The implementation is straightforward and follows existing codebase conventions.
🤖 Reviewed by Claude
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
coerceInputTypes()only checkedschema.properties, skipping type coercion entirely for flat schemas (properties directly on the schema object without apropertieswrapper). This caused--input key=valuewith numeric/boolean types to fail validation since strings were never coerced.schema.properties ?? schemafallback pattern already used byInputValidationServiceand otherInputsSchemaconsumers.Test Plan
coerceInputTypes: flat schema without properties wrappertestdeno check,deno lint,deno fmtall clean🤖 Generated with Claude Code