-
Notifications
You must be signed in to change notification settings - Fork 2
/
exampleUseOA2.js
34 lines (32 loc) · 934 Bytes
/
exampleUseOA2.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
const SwaggerChunk = require('./es5/SwaggerChunk.js')
const chunk = new SwaggerChunk({
input: './srcOA2/index.yml',
})
const uniqueOperationIds = require('./es5/UniqueOperationIds')
const program = {
make_unique_operation_ids: true,
strip_value: 'srcOA2/paths/',
input: './srcOA2/index.yml',
}
const UniqueOperationIds = new uniqueOperationIds(program)
UniqueOperationIds
.listAndInject()
.then(() => {
chunk
.toYamlFile('./build', 'builtOA2')
.then(() => {
chunk
.toYamlFile()
.then(() => {
console.log('Building json')
chunk
.toJsonFile('./build', 'builtOA2')
.then(() => {
chunk.toJsonFile()
}).catch(e => console.error(e))
}).catch(e => console.error(e))
}).catch(e => console.error(e))
})
.catch(e => {
console.error('Error injecting uniqueOperationIds: ', e)
})