import { describe, expect, it } from 'vitest'; import { generateTypes } from './generate-openapi-types.mjs'; describe('generate-openapi-types', () => { it('emits only schemas and ignores non-operation path item keys', () => { const output = generateTypes({ components: { schemas: { ProblemDetails: { properties: { detail: { type: 'string' } }, type: 'object' } } }, paths: { '/api/items/{id}': { parameters: [ { in: 'path', name: 'id', schema: { type: 'integer' } } ], get: { operationId: 'GetItem', responses: { 200: { content: { 'application/json': { schema: { $ref: '#/components/schemas/ProblemDetails' } } } } } } } } }); expect(output).toContain('export interface components'); expect(output).toContain('"ProblemDetails"'); expect(output).not.toContain('export interface operations'); expect(output).not.toContain('"parameters"'); }); });