Skip to content
Open
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
18 changes: 18 additions & 0 deletions app/frontend/test/openapi-types.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import createClient from 'openapi-fetch';
import type { paths } from '../src/lib/generated/api';

describe('OpenAPI Generated Client Types', () => {
it('should compile with the generated paths interface', () => {
// This is purely a type-level test to ensure openapi-fetch
// and the generated openapi-typescript types are compatible.
const client = createClient<paths>({ baseUrl: 'http://localhost' });

// Assert the client is created and has the expected HTTP methods
expect(client).toBeDefined();
expect(typeof client.GET).toBe('function');
expect(typeof client.POST).toBe('function');
expect(typeof client.PUT).toBe('function');
expect(typeof client.DELETE).toBe('function');
expect(typeof client.PATCH).toBe('function');
});
});