@seriousme/openapi-schema-validator
Advanced tools
Comparing version 1.0.1 to 1.0.2
{ | ||
"name": "@seriousme/openapi-schema-validator", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Validate OpenApi specifications against their JSON schema", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -25,12 +25,12 @@ # OpenAPI schema validator | ||
```javascript | ||
import Validator from "openapi-schema-validator"; | ||
import Validator from "@seriousme/openapi-schema-validator"; | ||
console.log(Validator.supportedVersions.has("3.1")) | ||
console.log(Validator.supportedVersions.has("3.1")); | ||
// prints true | ||
const validator = new Validator(); | ||
const res = await validator.validate('./petstore.json'); | ||
if (res.valid){ | ||
const res = await validator.validate("./petstore.json"); | ||
if (res.valid) { | ||
console.log("Specification matches schema for version", validator.version); | ||
const schema = validator.resolveRefs()); | ||
const schema = validator.resolveRefs(); | ||
// schema now contains a Javascript object containing the dereferenced schema | ||
@@ -37,0 +37,0 @@ } else { |
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
157876