File tree 2 files changed +14
-1
lines changed
2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,8 @@ Configure {swagger-express} as express middleware.
28
28
29
29
` basePath ` -> The basePath for swagger.js
30
30
31
+ ` info ` -> [ Metadata] [ info ] about the API
32
+
31
33
` apis ` -> Define your api array.
32
34
33
35
` middleware ` -> Function before response.
@@ -44,13 +46,20 @@ app.configure(function(){
44
46
swaggerJSON: '/api-docs.json',
45
47
swaggerUI: './public/swagger/',
46
48
basePath: 'http://localhost:3000',
49
+ info: {
50
+ title: 'swagger-express sample app',
51
+ description: 'Swagger + Express = {swagger-express}'
52
+ },
47
53
apis: ['./api.js', './api.yml'],
48
54
middleware: function(req, res){}
49
55
}));
50
56
app.use(app.router);
51
57
...
52
58
});
53
- ```
59
+ ```
60
+
61
+ [ info ] : https://github.com/wordnik/swagger-spec/blob/master/versions/1.2.md#513-info-object
62
+
54
63
## Read from jsdoc
55
64
56
65
Example 'api.js'
Original file line number Diff line number Diff line change @@ -235,6 +235,10 @@ function generate(opt) {
235
235
descriptor . swaggerJSON = ( opt . swaggerJSON ) ? opt . swaggerJSON : '/api-docs.json' ;
236
236
descriptor . apis = [ ] ;
237
237
238
+ if ( opt . info ) {
239
+ descriptor . info = opt . info ;
240
+ }
241
+
238
242
opt . apiVersion = descriptor . apiVersion ;
239
243
opt . swaggerVersion = descriptor . swaggerVersion ;
240
244
opt . swaggerURL = descriptor . swaggerURL ;
You can’t perform that action at this time.
0 commit comments