Skip to content

Implement core validation logic with type coercion - #15

Draft
matapatos wants to merge 1 commit into
mainfrom
vibe/implement-core-validation-logic-a54fe0
Draft

Implement core validation logic with type coercion#15
matapatos wants to merge 1 commit into
mainfrom
vibe/implement-core-validation-logic-a54fe0

Conversation

@matapatos

Copy link
Copy Markdown
Contributor

Implement core validation logic with type coercion

Changes

  • Add validate_type() function for type validation and coercion
  • Add validate_field_value() implementation with nullable type support
  • Add add_field_errorf() for formatted error messages with type information
  • Support coercion from string to int/long
  • Support coercion from string/long to double
  • Support coercion from int/float to string
  • Support coercion from string/int/float to bool
  • Support coercion from object to array
  • Handle nullable types (e.g., ?string)
  • Respect strict mode from ModelConfigs
  • Update function signatures to pass properties parameter

Impact

  • Core validation logic is now functional
  • Type coercion works for primitive types
  • Better error messages with expected vs actual types
  • Nullable types are properly handled

Closes #2

- Add validate_type() function for type validation and coercion
- Add validate_field_value() implementation with nullable type support
- Add add_field_errorf() for formatted error messages
- Support coercion from string to int/long
- Support coercion from string/long to double
- Support coercion from int/float to string
- Support coercion from string/int/float to bool
- Support coercion from object to array
- Handle nullable types (e.g., ?string)
- Respect strict mode from ModelConfigs
- Update function signatures to pass properties parameter

Closes #2

Co-authored-by: matapatos <matapatos@users.noreply.github.com>
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.

2 participants