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

oas2joi

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

oas2joi - npm Package Compare versions

Comparing version 1.0.4 to 2.0.1

4

index.js

@@ -14,4 +14,4 @@ const Enjoi = require('enjoi');

module.exports = filePath => {
const docSchemas = getSchemas(filePath);
module.exports = async filePath => {
const docSchemas = await getSchemas(filePath);

@@ -18,0 +18,0 @@ const joiSchemas = {};

@@ -1,7 +0,5 @@

const { readFileSync } = require('fs');
const { safeLoad } = require('js-yaml');
const SwaggerParser = require('swagger-parser');
const getSchemas = filePath => {
const openapi = readFileSync(filePath, 'utf8');
const doc = safeLoad(openapi);
const getSchemas = async filePath => {
const doc = await SwaggerParser.dereference(filePath);

@@ -8,0 +6,0 @@ return doc.components.schemas;

{
"name": "oas2joi",
"version": "1.0.4",
"version": "2.0.1",
"description": "Create a Joi schema from an Open API Specification",

@@ -19,6 +19,7 @@ "main": "index.js",

"enjoi": "^6.0.0",
"js-yaml": "^3.10.0"
"swagger-parser": "^9.0.1"
},
"devDependencies": {
"@hapi/joi": "^15.0.3",
"contributor-faces": "^1.0.3",
"jest": "^24.8.0",

@@ -25,0 +26,0 @@ "pre-commit": "^1.2.2"

@@ -23,1 +23,9 @@ # oas2joi

```
## Contributors
[//]: contributor-faces
<a href="https://github.com/iudex-"><img src="https://avatars2.githubusercontent.com/u/56843?s=400&u=598e754a7f053479c93a4ac061b5abfe0a6a7df1&v=4" title="iudex-" width="80" height="80"></a>
<a href="https://github.com/JoeScho"><img src="https://avatars1.githubusercontent.com/u/12475501?s=460&u=ea1487bb0b85777ae539a986d4254d6964d1c9d7&v=4" title="JoeScho" width="80" height="80"></a>
[//]: contributor-faces
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