0.26.1 - 2024-10-29
- Return "Unknown specification" error on
https
-prefixed$schema
for Draft 4, 5, 6. #629
0.26.0 - 2024-10-26
Important: This release contains breaking changes. See the Migration Guide for details on transitioning to the new API.
Validator::iter_errors
that iterates over all validation errors.
- BREAKING: Remove unused
ValidationErrorKind::JSONParse
,ValidationErrorKind::InvalidReference
,ValidationErrorKind::Schema
,ValidationErrorKind::FileNotFound
andValidationErrorKind::Utf8
. - BREAKING:
Validator::validate
now returns the first error instead of an iterator in theErr
variant.
- Optimize error formatting in some cases.
0.25.1 - 2024-10-25
- Re-export
referencing::Error
asReferencingError
. #614
0.25.0 - 2024-10-24
Important: This release removes deprecated old APIs. See the Migration Guide for details on transitioning to the new API.
- BREAKING: Default to Draft 2020-12.
- Deprecated
draft201909
,draft202012
, andcli
features. - Deprecated
CompilationOptions
,JSONSchema
,PathChunkRef
,JsonPointerNode
, andSchemaResolverError
aliases. - Deprecated
jsonschema::compile
,Validator::compile
,ValidationOptions::compile
,ValidationOptions::with_resolver
,ValidationOptions::with_meta_schemas
,ValidationOptions::with_document
functions. - Deprecated
SchemaResolver
trait.
0.24.3 - 2024-10-24
- Infinite recursion when using mutually recursive
$ref
inunevaluatedProperties
.
0.24.2 - 2024-10-24
- Infinite recursion in some cases. #146
$ref
interaction with$recursiveAnchor
in Draft 2019-09.unevaluatedProperties
with$recursiveRef
&$dynamicRef
.
0.24.1 - 2024-10-21
- Incomplete external reference resolution.
0.24.0 - 2024-10-20
- Support
$ref
,$recursiveRef
, and$dynamicRef
inunevaluatedItems
. #287 - Support for
$vocabulary
. #263
- Ignore
prefixItems
under Draft 2019-09 as it was introduced in Draft 2020-12.
- Numbers with zero fraction incorrectly handled in
uniqueItems
.
- Speedup
apply
.
0.23.0 - 2024-10-12
- Partial support for
unevaluatedItems
, excluding references.
- Improve error messages on WASM. #568
- Improve error messages on URI resolving and parsing.
- BREAKING: Replace
JsonPointer
in favor ofLocation
.
PathChunkRef
in favor ofLocationSegment
.JsonPointerNode
in favor ofLazyLocation
.
- Resolving file references on Windows. #441
- Missing annotations from by-reference applicators. #403
- Relative keyword locations missing by-reference applicators (such as
$ref
or$dynamicRef
).
- Faster building of a validator.
- Speedup
hostname
&idn-hostname
formats validation. - Speedup
apply
.
JsonPointerNode::to_vec
without a replacement.
0.22.3 - 2024-10-05
- Speedup resolving.
0.22.2 - 2024-10-04
- ECMAScript 262 regex support.
- Speedup
json-pointer
andrelative-json-pointer
formats validation.
0.22.1 - 2024-10-03
- Removed
dbg!
macro.
0.22.0 - 2024-10-03
- Extend email validation. #471
- BREAKING: Custom retrievers now receive
&Uri<&str>
instead of&UriRef<&str>
- Bump
once_cell
to1.20
. - Bump
regex
to1.11
.
time
format validation (leap seconds and second fractions).duration
format validation.- Panic on root
$id
without base. #547 hostname
format validation (double dot).idn-hostname
format validation. #101
- Faster building of a validator.
- Speedup
hostname
,date
,time
,date-time
, andduration
formats validation. - Cache regular expressions for
pattern
. #417
0.21.0 - 2024-09-29
Important: This release brings a complete rework of reference resolving which deprecates some older APIs. While backward compatibility is maintained for now, users are encouraged to update their code. See the Migration Guide for details on transitioning to the new API.
$anchor
support.$recursiveRef
&$recursiveAnchor
support in Draft 2019-09.$dynamicRef
&$dynamicAnchor
support in Draft 2020-12.
- BREAKING: Treat
$ref
as URI, not URL, and additionally normalize them. #454 - BREAKING: Resolve all non-recursive references eagerly.
- BREAKING: Disallow use of fragments in
$id
. #264
SchemaResolver
trait andSchemaResolverError
in favor of a simplerRetrieve
that works withBox<dyn std::error::Error>
. In turn, it also deprecatesValidationOptions::with_resolver
in favor ofValidationOptions::with_retriever
ValidationOptions::with_document
in favor ofValidationOptions::with_resource
.
- Infinite recursion in
unevaluatedProperties
. #420 - Cross-draft validation from newer to older ones.
- Changing base URI in folder.
- Location-independent identifier in remote resource.
- Missing some format validation for Draft 2020-12.
- Incomplete
iri
&iri-reference
validation.
- Faster validation for
uri
,iri
,uri-reference
, andiri-reference
formats.
0.20.0 - 2024-09-18
Important: This release includes several deprecations and renames. While backward compatibility is maintained for now, users are encouraged to update their code. See the Migration Guide for details on transitioning to the new API.
- New draft-specific modules for easier version-targeted validation:
jsonschema::draft4
jsonschema::draft6
jsonschema::draft7
jsonschema::draft201909
jsonschema::draft202012
Each module providesnew()
,is_valid()
, andoptions()
functions.
jsonschema::options()
function as a shortcut forjsonschema::Validator::options()
, that allows for customization of the validation process.
- Make
Debug
implementation forSchemaNode
opaque. - Make
jsonschema::validator_for
and related functions returnValidationError<'static>
in theirErr
variant. This change makes possible to use the?
operator to return errors from functions where the input schema is defined.
- Rename
CompilationOptions
toValidationOptions
for clarity. - Rename
JSONSchema
toValidator
for clarity. #424 - Rename
JSONPointer
toJsonPointer
for consistency with naming conventions. #424 - Rename
jsonschema::compile
tojsonschema::validator_for
. - Rename
CompilationOptions::compile
toValidationOptions::build
.
Old names are retained for backward compatibility but will be removed in a future release.
- Location-independent references in remote schemas on drafts 4, 6, and 7.
0.19.1 - 2024-09-15
ipv4
format validation. #512
0.19.0 - 2024-09-14
jsonschema::compile
shortcut.
- Bump MSRV to
1.70
.
uuid
format validation.- Combination of
unevaluatedProperties
withallOf
andoneOf
. #496
cli
feature in favor of a separatejsonschema-cli
crate.draft201909
anddraft202012
features. The relevant functionality is now enabled by default.
uuid
validation viauuid-simd
.
0.18.3 - 2024-09-12
- Changing base URI when
$ref
is present in drafts 7 and earlier. - Removed
dbg!
macro.
0.18.2 - 2024-09-11
- Ignoring
$schema
in resolved references. - Support integer-valued numbers for
maxItems
,maxLength
,maxProperties
,maxContains
,minItems
,minLength
,minProperties
,minContains
.
with_meta_schemas()
method. Meta schemas are included by default.
0.18.1 - 2024-08-24
ErrorDescription::into_inner
to retrieve the innerString
value.
0.18.0 - 2024-05-07
- Custom keywords support. #379
- Expose
JsonPointerNode
that can be converted intoJSONPointer
. This is needed for the upcoming custom validators support.
- Bump
base64
to0.22
. - Bump
clap
to4.5
. - Bump
fancy-regex
to0.13
. - Bump
fraction
to0.15
. - Bump
memchr
to2.7
. - Bump
once_cell
to1.19
. - Bump
percent-encoding
to2.3
. - Bump
regex
to1.10
. - Bump
url
to2.5
. - Build CLI only if the
cli
feature is enabled. - BREAKING: Extend
CompilationOptions
to support more ways to define custom format checkers (for example in Python bindings). In turn it changesValidationErrorKind::Format
to contain aString
instead of a&'static str
.
- Incorrect
schema_path
when multiple errors coming from the$ref
keyword #426
- Optimize building
JSONPointer
for validation errors by allocating the exact amount of memory needed. - Avoid cloning path segments during validation.
0.17.1 - 2023-07-05
- Improved error messages for
oneOf
/anyOf
keywords. #429
- Improper handling of subschema validation in
unevaluatedProperties
. #421
0.17.0 - 2023-03-16
- Bump
base64
to0.21
. - Bump
fancy-regex
to0.11
. - Bump
fraction
to0.13
. - Bump
iso8601
to0.6
. - Replace
lazy_static
withonce_cell
. - Add support for
unevaluatedProperties
. (gated by thedraft201909
/draft202012
feature flags). #288 - When using the draft 2019-09 or draft 2020-12 specification,
$ref
is now evaluated alongside other keywords. #378
0.16.1 - 2022-10-20
- Add a compilation option (
should_ignore_unknown_formats()
) that allows treating unknown formats as compilation errors.
0.16.0 - 2022-04-21
0.15.2 - 2022-04-10
- Allow HTTP(S) schema resolving with
rustls
. #353
0.15.1 - 2022-04-02
- Enable
reqwest/native-tls
by default to avoid validation errors caused byreqwest
missing a TLS backend. #343
0.15.0 - 2022-01-31
- The
SchemaResolver
trait to support resolving external schema references. #246 resolve-file
feature to resolve external schema files viastd::fs
. #76
- The
reqwest
feature was changed toresolve-http
. #341
- CLI: Use
serde::from_reader
instead ofserde::from_str
.
0.14.0 - 2022-01-23
- Bump
itoa
to1.0
. #337
- Optimize the loop implementation used for uniqueness check on short arrays.
- Simplify
equal_arrays
helper. - Shortcut for
false
schemas. - Reduce the number of generated LLVM lines.
- Do less work when resolving fragments.
- Avoid cloning the value when resolving empty fragments.
- Optimize searching by pointer in JSON documents.
0.13.3 - 2021-12-08
- Make
BasicOutput.is_valid
public.
- False positives in some cases when calling
JSONSchema.apply
on schemas withadditionalProperties
,patternProperties
, andproperties
combined. - False negatives in some cases when calling
JSONSchema.apply
on schemas withif
andthen
(withoutelse
) keywords. #318 - Panic in
JSONSchema.apply
on some schemas withprefixItems
anditems
. It panicked ifitems
is an object and the length ofprefixItems
is greater than the length of the input array.
- Remove unused private field in
JSONSchema
, that lead to improvement in the compilation performance. - Optimize the
multipleOf
implementation, which now can short-circuit in some cases. - Add special cases for arrays with 2 and 3 items in the
uniqueItems
keyword implementation. - Remove the
schema
argument from all methods of theValidate
trait.
0.13.2 - 2021-11-04
- Support for
prefixItems
keyword. #303 - Expose methods to examine
OutputUnit
.
0.13.1 - 2021-10-28
- Missing
derive
fromserde
.
0.13.0 - 2021-10-28
uuid
format validator. #266duration
format validator. #265- Collect annotations whilst evaluating schemas. #262
- Option to turn off processing of the
format
keyword. #261 basic
&flag
output formatting styles. #100- Support for
dependentRequired
&dependentSchemas
keywords. #286 - Forward
reqwest
features.
- INTERNAL. A new
Draft201909
variant for theDraft
enum that is available only under thedraft201909
feature. This feature is considered private and should not be used outside of the testing context. It allows us to add features from the 2019-09 Draft without exposing them in the public API. Therefore, support for this draft can be added incrementally. - The
Draft
enum is now marked asnon_exhaustive
. ValidationError::schema
was removed and the calls replaced by proper errors.
- Reduce the size of
PrimitiveTypesBitMapIterator
from 3 to 2 bytes. #282 - Use the
bytecount
crate formaxLength
&minLength
keywords, and for thehostname
format.
0.12.2 - 2021-10-21
- Display the original value in errors from
minimum
,maximum
,exclusiveMinimum
,exclusiveMaximum
. #215 - Switch from
chrono
totime==0.3.3
due to RUSTSEC-2020-0159 in oldertime
versions thatchrono
depends on.
0.12.1 - 2021-07-29
- Allow using empty arrays or arrays with non-unique elements for the
enum
keyword in schemas. #258 - Panic on incomplete escape sequences in regex patterns. #253
0.12.0 - 2021-07-24
- Support for custom
format
validators. #158
- Validators now implement
Display
instead ofToString
. JSONSchema
now owns its data. #145
0.11.0 - 2021-06-19
- Report schema paths in validation errors -
ValidationError.schema_path
. #199
- Incorrect encoding of
/
and~
characters infmt::Display
implementation forJSONPointer
. #233
0.10.0 - 2021-06-17
- BREAKING: Meta-schema validation for input schemas. By default, all input schemas are validated with their respective meta-schemas
and instead of
CompilationError
there will be the usualValidationError
. #198
CompilationError
. UseValidationError
instead.
0.9.1 - 2021-06-17
- The
format
validator incorrectly rejecting supported regex patterns. #230
0.9.0 - 2021-05-07
- Support for look-around patterns. #183
- Extend the
email
format validation. Relevant test case from the JSONSchema test suite -email.json
.
0.8.3 - 2021-05-05
paths::JSONPointer
implementsIntoIterator
overpaths::PathChunk
.
- Skipped validation on an unsupported regular expression in
patternProperties
. #213 - Missing
array
type in error messages fortype
validators containing multiple values. #216
0.8.2 - 2021-05-03
- Avoid some repetitive
String
allocations during validation. - Reduce the number of
RwLock.read()
calls in$ref
validators. - Shortcut in the
uniqueItems
validator for short arrays. additionalProperties
. Use vectors instead ofAHashMap
if the number of properties is small.- Special handling for single-item
required
validators. - Special handling for single-item
enum
validators. - Special handling for single-item
allOf
validators. - Special handling for single-item
patternProperties
validators without definedadditionalProperties
.
- Floating point overflow in the
multipleOf
validator. Relevant test case from the JSONSchema test suite -float_overflow.json
.
0.8.1 - 2021-04-30
- Avoid
String
allocation inJSONPointer.into_vec
. - Replace heap-allocated
InstancePath
with stack-only linked list.
0.8.0 - 2021-04-27
- The
propertyNames
validator now contains the parent object in itsinstance
attribute instead of individual properties as strings. - Improved error message for the
additionalProperties
validator. After -Additional properties are not allowed ('faz' was unexpected)
, before -False schema does not allow '"faz"'
. - The
additionalProperties
validator emits a single error for all unexpected properties instead of separate errors for each unexpected property. - Breaking:
ValidationError.instance_path
is now a separate struct, that can be transformed toVec<String>
or JSON Pointer of typeString
.
- All
instance_path
attributes are pointing to the proper location.
0.7.0 - 2021-04-27
ValidationError.instance_path
that shows the path to the erroneous part of the input instance. It has theVec<String>
type and contains components of the relevant JSON pointer.
- Make fields of
ValidationError
public. It allows the end-user to customize errors formatting.
- Reject IPv4 addresses with leading zeroes. As per the new test case in the JSONSchema test suite. More info
- Do not look for sub-schemas inside
const
andenum
keywords. Fixes an issue checked by these tests - Check all properties in the
required
keyword implementation. #190
- Not used
ValidationErrorKind::Unexpected
.
0.6.1 - 2021-03-26
- Incorrect handling of
\w
and\W
character groups inpattern
keywords. #180 - Incorrect handling of strings that contain escaped character groups (like
\\w
) inpattern
keywords.
0.6.0 - 2021-02-03
- Missing validation errors after the 1st one in
additionalProperties
validators.
- Do not use
rayon
initems
keyword as it gives significant overhead for a general case. - Avoid partially overlapping work in
additionalProperties
/properties
/patternProperties
validators. #173
0.5.0 - 2021-01-29
- Cache for documents loaded via the
$ref
keyword. #75 - Meta schemas for JSON Schema drafts 4, 6, and 7. #28
- Not necessary network requests for schemas with
$id
values with trailing#
symbol. #163
- Enum validation for input values that have a type that is not present among the enum variants. #80
-V
/--validator
options from the CLI. They were no-op and never worked.
0.4.3 - 2020-12-11
- Make examples in README.md runnable.
0.4.2 - 2020-12-11
- Move
paste
to dev dependencies.
- Number comparison for
enum
andconst
keywords. #149 - Do not accept
date
strings with single-digit month and day values. #151
- Some performance related changes were rolled back, due to increased complexity.
0.4.1 - 2020-12-09
- Integers not recognized as numbers when the
type
keyword is a list of multiple values. #147
0.4.0 - 2020-11-09
- Command Line Interface. #102
ToString
trait implementation for validators.- Define
JSONSchema::options
to customiseJSONSchema
compilation #131 - Allow user-defined
contentEncoding
andcontentMediaType
keywords
- ECMAScript regex support
- Formats should be associated to Draft versions (ie.
idn-hostname
is not defined on draft 4 and draft 6)
0.3.1 - 2020-06-21
- Enable Link-Time Optimizations and set
codegen-units
to 1. #104
items
allows the presence of boolean schemas. #115
0.3.0 - 2020-06-08
- JSONSchema Draft 4 support (except one optional case). #34
- CI builds. #35 and #36
- Implement specialized
is_valid
methods for all keywords. - Use
rayon
initems
keyword validation. - Various
clippy
lints. #66 Debug
implementation forJSONSchema
andResolver
. #97Default
implementation forDraft
.
- Do not pin dependencies. #90
- Use
to_string
instead offormat!
. #85 - Cache compiled validators in
$ref
keyword. #83 - Use bitmap for validation of multiple types in
type
keyword implementation. #78 - Return errors instead of unwrap in various locations. #73
- Improve debug representation of validators. #70
- Reduce the number of
match
statements during compilation functions resolving. - Use
expect
instead ofunwrap
for known cases when it is known that the code won't panic. - Add specialized validators for all
format
cases. - Reuse
DEFAULT_SCOPE
during reference resolving. - Replace some
Value::as_*
calls withif let
. - Inline all
compile
functions. - Optimize
format
keyword compilation by using static strings. - Optimize compilation of
true
,false
and$ref
validators. - Reuse parsed
DEFAULT_ROOT_URL
inJSONSchema::compile
. - Avoid string allocation during
scope
parsing inJSONSchema::compile
. - Refactor benchmark suite
- Use
BTreeSet
inadditionalProperties
keyword during compilation to reduce the amount of copied data. #91
- Wrong implementation of
is_valid
foradditionalProperties: false
keyword case. #61 - Possible panic due to type conversion in some numeric validators. #72
- Precision loss in
minimum
,maximum
,exclusiveMinimum
andexclusiveMaximum
validators. #84
0.2.0 - 2020-03-30
- Implement
is_valid
for various validators. - Implement
Error
andDisplay
forCompilationError
- Debug representation & error messages in various validators.
- Make
ErrorIterator
Sync
andSend
.
- Return
CompilationError
on invalid input schemas instead of panic.
- Initial public release