S7schema (development version)
Updated bundled JavaScript dependencies in
inst/bundle.js:fast-uri3.1.8 → 3.1.9 (#94).Updated bundled JavaScript dependencies in
inst/bundle.js:ajv8.18.0 → 8.20.0 (#93).Errors from
oneOfschemas now show only the relevant error: branches that do not match the value’s type are left out, and a single remaining error is shown with its own path and value (#88).Validators are cached by schema content and shared between objects, so validate() no longer rebuilds the validator on every call (#81, #78).
Errors from
S7schema(.data =)and missing files now reference the user’s call instead of internal functions (#77).Errors from
validate(),write_config(),@<-andS7::set_props()now reference the user’s call instead of internal functions (#90).to_yaml()andwrite_config()writePOSIXctandPOSIXltvalues as ISO 8601 strings in UTC (2025-08-06T08:00:00Z) instead of the number of seconds since 1970-01-01, so they are validated as strings inS7schemaobjects (#75).
S7schema 0.2.0
CRAN release: 2026-10-16
- Validation now checks the data that R reads (#70, #67). Files are validated as
yaml::read_yaml()reads them,S7schemaobjects aswrite_config()writes them and R reads them back, andlistobjects invalidate_list()as they are. Previously the YAML was parsed again by a JavaScript parser, which could read values differently. This changes some validation results:- Unquoted
y,n,yes,no,on, andoffin lowercase, title case, or uppercase (e.g.Yes,YES) are logical values. This also applies to map keys:y:is read as the key"TRUE"andn:as"FALSE". Quote them to keep them as strings. - Unquoted dates such as
2025-08-06and values such as1e3,0o17, and0b101are strings. - Merge keys (
<<: *anchor) resolve as in R: a key from the merged mapping wins over the same key set next to<<. - One-item sequences such as
[a]in files andS7schemaobjects are single values. UseoneOfin the schema for fields that can hold one or more values. -
NA,NaN, andInfare validated asnull. Allownullin the schema for fields that may be missing. -
Datevalues inlistandS7schemaobjects are validated as strings. - Numbers in files and lists are validated exactly. Numbers in
S7schemaobjects are validated aswrite_config()writes them, which rounds numbers that need 17 significant digits, such as0.1 + 0.2. - The current value in error messages is the value as R reads it.
- Unquoted
-
to_yaml()andwrite_config():- Logical
NAis written as.na, so R reads it back asNA. Previously it was written asNA, which R read back as the string"NA". -
Datevalues are written as ISO 8601 strings (2025-08-06) instead of the number of days since 1970-01-01. - Numbers are written with a precision of 15 instead of 7, so numbers with up to 16 significant digits are read back as the same value.
- Logical
-
validate_yaml()andS7schema()no longer warn when a YAML file has no final newline. -
jsonliteis now a required dependency, andjs-yamlis no longer bundled. - Uses ‘QuickJSR’ instead of ‘V8’ to run ‘ajv’, so the ‘V8’ system library is no longer needed (#56). The bundled
fast-uriis updated to 3.1.8, which has security fixes. - An invalid JSON schema now gives a short error with the schema file and the reason, instead of a JavaScript stack trace.
S7schema 0.1.2
CRAN release: 2026-08-21
- Validation error messages now include the current value that failed validation (#63).
- Now possible to create a
S7schema()object in memory using the new.dataargument (#62). - Rebundled
inst/bundle.jswith updated JavaScript dependencies:ajv8.17.1 → 8.18.0,js-yaml4.1.0 → 4.3.1, andfast-uri→ 3.1.5.
S7schema 0.1.1
CRAN release: 2026-05-09
- Fixed
write_config()to useNULLas the default for the output path instead ofx@file, and renamed thefileargument topath(#48).
