Skip to content

Commit

Permalink
fix: rescursive target resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
sagold committed Apr 12, 2024
1 parent 44f0c95 commit 10d49f5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 3 additions & 1 deletion lib/resolveRef.merge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ import { mergeSchema } from "./mergeSchema";

function resolveRecursiveRef(node: SchemaNode): SchemaNode {
const history = node.path;

// console.log(...history);
// RESTRICT BY CHANGE IN BASE-URL
let startIndex = 0;
for (let i = history.length - 1; i >= 0; i--) {
if (history[i].$id && /^https?:\/\//.test(history[i].$id)) {
if (history[i].$id && /^https?:\/\//.test(history[i].$id) && history[i].$recursiveAnchor !== true) {
startIndex = i;
break;
}
Expand Down
3 changes: 0 additions & 3 deletions test/spec/v2019-09/draft2019-09.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,6 @@ const postponedTestcases = [
// @todo when recursiveRef is implemented
"unevaluatedProperties with $recursiveRef",
"unevaluatedItems with $recursiveRef",
// @todo validate $def-syntax against metaschema
"validate definition against metaschema",
// @vocabulary
// @todo evaluate support by meta-schema
// we need to evaluate meta-schema for supported validation methods we currently do not have the logic for this
Expand All @@ -117,7 +115,6 @@ const postponedTestcases = [
"collect annotations inside a 'not', even if collection is disabled" // not
];


function runTestCase(tc: FeatureTest, skipTest: string[] = []) {
describe(`${tc.name}${tc.optional ? " (optional)" : ""}`, () => {
tc.testCases.forEach((testCase) => {
Expand Down

0 comments on commit 10d49f5

Please sign in to comment.