-
Notifications
You must be signed in to change notification settings - Fork 2
/
exampleUseOA3.js
36 lines (33 loc) · 968 Bytes
/
exampleUseOA3.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
const SwaggerChunk = require('./es5/SwaggerChunk.js')
const chunk = new SwaggerChunk({
input: './srcOA3/index.yml',
})
const uniqueOperationIds = require('./es5/UniqueOperationIds')
const program = {
make_unique_operation_ids: true,
strip_value: 'srcOA3/paths/',
input: './srcOA3/index.yml',
}
const UniqueOperationIds = new uniqueOperationIds(program)
UniqueOperationIds
.listAndInject()
.then(() => {
console.log('Building yaml')
chunk
.toYamlFile('./build', 'builtOA3')
.then(() => {
chunk
.toYamlFile()
.then(() => {
console.log('Building json')
chunk
.toJsonFile('./build', 'builtOA3')
.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)
})