Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

open-api-to-schema

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

open-api-to-schema - npm Package Compare versions

Comparing version 1.0.10 to 1.0.11

2

package.json
{
"name": "open-api-to-schema",
"version": "1.0.10",
"version": "1.0.11",
"description": "Open API / Swagger file to JSON Schema Converter",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -6,4 +6,7 @@ # Open api schema converter

## Usage
`npm install --save open-api-to-schema`
```javascript
import openApiToSchema from 'open-api-to-schema'
import Ajv from 'ajv'

@@ -17,3 +20,12 @@ const config = {

const jsonSchema = openApiToSchema('./test/fixtures/petstore-expanded.yaml', config)
const jsonSchemas = openApiToSchema('./test/fixtures/petstore-expanded.yaml', config)
const ajv = new Ajv()
const validator = ajv.compile(jsonSchema.paths['/pet'].get[200])
const valid = validator(response.data)
if (!valid) {
console.error(validator.errors)
}
...

@@ -20,0 +32,0 @@ ```

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc