@astrale-os/kernel-dsl 0.2.0-beta.10 → 0.2.0-beta.12
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.
|
@@ -15,15 +15,13 @@ export function validateNodePathExtension(schema, context, pointer, definitionEx
|
|
|
15
15
|
const tokens = parseJsonPointerFragment(`#${location.pointer}`);
|
|
16
16
|
const fieldName = tokens?.length === 2 && tokens[0] === 'properties' ? tokens[1] : undefined;
|
|
17
17
|
const root = isJsonObject(schema) ? schema : undefined;
|
|
18
|
-
const
|
|
18
|
+
const directField = context === 'callable-input' &&
|
|
19
19
|
root?.type === 'object' &&
|
|
20
20
|
location.depth === 1 &&
|
|
21
21
|
location.parentKeyword === 'properties' &&
|
|
22
|
-
fieldName !== undefined
|
|
23
|
-
|
|
24
|
-
root.
|
|
25
|
-
if (!directRequiredField) {
|
|
26
|
-
diagnostics.push(diagnostic('VS_PATH_EXTENSION', extensionPointer, 'x-astrale-path is allowed only on a direct required property schema at a callable-input object root.'));
|
|
22
|
+
fieldName !== undefined;
|
|
23
|
+
if (!directField) {
|
|
24
|
+
diagnostics.push(diagnostic('VS_PATH_EXTENSION', extensionPointer, 'x-astrale-path is allowed only on a direct property schema at a callable-input object root.'));
|
|
27
25
|
}
|
|
28
26
|
const schemaKeys = Object.keys(location.schema);
|
|
29
27
|
if (schemaKeys.length !== 2 ||
|