-
Notifications
You must be signed in to change notification settings - Fork 0
/
kubb.config.ts
37 lines (36 loc) · 1.21 KB
/
kubb.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { defineConfig } from '@kubb/core';
import { definePlugin as createSwagger } from '@kubb/swagger';
import { definePlugin as createSwaggerClient } from '@kubb/swagger-client';
import { definePlugin as createSwaggerZod } from '@kubb/swagger-zod';
import { templates } from './src/templates/client';
export default defineConfig(async () => ({
root: '.',
input: {
data: await fetch(
'https://github.com/googlemaps/openapi-specification/releases/latest/download/google-maps-platform-openapi3.yml'
).then(response => response.text()),
},
output: {
path: 'src/generated',
clean: true,
},
plugins: [
createSwagger({ output: false }),
createSwaggerZod({
dateType: 'date',
unknownType: 'unknown',
output: { exportType: false, path: './schema' },
templates: {
operations: false,
},
}),
createSwaggerClient({
output: { exportType: false, path: './zod-fetch' },
group: { type: 'tag', output: 'zod-fetch/{{tag}}' },
templates: {
client: templates,
operations: false,
},
}),
],
}));