-
Notifications
You must be signed in to change notification settings - Fork 33
Open
Description
If you have an operation schema that somewhere deep inside contains a $ref
to another operation then when you reduce that operation it won't carry along the referenced operation, resulting in a corrupted schema.
For example:
Reducing GET /anything
in this case will exclude POST /anything
, resulting in a corrupted schema for GET /anything
.
There is a broken and skipped test for this use case now in
oas/packages/oas/test/reducer/index.test.ts
Lines 185 to 195 in b373f99
/** | |
* @see RM-10597 | |
*/ | |
// eslint-disable-next-line vitest/no-disabled-tests | |
it.skip('should preserve required data in a circular definition', async () => { | |
const circular = new Oas(circularPathSchema as OASDocument); | |
await circular.dereference(); | |
const reduced = reducer(circular.api as any, { paths: { '/anything': ['get'] } }); | |
expect(Object.keys(reduced.paths['/anything'])).toStrictEqual(['get', 'post']); | |
}); |
Metadata
Metadata
Assignees
Labels
No labels