Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@stoplight/json-schema-sampler
Advanced tools
Changelog
[0.3.0]
SchemaSizeExceededError
to handle when an example response can't be generated because it's too largeReadme
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
, oneOf
, anyOf
, if/then/else
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 messagesnumber
Max depth sampler should traverseschema
passed is only a portion of the whole schema and $refs aren't resected. doc 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
The npm package @stoplight/json-schema-sampler receives a total of 93,105 weekly downloads. As such, @stoplight/json-schema-sampler popularity was classified as popular.
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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.