Adds API docs annotations & generator (#927)
* initial commit * fixes category api route * fixes follow api routes --------- Co-authored-by: Christian Beutel <>
This commit is contained in:
@@ -1,10 +1,22 @@
|
||||
import tailwindcss from '@tailwindcss/vite';
|
||||
import { sveltekit } from '@sveltejs/kit/vite';
|
||||
import { defineConfig } from 'vitest/config';
|
||||
import openapiPlugin from 'sveltekit-openapi-generator';
|
||||
import fs from 'fs';
|
||||
|
||||
const packageJson = JSON.parse(fs.readFileSync('./package.json', 'utf-8'));
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [tailwindcss(), sveltekit()],
|
||||
plugins: [openapiPlugin({
|
||||
info: {
|
||||
title: 'Wanderer API',
|
||||
version: `${packageJson.version}`,
|
||||
description: 'API documentation for wanderer backend',
|
||||
},
|
||||
outputPath: 'static/docs/api/wanderer.openapi.json',
|
||||
include: ['src/routes/api/v1/**/*.{js,ts}'],
|
||||
baseSchemasPath: 'src/lib/models/api/openapi_schemas.ts',
|
||||
}),tailwindcss(), sveltekit()],
|
||||
test: { include: ['src/**/*.{test,spec}.{js,ts}'] },
|
||||
ssr: { noExternal: ['three'] },
|
||||
...(process.env.WANDERER_ENV == "dev" ? {
|
||||
|
||||
Reference in New Issue
Block a user