Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions lib/__tests__/bundle.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import path from 'node:path';

import { describe, expect, it } from 'vitest';

import { $RefParser } from '..';

describe('bundle', () => {
it('handles circular reference with description', async () => {
const refParser = new $RefParser();
const pathOrUrlOrSchema = path.resolve('lib', '__tests__', 'spec', 'circular-ref-with-description.json');
const schema = await refParser.bundle({ pathOrUrlOrSchema });
expect(schema).not.toBeUndefined();
});
});
11 changes: 11 additions & 0 deletions lib/__tests__/spec/circular-ref-with-description.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"schemas": {
"Foo": {
"$ref": "#/schemas/Bar"
},
"Bar": {
"description": "ok",
"$ref": "#/schemas/Foo"
}
}
}
Loading