Skip to content

Commit 9ba4565

Browse files
authored
Merge pull request #8 from hey-api/fix/extended-ref-equality
fix: extended equality check
2 parents dbde5d1 + f0a4310 commit 9ba4565

File tree

6 files changed

+251
-124
lines changed

6 files changed

+251
-124
lines changed

lib/__tests__/bundle.test.ts

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import path from 'node:path';
2+
3+
import { describe, expect, it } from 'vitest';
4+
5+
import { $RefParser } from '..';
6+
7+
describe('bundle', () => {
8+
it('handles circular reference with description', async () => {
9+
const refParser = new $RefParser();
10+
const pathOrUrlOrSchema = path.resolve('lib', '__tests__', 'spec', 'circular-ref-with-description.json');
11+
const schema = await refParser.bundle({ pathOrUrlOrSchema });
12+
expect(schema).not.toBeUndefined();
13+
});
14+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"schemas": {
3+
"Foo": {
4+
"$ref": "#/schemas/Bar"
5+
},
6+
"Bar": {
7+
"description": "ok",
8+
"$ref": "#/schemas/Foo"
9+
}
10+
}
11+
}

0 commit comments

Comments
 (0)