All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.2.0 - 2026-03-12
Added
- Discriminated unions — new
:discriminated_uniontype selects a schema variant based on a discriminator field value, for polymorphic JSON APIs. - Literal type — new
:literaltype for exact value matching. - Field aliases —
:aliasoption on field definitions maps canonical Elixir keys to different external string keys; the validator checks both names and the transform module can output aliased keys. - Pre-validate hook — schema-level
:pre_validatefunction transforms raw input before standard validation begins. - Per-field validators —
:validateoption runs custom functions after type checks for field-level logic and transformation. - JSON Schema generation now emits
oneOfwith discriminator mappings and supports property name overrides for aliases. - New test suites for discriminated unions, field aliases, field validators, and pre-validate hooks.
Changed
- Added comprehensive documentation guides (getting started, schema definition, validation, JSON schema, JSON serialization, DSPEx integration).
- Enhanced ExDoc configuration with grouped extras, module categories, and additional output formatters.
- Upgraded
jsvdependency from~> 0.13.1to~> 0.16.0. - Upgraded
nimble_optionsfrom~> 1.0to~> 1.1. - Upgraded
ex_docfrom~> 0.34to~> 0.40.1. - Upgraded
stream_datafrom~> 1.1to~> 1.3,mix_test_watchto~> 1.4,excoverallsto~> 0.18.5,bencheeto~> 1.5. - Updated
credo,dialyxir, and supporting libraries to latest stable releases. - Added
castoreas a test-only dependency for certificate handling. - Replaced
length(list) > 0withlist != []for O(1) emptiness checks indspex.exandperformance.ex. - Moved
preferred_cli_envsettings into a dedicatedcli/0function inmix.exsfollowing current Elixir best practices.
0.1.0 - 2025-12-27
Added
- String-keyed schema fields and nested object schema DSL (
Schema.object/1). - Built-in format types (
:date,:datetime,:uuid,:null,{:nullable, type}). - JSON encode/decode helpers with transform pipeline (
Sinter.JSON,Sinter.Transform,Sinter.NotGiven). - Example runner
examples/run_all.shand refreshed example suite.
Changed
- Big-bang refactor of core schema/validation architecture per technical design.
- JSON Schema validation now uses
jsv0.13.1 with Draft 2020-12 default and Draft 7 provider support. - Provider JSON Schema generation applies strictness recursively for nested objects.
- Schema inference avoids atom leaks by defaulting to string keys.
Fixed
- Required/default ordering so defaults apply before required checks.
validate_many/3base path ordering.
0.0.2 - 2025-12-27
Changed
- Switched JSON Schema validation to
ex_json_schemav0.11.2. - Updated generated
$schemato JSON Schema Draft 7 for validator compatibility. - Removed custom JSON Schema structural validation helpers in favor of meta-schema validation.
0.0.1 - 2025-07-05
Added
- Initial release of Sinter
- Unified schema definition, validation, and JSON generation for Elixir
- Core features:
- Unified schema definition with
Sinter.Schema.define/2 - Single validation pipeline with
Sinter.Validator.validate/3 - JSON Schema generation with
Sinter.JsonSchema.generate/2 - Dynamic schema creation for frameworks like DSPy
- Schema inference from examples
- Schema merging for composition
- Provider-specific JSON Schema optimizations
- Unified schema definition with
- Convenience helpers:
validate_type/3for one-off type validationvalidate_value/4for single field validationvalidate_many/1for multiple value validation
- Compile-time macro support with
use_schema - Comprehensive example suite
- Full test coverage
- Documentation and API reference