|
|
@ -2649,6 +2649,7 @@ export class RestApiBuilder extends BaseApiBuilder<Noco> { |
|
|
|
scheme, |
|
|
|
scheme, |
|
|
|
scheme === 'http' ? 'https' : 'http', |
|
|
|
scheme === 'http' ? 'https' : 'http', |
|
|
|
]; |
|
|
|
]; |
|
|
|
|
|
|
|
( |
|
|
|
await promisify(glob)( |
|
|
|
await promisify(glob)( |
|
|
|
path.join( |
|
|
|
path.join( |
|
|
|
this.app.getToolDir(), |
|
|
|
this.app.getToolDir(), |
|
|
@ -2659,14 +2660,13 @@ export class RestApiBuilder extends BaseApiBuilder<Noco> { |
|
|
|
'swagger.json' |
|
|
|
'swagger.json' |
|
|
|
) |
|
|
|
) |
|
|
|
) |
|
|
|
) |
|
|
|
.forEach(async (jsonFile) => { |
|
|
|
).forEach(async (jsonFile) => { |
|
|
|
const swaggerJson = JSON.parse(await promisify(fs.readFile)(jsonFile, 'utf8')); |
|
|
|
const swaggerJson = JSON.parse( |
|
|
|
|
|
|
|
await promisify(fs.readFile)(jsonFile, 'utf8') |
|
|
|
|
|
|
|
); |
|
|
|
swaggerBaseDocument.tags.push(...swaggerJson.tags); |
|
|
|
swaggerBaseDocument.tags.push(...swaggerJson.tags); |
|
|
|
Object.assign(swaggerBaseDocument.paths, swaggerJson.paths); |
|
|
|
Object.assign(swaggerBaseDocument.paths, swaggerJson.paths); |
|
|
|
Object.assign( |
|
|
|
Object.assign(swaggerBaseDocument.definitions, swaggerJson.definitions); |
|
|
|
swaggerBaseDocument.definitions, |
|
|
|
|
|
|
|
swaggerJson.definitions |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
res.json(swaggerBaseDocument); |
|
|
|
res.json(swaggerBaseDocument); |
|
|
|
}); |
|
|
|
}); |
|
|
@ -2729,7 +2729,10 @@ export class RestApiBuilder extends BaseApiBuilder<Noco> { |
|
|
|
'swagger' |
|
|
|
'swagger' |
|
|
|
); |
|
|
|
); |
|
|
|
const swaggerJson = JSON.parse( |
|
|
|
const swaggerJson = JSON.parse( |
|
|
|
await promisify(fs.readFile)(path.join(swaggerFilePath, 'swagger.json'), 'utf8') |
|
|
|
await promisify(fs.readFile)( |
|
|
|
|
|
|
|
path.join(swaggerFilePath, 'swagger.json'), |
|
|
|
|
|
|
|
'utf8' |
|
|
|
|
|
|
|
) |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
/* remove tags, paths and keys */ |
|
|
|
/* remove tags, paths and keys */ |
|
|
|