Security News
The Push to Ban Ransom Payments Is Gaining Momentum
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
@stoplight/json-schema-sampler
Advanced tools
Readme
It's a fork of openapi-sampler by Redocly, with focus on supporting JSON Schema Draft 7.
Tool for generation samples based on JSON Schema Draft 7.
allOf
additionalProperties
default
, const
, enum
and examples
where possiblecontains
, minItems
, maxItems
, and tuples (items
as an array)minLength
, maxLength
, min
, max
, exclusiveMinimum
, exclusiveMaximum
string
formats:
$ref
resolvingInstall using npm
npm install @stoplight/json-schema-sampler --save
or using yarn
yarn add @stoplight/json-schema-sampler
Then require it in your code:
const JSONSchemaSampler = require('@stoplight/json-schema-sampler');
JSONSchemaSampler.sample(schema, [options], [spec])
object
A JSON Schema Draft 7 document.object
Available options:
boolean
Don't include non-required object properties not specified in required
property of the schema objectboolean
Don't include readOnly
object propertiesboolean
Don't include writeOnly
object propertiesboolean
Don't log console warning messages$ref
. spec must not contain any external referencesconst JSONSchemaSampler = require('@stoplight/json-schema-sampler');
JSONSchemaSampler.sample({
type: 'object',
properties: {
a: {type: 'integer', minimum: 10},
b: {type: 'string', format: 'password', minLength: 10},
c: {type: 'boolean', readOnly: true}
}
}, {skipReadOnly: true});
// { a: 10, b: 'pa$$word_q' }
FAQs
Tool for generation samples based on JSON Schema Draft 7
We found that @stoplight/json-schema-sampler demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 26 open source maintainers 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
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
Application Security
New SEC disclosure rules aim to enforce timely cyber incident reporting, but fear of job loss and inadequate resources lead to significant underreporting.
Security News
The Python Software Foundation has secured a 5-year sponsorship from Fastly that supports PSF's activities and events, most notably the security and reliability of the Python Package Index (PyPI).