@twin.org/data-core 0.0.1-next.7 → 0.0.1-next.9

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.
@@ -77,6 +77,10 @@ class JsonSchemaHelper {
77
77
  static async validate(schema, data, additionalTypes) {
78
78
  const ajv = new Ajv({
79
79
  allowUnionTypes: true,
80
+ // Disable strict tuples as it causes issues with the schema validation when
81
+ // you have an array with fixed elements e.g. myType: [string, ...string[]]
82
+ // https://github.com/ajv-validator/ajv/issues/1417
83
+ strictTuples: false,
80
84
  loadSchema: async (uri) => {
81
85
  const subTypeHandler = DataTypeHandlerFactory.getIfExists(uri);
82
86
  if (core.Is.function(subTypeHandler?.jsonSchema)) {
@@ -75,6 +75,10 @@ class JsonSchemaHelper {
75
75
  static async validate(schema, data, additionalTypes) {
76
76
  const ajv = new Ajv({
77
77
  allowUnionTypes: true,
78
+ // Disable strict tuples as it causes issues with the schema validation when
79
+ // you have an array with fixed elements e.g. myType: [string, ...string[]]
80
+ // https://github.com/ajv-validator/ajv/issues/1417
81
+ strictTuples: false,
78
82
  loadSchema: async (uri) => {
79
83
  const subTypeHandler = DataTypeHandlerFactory.getIfExists(uri);
80
84
  if (Is.function(subTypeHandler?.jsonSchema)) {
package/docs/changelog.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # @twin.org/data-core - Changelog
2
2
 
3
- ## v0.0.1-next.7
3
+ ## v0.0.1-next.9
4
4
 
5
5
  - Initial Release
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/data-core",
3
- "version": "0.0.1-next.7",
3
+ "version": "0.0.1-next.9",
4
4
  "description": "Definitions and helpers for using with data and schemas",
5
5
  "repository": {
6
6
  "type": "git",