Swagger/openapi schema mega fixes and Cypress validation/enforcement

This commit is contained in:
Jamie Curnow
2025-10-29 20:15:00 +10:00
parent 89abb9d559
commit 906ce8ced2
80 changed files with 2007 additions and 543 deletions

View File

@@ -0,0 +1,21 @@
/// <reference types="cypress" />
const SWAGGER_SCHEMA_FILENAME = 'results/swagger-schema.json';
describe('Swagger Schema Linting', () => {
it('Should be a completely valid schema', () => {
// Save the schema to a file and lint it
cy.request('/api/schema')
.then((response) => {
const fileContent = response.body;
cy.writeFile(SWAGGER_SCHEMA_FILENAME, fileContent);
})
.then(() => {
cy.exec(`yarn swagger-lint '${SWAGGER_SCHEMA_FILENAME}'`)
.then((result) => {
cy.log("Swagger Vacuum Results:\n", result.stdout);
expect(result.code).to.eq(0);
});
});
});
});