json-schema-library 10.2.0 → 10.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -561,7 +561,7 @@ const data = compileSchema({
561
561
  console.log(data); // {}
562
562
  ```
563
563
 
564
- _Note_ object and array-properties will still be added if required:
564
+ **Note** object and array-properties will still be added if required:
565
565
 
566
566
  ```ts
567
567
  const data = compileSchema({
@@ -571,7 +571,7 @@ const data = compileSchema({
571
571
  console.log(data); // { valid: {} }
572
572
  ```
573
573
 
574
- _Note_ enforced array-items will be `undefined` if required and `initialValues: false`
574
+ **Note** enforced array-items will be `undefined` if required and `initialValues: false`
575
575
 
576
576
  ```ts
577
577
  const data = compileSchema({
@@ -1336,8 +1336,38 @@ const { errors } = compileSchema({
1336
1336
  assert.deepEqual(errors[0].message, "Custom error 2");
1337
1337
  ```
1338
1338
 
1339
+ ### regexFlags
1340
+
1341
+ In order to allow customization of regular expressions a schema property `regexFlags` is supported for `pattern`, `patternProperties` and format `regex`:
1342
+
1343
+ ```ts
1344
+ const { errors } = compileSchema({
1345
+ type: "string",
1346
+ pattern: "^[a-zA-Z0-9+_.-]+",
1347
+ regexFlags: "v"
1348
+ }).validate("-");
1349
+ ```
1350
+
1351
+ Per default, a regexFlags `"u"` is used. To change this setting globally, change `REGEX_FLAGS` in settings:
1352
+
1353
+ ```ts
1354
+ import settings from "json-schema-library";
1355
+
1356
+ settings.REGEX_FLAGS = "v";
1357
+ ```
1358
+
1339
1359
  ## Breaking Changes
1340
1360
 
1361
+ ### v10.3.0
1362
+
1363
+ - introduce setting `REGEX_FLAGS` and schema-property `regexFlags` to customize regex flags to use evaluating regex
1364
+ - fixed an issue resolving non-URI compatible $ref-targets containing `#/definitions`
1365
+
1366
+ ### v10.2.0
1367
+
1368
+ - introduce getData setting `useTypeDefaults`
1369
+ - introduce support to merge meta-properties using $ref-resolution
1370
+
1341
1371
  ### v10.1.0
1342
1372
 
1343
1373
  - replaced `node.additionalItems` by `node.items` for drafts below 2020-12