-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathfilter.js
39 lines (37 loc) · 980 Bytes
/
filter.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
const swaggerCombine = require('../src');
const config = (module.exports = {
swagger: '2.0',
info: {
title: 'Swagger Combine Filter Example',
version: {
$ref: './package.json#/version',
},
},
apis: [
{
url: 'http://petstore.swagger.io/v2/swagger.json',
paths: {
exclude: ['/pet/{petId}', '/pet.put'],
parameters: {
exclude: {
'/pet/findByStatus': 'status',
},
},
},
},
{
url: 'https://api.apis.guru/v2/specs/medium.com/1.0.0/swagger.yaml',
paths: {
include: ['/users/{userId}/publications', '/publications/{publicationId}/posts', '/me.get'],
parameters: {
include: {
'/publications/{publicationId}/posts.post': 'publicationId',
},
},
},
},
],
});
if (!module.parent) {
swaggerCombine(config).then(res => console.log(JSON.stringify(res, false, 2))).catch(err => console.error(err));
}