@seriousme/openapi-schema-validator
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -6,4 +6,8 @@ # Changelog | ||
## [v1.1.0] 10-05-2021 | ||
## [v1.1.1] 14-05-2021 | ||
### Changed | ||
- Added CommonJS example to README.md | ||
## [v1.1.0] 14-05-2021 | ||
### Changed | ||
- Converted from ESM to CommonJS to improve compatibility | ||
@@ -10,0 +14,0 @@ |
{ | ||
"name": "@seriousme/openapi-schema-validator", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Validate OpenApi specifications against their JSON schema", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -25,3 +25,6 @@ # OpenAPI schema validator | ||
```javascript | ||
// ESM | ||
import Validator from "@seriousme/openapi-schema-validator"; | ||
// CommonJS | ||
const Validator = require("@seriousme/openapi-schema-validator"); | ||
@@ -33,2 +36,4 @@ console.log(Validator.supportedVersions.has("3.1")); | ||
const res = await validator.validate("./petstore.json"); | ||
const specification = validator.specification; | ||
// specification now contains a Javascript object containing the specification | ||
if (res.valid) { | ||
@@ -35,0 +40,0 @@ console.log("Specification matches schema for version", validator.version); |
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
183163
109