-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/swagger-routes' into develop
- Loading branch information
Showing
5 changed files
with
140 additions
and
45 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,37 @@ | ||
import swaggerJSDoc from 'swagger-jsdoc'; | ||
|
||
export const swaggerConfig: swaggerJSDoc.OAS3Options = { | ||
swaggerDefinition: { | ||
export const swaggerConfig: swaggerJSDoc.Options = { | ||
definition: { | ||
openapi: '3.0.0', | ||
info: { | ||
title: 'Civitas API', | ||
description: 'Documentação da API do projeto Civitas', | ||
version: '1.0.0' | ||
}, | ||
host: 'localhost:4444', | ||
// Não obrigatório, serve apenas para definir a ordem das categorias | ||
tags: [], | ||
servers: [ | ||
{ | ||
url: 'http://localhost:4444', // URL do servidor de desenvolvimento | ||
description: 'Servidor Local' | ||
} | ||
], | ||
externalDocs: { | ||
description: 'View swagger.json', | ||
url: '../swagger.json' | ||
description: 'Swagger JSON', | ||
url: '../swagger.json' // Confirme se esse caminho é acessível | ||
}, | ||
components: { | ||
securitySchemes: { | ||
BearerAuth: { | ||
in: 'header', | ||
type: 'http', | ||
scheme: 'bearer' | ||
scheme: 'bearer', | ||
bearerFormat: 'JWT' // Especifique que o formato esperado é JWT | ||
} | ||
} | ||
} | ||
}, | ||
security: [ | ||
{ | ||
BearerAuth: [] // Aplica a autenticação BearerAuth globalmente (se necessário) | ||
} | ||
] | ||
}, | ||
apis: ['src/routes/*.ts', 'routes/*.js'] | ||
apis: ['src/routes/*.ts', 'routes/*.js'] // Caminhos para buscar as rotas | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters