Fix [object Object] request descriptions after OpenAPI import (#412)

This commit is contained in:
Gregory Schier
2026-02-27 15:36:46 -08:00
committed by GitHub
parent 37d0cabb22
commit 49053cb423
3 changed files with 80 additions and 10 deletions

View File

@@ -7,6 +7,29 @@ describe('importer-openapi', () => {
const p = path.join(__dirname, 'fixtures');
const fixtures = fs.readdirSync(p);
test('Maps operation description to request description', async () => {
const imported = await convertOpenApi(
JSON.stringify({
openapi: '3.0.0',
info: { title: 'Description Test', version: '1.0.0' },
paths: {
'/klanten': {
get: {
description: 'Lijst van klanten',
responses: { '200': { description: 'ok' } },
},
},
},
}),
);
expect(imported?.resources.httpRequests).toEqual([
expect.objectContaining({
description: 'Lijst van klanten',
}),
]);
});
test('Skips invalid file', async () => {
const imported = await convertOpenApi('{}');
expect(imported).toBeUndefined();