Skip to content

Commit 7971770

Browse files
authored
fix validation of sub schema with $ref when top level schema has no $id (#730)
1 parent b22c90f commit 7971770

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

meta_configurator/src/schema/validationService.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import Ajv2019 from 'ajv/dist/2019';
1515
* It also supports validating against sub schemas of the top level schema.
1616
*/
1717
export class ValidationService {
18-
static readonly TOP_LEVEL_SCHEMA_KEY = '$topLevelSchema';
18+
static readonly TOP_LEVEL_SCHEMA_KEY = 'topLevelSchema';
1919

2020
topLevelSchema: TopLevelSchema;
2121
private _ajv: Ajv2020 | Ajv2019 | Ajv | undefined;
@@ -107,7 +107,7 @@ export class ValidationService {
107107
}
108108

109109
if (result.$ref !== undefined) {
110-
result.$ref = this.topLevelSchema.$id + result.$ref;
110+
result.$ref = this.topLevelSchemaId + result.$ref;
111111
}
112112

113113
if (result.if) {

0 commit comments

Comments
 (0)