@seriousme/openapi-schema-validator
Advanced tools
Comparing version 2.2.1 to 2.2.2
#!/usr/bin/env node | ||
import { writeFileSync } from "fs"; | ||
import { basename } from "path"; | ||
import { writeFileSync } from "node:fs"; | ||
import { basename } from "node:path"; | ||
import { argv, exit } from "node:process"; | ||
import { dump } from "js-yaml"; | ||
import argvParser from "minimist"; | ||
import { argv, exit } from "process"; | ||
import { Validator } from "../index.js"; | ||
@@ -9,0 +9,0 @@ |
@@ -5,3 +5,3 @@ #!/usr/bin/env node | ||
const validator = new Validator(); | ||
import { argv, exit } from "process"; | ||
import { argv, exit } from "node:process"; | ||
@@ -8,0 +8,0 @@ const filename = argv[2]; |
@@ -6,2 +6,9 @@ # Changelog | ||
## [v2.2.2] 31-08-2024 | ||
### Changed | ||
- updated dependencies | ||
- @biomejs/biome ^1.5.3 → ^1.8.3 | ||
- ajv ^8.12.0 → ^8.17.1 | ||
- c8 ^10.1.1 → ^10.1.2 | ||
## [v2.2.1] 17-02-2024 | ||
@@ -8,0 +15,0 @@ ### Changed |
@@ -1,2 +0,2 @@ | ||
import { ErrorObject, Options } from "ajv"; | ||
import type { ErrorObject, Options } from "ajv"; | ||
export class Validator { | ||
@@ -3,0 +3,0 @@ static supportedVersions: Set<string>; |
@@ -1,7 +0,7 @@ | ||
import { readFileSync } from "fs"; | ||
import { URL, fileURLToPath } from "url"; | ||
import { readFileSync } from "node:fs"; | ||
import { readFile } from "node:fs/promises"; | ||
import { URL, fileURLToPath } from "node:url"; | ||
import Ajv04 from "ajv-draft-04"; | ||
import addFormats from "ajv-formats"; | ||
import Ajv2020 from "ajv/dist/2020.js"; | ||
import { readFile } from "fs/promises"; | ||
import { JSON_SCHEMA, load } from "js-yaml"; | ||
@@ -8,0 +8,0 @@ import { checkRefs, replaceRefs } from "./resolve.js"; |
118
package.json
{ | ||
"name": "@seriousme/openapi-schema-validator", | ||
"version": "2.2.1", | ||
"description": "Validate OpenApi specifications against their JSON schema", | ||
"main": "index.js", | ||
"type": "module", | ||
"bin": { | ||
"validate-api": "./bin/validate-api-cli.js", | ||
"bundle-api": "./bin/bundle-api-cli.js" | ||
}, | ||
"dependencies": { | ||
"ajv": "^8.12.0", | ||
"ajv-draft-04": "^1.0.0", | ||
"ajv-formats": "^2.1.1", | ||
"js-yaml": "^4.1.0", | ||
"minimist": "^1.2.8" | ||
}, | ||
"scripts": { | ||
"test": "c8 node --test test/test-*.js", | ||
"format": "biome format --write .", | ||
"lint": "biome ci .", | ||
"pretest": "npm run format", | ||
"posttest": "c8 check-coverage --lines 100 --functions 100 --branches 100", | ||
"covtest": "c8 --reporter=lcov npm test", | ||
"cloneOas": "rm -rf OpenAPI-Specification && git clone --branch 'gh-pages' --single-branch https://github.com/OAI/OpenAPI-Specification.git", | ||
"checkOasVersions": "node test/check-versions.js", | ||
"checkOasVersionsSnapshot": "node test/check-versions.js --updateSnapshot", | ||
"preconvert31": "npm run cloneOas", | ||
"convert31": "node test/convert-3.1.js ", | ||
"postconvert31": "npm run checkOasVersionsSnapshot", | ||
"preversion": "npm test", | ||
"postversion": "git push && git push --tags", | ||
"realWorldTest": "node test/realworld/realworld.js", | ||
"realWorldTestAll": "node test/realworld/realworld.js --all", | ||
"realWorldTestFailed": "node test/realworld/realworld.js --failedOnly", | ||
"realWorldTestCI": "node test/realworld/realworld.js --ci" | ||
}, | ||
"author": "Hans Klunder", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"@biomejs/biome": "^1.5.3", | ||
"c8": "^9.1.0" | ||
}, | ||
"directories": { | ||
"test": "test" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/seriousme/openapi-schema-validator.git" | ||
}, | ||
"keywords": [ | ||
"openapi", | ||
"json", | ||
"schema", | ||
"validation" | ||
], | ||
"bugs": { | ||
"url": "https://github.com/seriousme/openapi-schema-validator/issues" | ||
}, | ||
"homepage": "https://github.com/seriousme/openapi-schema-validator#readme" | ||
"name": "@seriousme/openapi-schema-validator", | ||
"version": "2.2.2", | ||
"description": "Validate OpenApi specifications against their JSON schema", | ||
"main": "index.js", | ||
"type": "module", | ||
"bin": { | ||
"validate-api": "./bin/validate-api-cli.js", | ||
"bundle-api": "./bin/bundle-api-cli.js" | ||
}, | ||
"dependencies": { | ||
"ajv": "^8.17.1", | ||
"ajv-draft-04": "^1.0.0", | ||
"ajv-formats": "^3.0.1", | ||
"js-yaml": "^4.1.0", | ||
"minimist": "^1.2.8" | ||
}, | ||
"scripts": { | ||
"test": "c8 node --test test/test-*.js", | ||
"format": "biome format --write .", | ||
"lint": "biome ci .", | ||
"pretest": "npm run format", | ||
"posttest": "c8 check-coverage --lines 100 --functions 100 --branches 100", | ||
"covtest": "c8 --reporter=lcov npm test", | ||
"cloneOas": "rm -rf OpenAPI-Specification && git clone --branch 'gh-pages' --single-branch https://github.com/OAI/OpenAPI-Specification.git", | ||
"checkOasVersions": "node test/check-versions.js", | ||
"checkOasVersionsSnapshot": "node test/check-versions.js --updateSnapshot", | ||
"preconvert31": "npm run cloneOas", | ||
"convert31": "node test/convert-3.1.js ", | ||
"postconvert31": "npm run checkOasVersionsSnapshot", | ||
"preversion": "npm test", | ||
"postversion": "git push && git push --tags", | ||
"realWorldTest": "node test/realworld/realworld.js", | ||
"realWorldTestAll": "node test/realworld/realworld.js --all", | ||
"realWorldTestFailed": "node test/realworld/realworld.js --failedOnly", | ||
"realWorldTestCI": "node test/realworld/realworld.js --ci" | ||
}, | ||
"author": "Hans Klunder", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"@biomejs/biome": "^1.8.3", | ||
"c8": "^10.1.2" | ||
}, | ||
"directories": { | ||
"test": "test" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/seriousme/openapi-schema-validator.git" | ||
}, | ||
"keywords": [ | ||
"openapi", | ||
"json", | ||
"schema", | ||
"validation" | ||
], | ||
"bugs": { | ||
"url": "https://github.com/seriousme/openapi-schema-validator/issues" | ||
}, | ||
"homepage": "https://github.com/seriousme/openapi-schema-validator#readme" | ||
} |
@@ -1,7 +0,7 @@ | ||
import { createHash } from "crypto"; | ||
import { readFileSync } from "fs"; | ||
import { strict as assert } from "node:assert/strict"; | ||
import { createHash } from "node:crypto"; | ||
import { readFileSync } from "node:fs"; | ||
import { readdir } from "node:fs/promises"; | ||
import { test } from "node:test"; | ||
import { URL } from "url"; | ||
import { readdir } from "fs/promises"; | ||
import { URL } from "node:url"; | ||
import { Validator } from "../index.js"; | ||
@@ -39,3 +39,6 @@ import { Snapshot } from "./snapshot.js"; | ||
test(`Check if version ${version} is unchanged`, async (t) => { | ||
const schemaList = await readdir(`${openApiDir}/${version}/schema/`); | ||
const versionDir = `${openApiDir}/${version}/schema/`; | ||
const schemaList = (await readdir(versionDir)).filter( | ||
(f) => !f.endsWith(".md"), | ||
); | ||
const lastSchema = schemaList.pop(); | ||
@@ -42,0 +45,0 @@ const schema = readJSON(`${openApiDir}/${version}/schema/${lastSchema}`); |
@@ -1,2 +0,2 @@ | ||
import { readFileSync, readdirSync, writeFileSync } from "fs"; | ||
import { readFileSync, readdirSync, writeFileSync } from "node:fs"; | ||
@@ -3,0 +3,0 @@ function localPath(path) { |
// test the validator against the APIs of https://apis.guru | ||
import { createRequire } from "module"; | ||
import { createRequire } from "node:module"; | ||
const importJSON = createRequire(import.meta.url); | ||
@@ -7,5 +7,5 @@ const localFile = (fileName) => new URL(fileName, import.meta.url).pathname; | ||
const validator = new Validator(); | ||
import { writeFileSync } from "fs"; | ||
import { writeFileSync } from "node:fs"; | ||
import { argv, exit } from "node:process"; | ||
import { JSON_SCHEMA, load } from "js-yaml"; | ||
import { argv, exit } from "process"; | ||
import { createReport } from "./createReport.js"; | ||
@@ -12,0 +12,0 @@ const yamlOpts = { schema: JSON_SCHEMA }; |
@@ -1,2 +0,2 @@ | ||
import { createRequire } from "module"; | ||
import { createRequire } from "node:module"; | ||
import { createReport } from "./createReport.js"; | ||
@@ -6,3 +6,3 @@ const importJSON = createRequire(import.meta.url); | ||
import { writeFileSync } from "fs"; | ||
import { writeFileSync } from "node:fs"; | ||
@@ -9,0 +9,0 @@ const mdFile = localFile("./failed.fromJson.md"); |
// simple snapshot handling utility for testing, nothing fancy | ||
import { readFileSync, writeFileSync } from "fs"; | ||
import { readFileSync, writeFileSync } from "node:fs"; | ||
@@ -5,0 +5,0 @@ export class Snapshot { |
@@ -1,6 +0,6 @@ | ||
import { execSync } from "child_process"; | ||
import { readFileSync, unlinkSync } from "fs"; | ||
import { strict as assert } from "node:assert/strict"; | ||
import { execSync } from "node:child_process"; | ||
import { readFileSync, unlinkSync } from "node:fs"; | ||
import { test } from "node:test"; | ||
import { URL, fileURLToPath } from "url"; | ||
import { URL, fileURLToPath } from "node:url"; | ||
import { load } from "js-yaml"; | ||
@@ -7,0 +7,0 @@ |
@@ -1,5 +0,5 @@ | ||
import { execSync } from "child_process"; | ||
import { strict as assert } from "node:assert/strict"; | ||
import { execSync } from "node:child_process"; | ||
import { test } from "node:test"; | ||
import { URL, fileURLToPath } from "url"; | ||
import { URL, fileURLToPath } from "node:url"; | ||
@@ -6,0 +6,0 @@ function localFile(fileName) { |
import { strict as assert } from "node:assert/strict"; | ||
import { test } from "node:test"; | ||
import { URL, fileURLToPath } from "url"; | ||
import { URL, fileURLToPath } from "node:url"; | ||
import { Validator } from "../index.js"; | ||
@@ -5,0 +5,0 @@ |
@@ -1,6 +0,6 @@ | ||
import { readFileSync } from "fs"; | ||
import { strict as assert } from "node:assert/strict"; | ||
import { readFileSync } from "node:fs"; | ||
import { readFile } from "node:fs/promises"; | ||
import { test } from "node:test"; | ||
import { URL, fileURLToPath } from "url"; | ||
import { readFile } from "fs/promises"; | ||
import { URL, fileURLToPath } from "node:url"; | ||
import { Validator } from "../index.js"; | ||
@@ -7,0 +7,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 2 instances in 1 package
347697
10000
0
2
+ Addedajv-formats@3.0.1(transitive)
- Removedajv-formats@2.1.1(transitive)
Updatedajv@^8.17.1
Updatedajv-formats@^3.0.1