Skip to content

Validate function argument contracts - #66

Open
OskarEichler wants to merge 1 commit into
jmespath:mainfrom
OskarEichler:codex/function-contracts
Open

Validate function argument contracts#66
OskarEichler wants to merge 1 commit into
jmespath:mainfrom
OskarEichler:codex/function-contracts

Conversation

@OskarEichler

Copy link
Copy Markdown

Summary

Return JMESPath error classes consistently for malformed function calls: validate string contains needles, distinguish sum type/arity errors, require object arguments for merge, and enforce one argument for reverse and to_array.

Reproduction

Focused external cases currently leak Ruby TypeError, classify non-array sum as arity, or silently ignore extra/missing arguments. The candidate raises the specification's InvalidTypeError or InvalidArityError.

Verification

  • isolated branch: 1,790 examples, zero failures
  • focused six-contract model, including disabled-visit-error behavior
  • cumulative candidate: 892 current compliance checks, zero failures
  • all runtime syntax and Rails 8.1.3.1 integration pass

Compatibility

Valid calls are unchanged; only invalid argument shapes receive consistent JMESPath errors. Prepared with AI-assisted source review; no repository tests were changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant