@json-layout/core 0.21.0 → 0.21.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@json-layout/core",
3
- "version": "0.21.0",
3
+ "version": "0.21.1",
4
4
  "description": "Compilation and state management utilities for JSON Layout.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -150,13 +150,6 @@ export function makeSkeletonNode (
150
150
  undefined,
151
151
  dependent
152
152
  ))
153
- if (schema?.required?.includes(propertyKey)) {
154
- schema.errorMessage.required = schema.errorMessage.required ?? {}
155
- schema.errorMessage.required[propertyKey] = options.messages.errorRequired
156
- }
157
- if (schema.dependentRequired && Object.keys(schema.dependentRequired).includes(propertyKey)) {
158
- schema.errorMessage.dependentRequired = options.messages.errorRequired
159
- }
160
153
 
161
154
  if (schema.dependentSchemas?.[propertyKey] || (schema.dependencies?.[propertyKey] && !Array.isArray(schema.dependencies[propertyKey]))) {
162
155
  const dependentSchema = schema.dependentSchemas?.[propertyKey] ?? schema.dependencies[propertyKey]
@@ -290,6 +283,16 @@ export function makeSkeletonNode (
290
283
  ))
291
284
  }
292
285
  }
286
+
287
+ for (const propertyKey of node.propertyKeys) {
288
+ if (schema?.required?.includes(propertyKey)) {
289
+ schema.errorMessage.required = schema.errorMessage.required ?? {}
290
+ schema.errorMessage.required[propertyKey] = options.messages.errorRequired
291
+ }
292
+ if (schema.dependentRequired && Object.keys(schema.dependentRequired).includes(propertyKey)) {
293
+ schema.errorMessage.dependentRequired = options.messages.errorRequired
294
+ }
295
+ }
293
296
  }
294
297
 
295
298
  if (type === 'array' && schema.items) {