All notable changes to this project will be documented in this file.

[0.28.1] - 2026-11-23

Pruning errors. JSV.ValidationError.prune_errors/2 drops errors from a validation error before it is copied to another process, stored or normalized. :min_error_level drops the errors below a level, and :max_errors keeps only the errors of the first invalid locations of the data, in data path order. Each branch of anyOf, oneOf, allOf and if keeps up to :max_errors locations of its own. JSV.normalize_error/2 accepts :max_errors too, and prunes the error before formatting it.

Custom vocabularies. With :min_error_level, an error is now kept only when both its level arg and the :level returned by format_error/3 reach the given value. The returned level no longer overrides a lower level arg.

If you are upgrading from 0.27 or earlier, make sure to read the 0.28.0 release notes, that release changed the error args and deprecated some JSV.Validator functions.

๐Ÿš€ Features

  • Add JSV.ValidationError.prune_errors/2 (#168) โ€“ by Lars Hesel Christensen

[0.28.0] - 2026-11-19

Smaller errors. The per-child errors of items, properties and related keywords now carry nil as data instead of the whole array or object, and the errors of anyOf, oneOf, allOf and if no longer embed the root schema. Sending an error to another process, storing it in ETS or serializing it now copies much less data.

false subschemas. The specific message, like "additional properties are not allowed but found property 'b'", is now on the boolean_schema error of the rejected property or item, at level 10. With JSV.normalize_error/2 and min_error_level: 10, it is reported at the instance location of that property or item (#/b) instead of its parent (#).

Custom code matching on error args.

  • For anyOf, oneOf, allOf and if errors, the ok_if_vctx, ok_if_subschema, err_if_vctx and after_err_vctx args are replaced by ok_if, err_if_errors and after_errors.
  • The boolean_schema_false arg is removed from the parent error. The rejected key is in the key arg of the child boolean_schema error.

Custom vocabularies. A level returned by format_error/3 still takes precedence over the level arg. JSV.Builder.build_sub!/4 accepts an :error_formatter option to format the error of a false subschema with the vocabulary's own message. The following functions are deprecated:

IDNA 8 is now accepted as a dependency.

๐Ÿš€ Features

  • [breaking] Set error levels in args and report false subschemas on the child (#167)

๐Ÿ› Bug Fixes

  • Keep the container data out of per-child wrapper errors (#159) โ€“ by Lars Hesel Christensen
  • Accept duplicates in 'required' keyword (#161) โ€“ by Lars Hesel Christensen
  • Keep only errors and paths in anyOf/oneOf/allOf/if error args (#165)
  • Report the index in draft 7 items list schemaLocation

โšก Performance

  • Validate object properties without intermediate lists or data copies โ€“ by Lars Hesel Christensen
  • Set the subschema path once when validating a sub term โ€“ by Lars Hesel Christensen
  • Check type lists without a closure โ€“ by Lars Hesel Christensen
  • Upcase date and time strings only when they hold a lowercase separator โ€“ by Lars Hesel Christensen

[0.27.0] - 2026-11-04

New JSV.valid?/2 function: it returns a boolean and stops at the first error. It skips building errors and tracking the paths used to report them, so it is cheaper than JSV.validate/3 when the errors are not needed. Cast functions are still called, because a failing cast makes the data invalid, but the cast data is not returned. Thanks to @larshesel for this contribution (#155).

JSV.validate/3 is also faster: it executes 4% to 11% fewer instructions than in 0.26.2 on the library benchmarks, and more on schemas using $ref or module schemas.

Custom vocabularies. With JSV.valid?/2, the first error stops the whole validation. Keywords that test the result of a subschema and can accept the data that the subschema rejects, like not, anyOf or contains, must validate it with JSV.Validator.validate_detach/4, or with the new JSV.Validator.validate_in_detach/6 for a property or array item. With validate/3, validate_in/6 or validate_as/4, such keywords would wrongly reject data under JSV.valid?/2. Results with JSV.validate/3 are unchanged. The JSV.Vocabulary documentation describes which function to use.

The validators and opts fields of the validation context moved to an internal config field. Read them with JSV.Validator.ValidationContext.config/2, for instance ValidationContext.config(vctx, :opts).

๐Ÿš€ Features

  • Add JSV.valid?/2, a fail-fast validation mode (#155) โ€“ by Lars Hesel Christensen

๐Ÿšœ Refactor

  • Reduce fail-fast validator helpers to validate_detach and validate_in_detach

โšก Performance

  • Pin benchmarks to one CPU and count instructions per call
  • Group constant validation context fields in a record
  • Read the fail-fast flag in existing context matches
  • Limit validator context lookups when changing scope
  • Report allocated words per call in benchmarks
  • Update the validator context only once when entering and leaving a $ref

๐Ÿงช Testing

  • Cover fail-fast catches in 'contains', if and custom keywords

โš™๏ธ Miscellaneous Tasks

  • Make JSV.Validator.Error type non-opaque

[0.26.2] - 2026-10-31

Security fix: CVE-2026-117680 / GHSA-cvmg-hgv6-jqcp. All users validating untrusted data against schemas with pattern or patternProperties should upgrade.

When a regex exhausted its backtracking budget, the match was reported as a non-match. Data that matches a pattern only after heavy backtracking could then skip patternProperties subschemas, be validated by additionalProperties instead, or pass a not: {pattern: ...} deny-list.

An exhausted budget is now an indeterminate result: validation stops and returns a JSV.ValidationError with a single error of kind indeterminate_pattern, which combinators cannot invert. Such data is now always rejected, even when it would match. If valid data gets rejected this way, rewrite the pattern without nested quantifiers or overlapping alternatives.

minLength and maxLength now count Unicode code points instead of grapheme clusters, as required by the specification. For instance "รฉ" written as e followed by U+0301 now has a length of 2.

๐Ÿ› Bug Fixes

  • Count minLength and maxLength in code points (#151) โ€“ by Lars Hesel Christensen
  • Fail validation when a regex exhausts its backtracking budget

โšก Performance

  • Keep a single cast stack per data level
  • Zip array items with their schemas without streams (#153) โ€“ by Lars Hesel Christensen

๐Ÿงช Testing

  • Updated JSON Schema test suite
  • Run stderr capturing tests synchronously

[0.26.1] - 2026-10-14

๐Ÿš€ Features

  • Strict RFC 3339 validation for date, time and date-time formats

๐Ÿ› Bug Fixes

  • Reject comma as decimal separator in date-time format

[0.26.0] - 2026-10-04

๐Ÿš€ Features

  • Expose error context data in normalized keyword errors

[0.25.0] - 2026-09-25

๐Ÿš€ Features

  • Allow to configure current stacktrace for build warnings

[0.24.0] - 2026-09-23

๐Ÿš€ Features

  • Warn on unresolved module atoms during schema normalization

๐Ÿงช Testing

  • Updated JSON Schema Test Suite

[0.23.1] - 2026-09-21

๐Ÿ› Bug Fixes

  • Rename 'default' error level to 'cause'

[0.23.0] - 2026-09-17

๐Ÿš€ Features

  • Allow hiding intermediary errors in error formatter

๐Ÿ› Bug Fixes

  • Accept compressed IPv6 and embedded IPv4 hosts in uri and iri formats
  • Fix propertyNames schemaLocation on errors

๐Ÿงช Testing

  • Updated JSON Schema Test Suite

โš™๏ธ Miscellaneous Tasks

  • Limit justfile verbosity on mix.deps

[0.22.0] - 2026-08-07

๐Ÿš€ Features

  • Implement uniqueItems for Decimal

๐Ÿ› Bug Fixes

  • Raise explicit message on defschema without :properties

๐Ÿšœ Refactor

  • Extract test suite generation into JSV.TestSuiteGenerator

๐Ÿงช Testing

  • Render floats as erlang would decode them when generating test suite
  • Updated JSON Schema Test Suite
  • Updated JSON Schema Test Suite and updated conformity tests

โš™๏ธ Miscellaneous Tasks

  • Document invalid JSON files in JSON Schema Test Suite

[0.21.2] - 2026-07-10

๐Ÿ› Bug Fixes

  • Ignore httpc cache chmod tests on windows
  • Add missing type: object on arprops schema helper

๐Ÿ“š Documentation

  • Added missing docs for public API

[0.21.1] - 2026-07-06

๐Ÿš€ Features

  • Allow to define @doc above defschema to document json_schema/0 generated function

[0.21.0] - 2026-07-05

๐Ÿ› Bug Fixes

  • Prevent infinite recursion in cross ref schemas
  • [breaking] JSV.Resolver.Httpc security defaults (no redirects, TLS verification, private atomic cache, size/timeout limits)
  • Bound regex backtracking cost in pattern and patternProperties matching
  • Support dynamicAnchor in id-less root schemas and fail gracefully on malformed keywords

๐Ÿ“š Documentation

  • Document internal resolver security considerations

๐Ÿงช Testing

  • Updated JSON Schema Test Suite
  • Updated JSON Schema Test Suite

[0.20.0] - 2026-06-26

๐Ÿš€ Features

  • Removed NimbleOptions dependency and changed internal options to use maps

๐Ÿšœ Refactor

  • Skip tracking casts and unevaluated paths when schemas do not need it

[0.19.6] - 2026-06-25

๐Ÿ› Bug Fixes

  • Support unicode general categories in pattern/patternProperties

๐Ÿงช Testing

  • Updated JSON Schema Test Suite

[0.19.5] - 2026-06-15

๐Ÿ› Bug Fixes

  • Properly handle Draft-7 style anchor IDs

๐Ÿงช Testing

  • Updated JSON Schema Test Suite

[0.19.4] - 2026-06-07

๐Ÿ› Bug Fixes

  • Fixed nested anchor resolution without root namespace

[0.19.3] - 2026-05-30

๐Ÿ› Bug Fixes

  • Allow module-based schemas in schema helpers typespecs

[0.19.2] - 2026-05-29

๐Ÿ› Bug Fixes

  • Make local resolver work on Windows (#95)
  • Reject +/- prefixes on 'date' format

โš™๏ธ Miscellaneous Tasks

  • Updated JSON Schema test suite
  • Fix compilation warnings for Elixir 1.20

[0.19.1] - 2026-05-13

๐Ÿš€ Features

  • Return better stacktraces in builder warnings

[0.19.0] - 2026-05-10

๐Ÿš€ Features

  • [breaking] New cast system see https://hexdocs.pm/jsv/002-api-changes-v0-19.html (#90)
  • [breaking] Converted schema presets to new cast system
  • Added schema build warnings on atom casters (#91)
  • Pass raw schema to casters at build time
  • Added the aprops and arprops helpers to cast properties schemas to atom keys
  • Removed the deprecated schema presets in JSV.Schema
  • [breaking] Support Decimal 3.0 and drop support for Poison

๐Ÿ› Bug Fixes

  • MultipleOf with Decimal support
  • Ignore examples keyword when scanning schema
  • Nullable() will now add nil to enums

๐Ÿ“š Documentation

  • Document build_key usage with refs
  • Reference drop of Poison support in migration guide

โš™๏ธ Miscellaneous Tasks

  • Added roadmap section to readme
  • Refactor of the JSON Schema test suite generators
  • Simplify built-in casts output syntax

[0.18.3] - 2026-04-21

๐Ÿ› Bug Fixes

  • Fixed schema scanning around non-schemas like properties
  • Allow to dereference numeric pointers from maps in refs

โš™๏ธ Miscellaneous Tasks

  • Updated JSON Schema Test Suite

[0.18.2] - 2026-04-19

๐Ÿ› Bug Fixes

  • Allow root $ref to resolve against root $id in Draft-7

๐Ÿ“š Documentation

  • Fixed documentation for httpc resolver

โš™๏ธ Miscellaneous Tasks

  • Updated JSON Schema test suite

[0.18.1] - 2026-04-08

๐Ÿš€ Features

  • Return a BuildError instead of raising a RuntimeError for :invalid_properties โ€“ by Bruce Williams

[0.18.0] - 2026-04-02

๐Ÿš€ Features

  • [breaking] Removed support for deprecated schema/0 export from schema modules

[0.17.1] - 2026-03-19

๐Ÿ› Bug Fixes

  • Revert undesired regex compilation change

โš™๏ธ Miscellaneous Tasks

  • Relax idna version requirements

[0.17.0] - 2026-03-19

๐Ÿš€ Features

  • New return type signature for custom error formatters
  • [breaking] Read and consume module attributes for defschema/3

๐Ÿงช Testing

  • Upgraded JSON Schema Test Suite

โš™๏ธ Miscellaneous Tasks

  • Updated license to Apache-2.0

[0.16.0] - 2026-01-20

๐Ÿš€ Features

  • [breaking] Changed schema titles for JSV.KeywordError, JSV.ValidationError and JSV.ValidationUnit

[0.15.2] - 2026-01-19

๐Ÿ› Bug Fixes

  • Fixed type error on serialization optional values

[0.15.1] - 2026-01-06

๐Ÿš€ Features

  • Added :as_root option for normalize_collect

๐Ÿ› Bug Fixes

  • Do not add description to schema with defschema/3 if nil

[0.15.0] - 2026-01-06

๐Ÿš€ Features

  • Added JSV.Schema.normalize_collect to generate self-contained schemas from modules
  • Added the nullable/1 schema helper โ€“ by Jaden

๐Ÿ“š Documentation

  • Fixed docs for the optional helper

[0.14.0] - 2025-12-30

๐Ÿš€ Features

  • Allow to use schema helpers with import JSV and defschema/3
  • Added json serialization skip option in optional() properties

[0.13.1] - 2025-11-26

๐Ÿ› Bug Fixes

  • Invalidate empty labels in hostname validation

[0.13.0] - 2025-11-25

๐Ÿš€ Features

  • Relax additional properties in error schemas
  • Support the @skip_keys attribute for structs created with defschema
  • New hostname validator based on :idna (new JSON Schema suite tests)

[0.12.0] - 2025-11-19

๐Ÿš€ Features

  • Support normalizing structs into non-map values in the Normalizer
  • Added support for collecting additionalProperties in structs

[0.11.5] - 2025-11-12

๐Ÿ› Bug Fixes

  • Relax Poison dependency version constraints

๐Ÿ“š Documentation

  • Document function groups in main JSV module

[0.11.4] - 2025-10-23

๐Ÿ› Bug Fixes

  • Ignore all error values from Code.ensure_compiled

[0.11.3] - 2025-10-23

๐Ÿ› Bug Fixes

  • Fixed module-based schema loading in Elixir 1.19

[0.11.2] - 2025-10-13

๐Ÿ“š Documentation

  • Fixed doc on schema preset helpers

[0.11.0] - 2025-09-16

๐Ÿš€ Features

  • [breaking] ABNF parsers are now automatically enabled

๐Ÿงช Testing

  • Updated JSON Schema Test Suite

โš™๏ธ Miscellaneous Tasks

  • Updated README.md

[0.10.1] - 2025-08-11

๐Ÿš€ Features

  • Export required keys from generated struct modules

โš™๏ธ Miscellaneous Tasks

  • Fix JSON tests for elixir 1.17

[0.10.0] - 2025-07-10

๐Ÿš€ Features

  • Define and expect schema modules to export json_schema/0 instead of schema/0
  • Allow to call defschema with a list of properties
  • Added the defschema/3 macro to define schemas as submodules

๐Ÿ› Bug Fixes

  • Ensure defschema with keyword syntax supports module-based properties

[0.9.0] - 2025-07-05

๐Ÿš€ Features

  • Provide a schema representing normalized validation errors
  • Deprecated the schema composition API in favor of presets

๐Ÿ› Bug Fixes

  • Emit a build error with empty oneOf/allOf/anyOf
  • Reset errors when using a detached validator
  • Ensure casts are applied after all validations
  • Revert default normalized error to atoms

โš™๏ธ Miscellaneous Tasks

  • Define titles for normal validation error schemas

[0.8.1] - 2025-06-29

โš™๏ธ Miscellaneous Tasks

  • Export the locals_without_parens formatter opts for public macros

[0.8.0] - 2025-06-23

๐Ÿš€ Features

  • Declare formatting support from main JSON codec
  • Added the JSV.validate! bang functions
  • Added explicit error when a sub schema is not buildable
  • Export JSV.resolver_chain/1 for integration in 3rd parties
  • [breaking] Defschema does not automatically define $id anymore
  • Added string_to_number and string_to_boolean casters
  • Return sub errors when oneOf has no matches
  • Order sub-errors by ascending item index in array validation
  • Added ability to build only a nested schema or multiple schemas
  • Expose the map extensions helpers
  • Added the prewalk traverse utility for schema normalization
  • [breaking] Error normalizer will now sort error by instanceLocation
  • [breaking] Changed caster tag of defschema to 0
  • Allow custom formats to validate other types than strings
  • Provide a function to create reference from a list of path segments

๐Ÿ› Bug Fixes

  • Ensure keys are json-pointer encoded in instanceLoction in errors
  • Return meaningful error for unknow keys in :required in defschema
  • Fixed typespec on JSV.build_key!
  • Fixed typespec and argument name in Builder.build!

๐Ÿšœ Refactor

  • Renamed Schema.override/2 to Schema.merge/2
  • Defined different typespecs for normal schema and native schema
  • Build error will now be raised with a proper stacktrace
  • Removed useless accumulation of atoms when normalizing schemas
  • [breaking] Changed order of arguments for Normalizer.normalize/3
  • Renamed build_root to to_root as it is not building validators

๐Ÿ“š Documentation

  • Rework Decimal support limitations

๐Ÿงช Testing

  • Verify that unknown formats are ignored when formats assertion is disabled

โš™๏ธ Miscellaneous Tasks

  • Clarify defschema error when no properties are given
  • Fix warning when Poison.EncodeError is not defined
  • Updated JSON Schema Test Suite
  • Renamed keycast module attribute to jsv_keycast in defschema
  • Provide correct line/column in debanged functions
  • Allow to customize Inspect for Builder and Resolver
  • Fix Elixir 1.19 warnings

[0.7.2] - 2025-05-08

๐Ÿš€ Features

  • Added the non_empty_string schema helper
  • Atom enums will use string_to_atom to support compile-time builds

โš™๏ธ Miscellaneous Tasks

  • Updated JSON Schema Test Suite
  • Enhanced JSTS updater
  • Fixed warning on code when Decimal is missing

[0.7.1] - 2025-04-27

๐Ÿ› Bug Fixes

  • Fixed hex package definition

[0.7.0] - 2025-04-27

๐Ÿš€ Features

  • Mail_address dependency is no longer used
  • Validation support for Decimal

๐Ÿ“š Documentation

  • Updated doc examples with generated code

๐Ÿงช Testing

  • Enable tests for the 'uuid' format
  • Enable tests for the 'hostname' format
  • Enable tests for all uri/iri/pointer formats

โš™๏ธ Miscellaneous Tasks

  • Changed JSON schema test suite updater

[0.6.3] - 2025-04-13

โš™๏ธ Miscellaneous Tasks

  • Fix missing file in hex package breaking installs

[0.6.2] - 2025-04-13

๐Ÿš€ Features

  • Added Jason/Poison/JSON encoder implementations for JSV.NValidationError

[0.6.1] - 2025-04-13

โš™๏ธ Miscellaneous Tasks

  • Use mix_version for release process

[0.6.0] - 2025-04-13

๐Ÿš€ Features

  • Resolvers do not need to normalize schemas anymore
  • Added support to override existing vocabularies
  • Schema definition helpers do not enforce a Schema struct anymore
  • Provide a generic JSON normalizer for data and schemas
  • Allow resolvers to mark schemas as normalized
  • [breaking] Use jsv-cast keyword in schemas for struct and cast functions

๐Ÿ› Bug Fixes

  • Removed conversion to string in codec format_to_iodata

๐Ÿ“š Documentation

  • Fix documentation grammar and typos
  • Organize docs sidebar in categories

โš™๏ธ Miscellaneous Tasks

  • Update Elixir Github workflow (#17)
  • Use absolute path for JSTS ref file

[0.5.1] - 2025-03-28

๐Ÿ› Bug Fixes

  • Fixed compilation with Mix.install

โš™๏ธ Miscellaneous Tasks

  • Release v0.5.1

[0.5.0] - 2025-03-25

๐Ÿš€ Features

  • Added JSV.Resolver.Local to resolve disk stored schemas
  • Special error format for additionalProperties:false
  • Provide correct schemaLocation in all errors
  • Added defschema_for to use different modules for schema and struct
  • Provide ordered JSON encoding with native JSON modules

๐Ÿ› Bug Fixes

  • Check presence of JSON module in CI

๐Ÿงช Testing

  • Make JSON codecs easier to test
  • Fixed assertions for JSON codec on old OTP versions

โš™๏ธ Miscellaneous Tasks

  • Refactored schema normalization
  • Removed unused alias
  • Use readmix to generate formats docs

[0.4.0] - 2025-02-08

๐Ÿš€ Features

  • Support module-based schemas with structs

[0.3.0] - 2025-01-08

๐Ÿš€ Features

  • Added a default resolver using static schemas

๐Ÿ› Bug Fixes

  • Upgrade abnf_parsec to correctly parse IRIs and IRI references

[0.2.0] - 2025-01-03

๐Ÿ“š Documentation

  • Document atom conversion
  • Document functions with doc and spec

[0.1.0] - 2025-01-01