
Security News
libxml2 Maintainer Ends Embargoed Vulnerability Reports, Citing Unsustainable Burden
Libxml2’s solo maintainer drops embargoed security fixes, highlighting the burden on unpaid volunteers who keep critical open source software secure.
sequelize-json-schema
Advanced tools
Use your Sequelize models in JSON Schemas or Swagger
Main use case for this code is to generate models for hand crafted swagger.json.
let Simple = sequelize.define('simple', {
title: Sequelize.STRING,
description: Sequelize.TEXT
});
let def = definition(Simple);
console.log(def);
And result will be:
{
type: 'object',
properties: {
id: {
type: 'integer',
format: 'int32'
},
title: { type: 'string' },
description: { type: 'string' },
createdAt: {
type: 'string',
format: 'date-time'
},
updatedAt: {
type: 'string',
format: 'date-time'
}
}
}
This tool generates definitions
part of the Swagger Manifest. So if you have Swagger definition for your API just extend definitions
with JSON generated by this tool.
{
"swagger": "2.0",
"info": {
"title": "API",
"version": "1.0.0"
},
"paths": {
"simple": {
"get": {
"parameters": [ ],
"responses": {
"200": { "$ref": "#/definitions/simple" }
}
}
}
},
"definitions": {
"simple": {
type: 'object',
properties: {
id: {
type: 'integer',
format: 'int32'
},
title: { type: 'string' },
description: { type: 'string' },
createdAt: {
type: 'string',
format: 'date-time'
},
updatedAt: {
type: 'string',
format: 'date-time'
}
}
}
}
}
FAQs
Use your Sequelize models in JSON Schemas or Swagger
The npm package sequelize-json-schema receives a total of 1,111 weekly downloads. As such, sequelize-json-schema popularity was classified as popular.
We found that sequelize-json-schema 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
Libxml2’s solo maintainer drops embargoed security fixes, highlighting the burden on unpaid volunteers who keep critical open source software secure.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.