© 2026 Hedgehog Software, LLC
api/routes/api/v1/+swagger.js
import swagger from '@fastify/swagger'; import swaggerUI from '@fastify/swagger-ui'; export default async function (server) { await server.register(swagger, { openapi: { info: { title: 'Stock Monitor API', description: 'API documentation for Stock Monitor merchant API', version: '1.0.0' }, tags: [ { name: 'Test', description: 'Test endpoints' }, { name: 'Products', description: 'Product related endpoints' } ], components: { securitySchemes: { apiKey: { type: 'apiKey', name: 'x-api-key', in: 'header' }, shopId: { type: 'apiKey', name: 'x-shop-id', in: 'header' } } } } }); await server.register(swaggerUI, { routePrefix: '/api/v1/docs', uiConfig: { docExpansion: 'list', deepLinking: false }, staticCSP: true }); }