()
| 50 | } |
| 51 | |
| 52 | async function createOpenAPISchemasCheck() { |
| 53 | const schemasPath = path.join(process.cwd(), 'src/rest/data') |
| 54 | const openAPICheck = createCheckObj() |
| 55 | const schemas = fs.readdirSync(schemasPath) |
| 56 | |
| 57 | schemas.forEach((file) => { |
| 58 | const fileData = fs.readFileSync(path.join(schemasPath, file)) |
| 59 | const fileSchema = JSON.parse(fileData.toString()) |
| 60 | const categories = Object.keys(fileSchema).sort() |
| 61 | const version = getDocsVersion(file.split(/.json/)[0]) |
| 62 | |
| 63 | categories.forEach((category) => { |
| 64 | const subcategories = Object.keys(fileSchema[category]) |
| 65 | if (isApiVersioned(version)) { |
| 66 | getOnlyApiVersions(version).forEach( |
| 67 | (apiVersion) => (openAPICheck[apiVersion][category] = subcategories.sort()) |
| 68 | ) |
| 69 | } else { |
| 70 | openAPICheck[version][category] = subcategories.sort() |
| 71 | } |
| 72 | }) |
| 73 | }) |
| 74 | |
| 75 | return openAPICheck |
| 76 | } |
| 77 | |
| 78 | async function createCheckContentDirectory(contentFiles) { |
| 79 | const checkContent = createCheckObj() |
no test coverage detected