Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
joi-openapi
Advanced tools
This is a fork of joi-to-openapi with some new options. In short, in this package I've added joi extensions as supported type.
Now the library support to outputs for converted joi: standard output and file.
const Joi = require("joi");
const { convert } = require("joi-openapi");
let joi = Joi.extend((joi) => ({
base: joi
.string()
.isoDate()
.description("Date in ISO format"),
name: "date_start",
language: {},
rules: [],
}));
console.log(convert(joi.date_start()));
will output
{
"type": "string",
"format": "date-time",
"description": "Date in ISO format"
}
to write the output on a file
const Joi = require("joi");
const { convertToFile } = require("joi-openapi");
let joi = Joi.extend((joi) => ({
base: joi
.string()
.isoDate()
.description("Date in ISO format"),
name: "date_start",
language: {},
rules: [],
}));
convertToFile(joi.date_start(), "./");
will output
{
"type": "string",
"format": "date-time",
"description": "Date in ISO format"
}
in the date_start.json file (the file will be created by joi type plust json format).
FAQs
Joi converter to openapi 3.0 standard
The npm package joi-openapi receives a total of 532 weekly downloads. As such, joi-openapi popularity was classified as not popular.
We found that joi-openapi demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.