Skip to content

feat: richer schema validation#89

Merged
jbee merged 20 commits into
mainfrom
validation-take2
Apr 20, 2026
Merged

feat: richer schema validation#89
jbee merged 20 commits into
mainfrom
validation-take2

Conversation

@jbee

@jbee jbee commented Mar 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • 🆕 added validation Modes (fail-fast vs all errors + exception vs return errors)
  • 🆕 added primitive strictness control via @Strict
  • 🆕 added a integer variant of minimum/maximum validation
  • 🆕 added support for @Validation-meta annotation which themselves have attributes (that translate to attributes on @Validation)
  • 🆕 added InputExpressions for "safe" pattern matching for unknown user input
  • 🆕 added defaults for to(Record) mapping via constant declared in the record called DEFAULT
  • 🆕 added AUTO_SKIP Index mode for JsonNodes (default for selector query API)
  • 🆕 added length() for JsonString
  • 🆕 added Set<NodeType> to JsonObject.Property metadata
  • 🆕 added Text#slice and Text#matches with pattern
  • 🆕 added Text#trim()
  • 🆕 added Text#isSpecialDecimal() (NaN, Infinity, -Infinity)
  • 🆕 added fast digit count for int/long in TextBuilder
  • 🆎 changed @Validation#pattern to use InputExpression (not RegEx, RegEx now via custom @Validator)
  • 🆎 changed JsonPrimitive is now union type of JsonNumber, JsonBoolean and JsonString
  • 🆎 revised syntax and implementation for dependent required

Automatic Testing

New features and methods were covered with new test scenarios.

Documentation

Added a spec for the Input Expressions

@jbee jbee self-assigned this Mar 26, 2026
@jbee jbee marked this pull request as ready for review April 20, 2026 14:10
@jbee jbee merged commit 3a792a7 into main Apr 20, 2026
1 check passed
@jbee jbee deleted the validation-take2 branch April 20, 2026 14:11
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
4 New issues
4 New Code Smells (required ≤ 0)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

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