mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-06-18 10:06:26 +00:00
Openapi Schema improvements
- Return proper booleans in api responses - Update jsonschemavalidation to latest draft
This commit is contained in:
16
backend/validate-schema.js
Normal file
16
backend/validate-schema.js
Normal file
@ -0,0 +1,16 @@
|
||||
const SwaggerParser = require('@apidevtools/swagger-parser');
|
||||
const chalk = require('chalk');
|
||||
const schema = require('./schema');
|
||||
const log = console.log;
|
||||
|
||||
schema.getCompiledSchema().then(async (swaggerJSON) => {
|
||||
try {
|
||||
const api = await SwaggerParser.validate(swaggerJSON);
|
||||
console.log('API name: %s, Version: %s', api.info.title, api.info.version);
|
||||
log(chalk.green('❯ Schema is valid'));
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
log(chalk.red('❯', e.message), '\n');
|
||||
process.exit(1);
|
||||
}
|
||||
});
|
Reference in New Issue
Block a user