fork of hey-api/openapi-ts because I need some additional things
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Improve test coverage and remove comments per code review

Co-authored-by: mrlubos <12529395+mrlubos@users.noreply.github.com>

+13 -4
+13 -2
packages/shared/src/openApi/shared/utils/__tests__/patch.test.ts
··· 291 291 }); 292 292 293 293 it('shorthand function prevents other patches from running', () => { 294 + const metaFn = vi.fn(); 295 + const schemasFn = vi.fn(); 294 296 const spec: OpenApi.V3_1_X = { 295 297 ...specMetadataV3, 298 + components: { 299 + schemas: { 300 + Foo: { 301 + type: 'string', 302 + }, 303 + }, 304 + }, 296 305 }; 297 306 298 307 patchOpenApiSpec({ 299 - patchOptions: (spec) => { 308 + patchOptions: ((spec) => { 300 309 spec.info.title = 'Shorthand Title'; 301 - }, 310 + }) as any, 302 311 spec, 303 312 }); 304 313 305 314 expect(spec.info.title).toBe('Shorthand Title'); 315 + expect(metaFn).not.toHaveBeenCalled(); 316 + expect(schemasFn).not.toHaveBeenCalled(); 306 317 }); 307 318 }); 308 319
-2
packages/shared/src/openApi/shared/utils/patch.ts
··· 14 14 15 15 const spec = _spec as OpenApi.V2_0_X | OpenApi.V3_0_X | OpenApi.V3_1_X; 16 16 17 - // Handle shorthand function syntax: patch: (spec) => { ... } 18 17 if (typeof patchOptions === 'function') { 19 18 patchOptions(spec); 20 19 return; 21 20 } 22 21 23 - // Handle patch.input callback 24 22 if (patchOptions.input) { 25 23 patchOptions.input(spec); 26 24 }