Openapi Schema improvements

- Return proper booleans in api responses
- Update jsonschemavalidation to latest draft
This commit is contained in:
Jamie Curnow
2024-10-10 15:53:11 +10:00
parent dfe2588523
commit 4572b205c9
69 changed files with 862 additions and 2082 deletions

View File

@ -14,7 +14,7 @@ describe('Basic API checks', () => {
cy.task('backendApiGet', {
path: '/api/schema',
}).then((data) => {
expect(data.openapi).to.be.equal('3.0.0');
expect(data.openapi).to.be.equal('3.1.0');
});
});
});

View File

@ -39,7 +39,7 @@ describe('Hosts endpoints', () => {
expect(data).to.have.property('id');
expect(data.id).to.be.greaterThan(0);
expect(data).to.have.property('enabled');
expect(data.enabled).to.be.greaterThan(0);
expect(data).to.have.property("enabled", true);
expect(data).to.have.property('meta');
expect(typeof data.meta.nginx_online).to.be.equal('undefined');
});

View File

@ -1,12 +1,7 @@
const _ = require("lodash");
const chalk = require("chalk");
module.exports = function() {
var arr = _.values(arguments);
arr.unshift(
chalk.blue.bold("[") +
chalk.yellow.bold("Backend API") +
chalk.blue.bold("]"),
);
let arr = _.values(arguments);
arr.unshift('[Backend API]');
console.log.apply(null, arr);
};

View File

@ -6,21 +6,20 @@
"dependencies": {
"@jc21/cypress-swagger-validation": "^0.2.6",
"@jc21/restler": "^3.4.0",
"chalk": "^4.1.0",
"cypress": "^13.9.0",
"cypress": "^13.15.0",
"cypress-multi-reporters": "^1.6.4",
"cypress-wait-until": "^3.0.1",
"eslint": "^9.3.0",
"cypress-wait-until": "^3.0.2",
"eslint": "^9.12.0",
"eslint-plugin-align-assignments": "^1.1.2",
"eslint-plugin-chai-friendly": "^0.7.4",
"eslint-plugin-cypress": "^3.2.0",
"eslint-plugin-chai-friendly": "^1.0.1",
"eslint-plugin-cypress": "^3.5.0",
"lodash": "^4.17.21",
"mocha": "^10.4.0",
"mocha": "^10.7.3",
"mocha-junit-reporter": "^2.2.1"
},
"scripts": {
"cypress": "cypress open --config-file=cypress/config/dev.json --config baseUrl=${BASE_URL:-http://127.0.0.1:3081}",
"cypress:headless": "cypress run --config-file=cypress/config/dev.json --config baseUrl=${BASE_URL:-http://127.0.0.1:3081}"
"cypress": "cypress open --config-file=cypress/config/dev.js --config baseUrl=${BASE_URL:-http://127.0.0.1:3081}",
"cypress:headless": "cypress run --config-file=cypress/config/dev.js --config baseUrl=${BASE_URL:-http://127.0.0.1:3081}"
},
"author": "",
"license": "ISC"

File diff suppressed because it is too large Load Diff