1
- import { loginPath , surveyPath , signUpPath , surveyResultPath } from './paths' ;
2
- import {
3
- badRequest ,
4
- serverError ,
5
- unanthorized ,
6
- notFound ,
7
- forbidden ,
8
- } from './components' ;
9
- import {
10
- loginParamsSchema ,
11
- errorSchema ,
12
- accountSchema ,
13
- surveyAnswerSchema ,
14
- surveySchema ,
15
- surveysSchema ,
16
- apiKeyAuthSchema ,
17
- signUpParamsSchema ,
18
- addSurveyAnswerSchema ,
19
- addSurveyParamsSchema ,
20
- saveSurveyParamsSchema ,
21
- surveyResultSchema ,
22
- } from './schemas' ;
1
+ import paths from './paths' ;
2
+ import components from './components' ;
3
+ import schemas from './schemas' ;
23
4
24
5
export default {
25
- openapi : '3.0.0' , // API version
6
+ openapi : '3.0.0' , // Swagger API version
26
7
info : {
27
8
title : 'Clean Node API' ,
28
9
description :
@@ -39,34 +20,7 @@ export default {
39
20
} ,
40
21
servers : [ { url : '/api' } ] , // Paths URL
41
22
tags : [ { name : 'Login' } , { name : 'Survey' } ] , // Query titles
42
- paths : {
43
- // API routes
44
- '/login' : loginPath ,
45
- '/signup' : signUpPath ,
46
- '/surveys' : surveyPath ,
47
- '/surveys/{surveyId}/results' : surveyResultPath ,
48
- } ,
49
- schemas : {
50
- account : accountSchema ,
51
- loginParams : loginParamsSchema ,
52
- signUpParams : signUpParamsSchema ,
53
- error : errorSchema ,
54
- survey : surveySchema ,
55
- surveys : surveysSchema ,
56
- surveyAnswer : surveyAnswerSchema ,
57
- addSurveyAnswer : addSurveyAnswerSchema ,
58
- addSurveyParams : addSurveyParamsSchema ,
59
- saveSurveyParams : saveSurveyParamsSchema ,
60
- surveyResult : surveyResultSchema ,
61
- } ,
62
- components : {
63
- securitySchemes : {
64
- apiKeyAuth : apiKeyAuthSchema ,
65
- } ,
66
- badRequest,
67
- serverError,
68
- unanthorized,
69
- notFound,
70
- forbidden,
71
- } ,
23
+ paths,
24
+ schemas,
25
+ components,
72
26
} ;
0 commit comments