feat(api): add react-query client generation and redesign api responses

This commit is contained in:
Dominik 2025-06-12 19:47:05 +02:00
parent 6c9569ae40
commit 3a0ce64c00
Signed by: dominik
GPG key ID: 06A4003FC5049644
12 changed files with 2026 additions and 119 deletions

View file

@ -1,61 +1,8 @@
import { createSwaggerSpec } from 'next-swagger-doc';
import swaggerConfig from '../../next-swagger-doc.json';
export const getApiDocs = async () => {
const spec = createSwaggerSpec({
apiFolder: 'src/app/api',
definition: {
openapi: '3.0.0',
info: {
title: 'MeetUP API',
version: '1.0',
},
// components: {
// securitySchemes: {
// BearerAuth: {
// type: "http",
// scheme: "bearer",
// bearerFormat: "JWT",
// },
// },
// },
components:{
schemas: {
ErrorResponse: {
type: 'object',
properties: {
message: {
type: 'string',
description: 'Error message',
},
},
},
User: {
type: 'object',
properties: {
id: { type: 'string' },
name: { type: 'string' },
first_name: { type: 'string' },
last_name: { type: 'string' },
email: { type: 'string', format: 'email' },
image: { type: 'string', format: 'uri' },
timezone: { type: 'string', description: 'User timezone' },
},
},
PublicUser: {
type: 'object',
properties: {
id: { type: 'string' },
name: { type: 'string' },
first_name: { type: 'string' },
last_name: { type: 'string' },
image: { type: 'string', format: 'uri' },
timezone: { type: 'string', description: 'User timezone' },
},
},
},
},
security: [],
},
});
const spec = createSwaggerSpec(swaggerConfig);
return spec;
};