Skip to content

Commit 5a0e8bb

Browse files
fix: calculate correct postion for elements when parsing (#512)
Signed-off-by: Fredrik Nordlander <fredrik.nordlander@digg.se>
1 parent 70cc689 commit 5a0e8bb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/routes/validate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ export const registerValidationRoutes = (app: Express) => {
147147

148148
// 5. No strict-errors → run raplp ruleengine
149149
const parser: IParser<any> = (parseResult.format === 'json' ? Parsers.Json : Parsers.Yaml) as unknown as IParser<any>;
150-
const apiSpecDocument = new Document(parseResult.raw, parser, '');
150+
const apiSpecDocument = new Document(parseResult.raw, parser, 'payload.yaml'); // In-memory-file to calculate correct positions when parsing
151151
const rules = await importAndCreateRuleInstances(context, categories);
152152
const result = await processApiSpec(context, rules, apiSpecDocument);
153153

0 commit comments

Comments
 (0)