Gathering detailed insights and metrics for @stoplight/json-schema-sampler
Gathering detailed insights and metrics for @stoplight/json-schema-sampler
Gathering detailed insights and metrics for @stoplight/json-schema-sampler
Gathering detailed insights and metrics for @stoplight/json-schema-sampler
openapi-sampler
Tool for generation samples based on OpenAPI payload/response schema
@stoplight/better-ajv-errors
JSON Schema validation for Human
@stoplight/json-schema-viewer
A beautiful React component for viewing JSON Schema
@stoplight/spectral-ruleset-migrator
This project serves as a converter between the legacy ruleset format and a new one. It's used internally, albeit it can be used externally too, also in browsers.
npm install @stoplight/json-schema-sampler
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
8 Stars
145 Commits
2 Forks
15 Watching
20 Branches
58 Contributors
Updated on 27 Feb 2024
JavaScript (99.9%)
HTML (0.1%)
Cumulative downloads
Total Downloads
Last day
0.7%
23,883
Compared to previous day
Last week
10.8%
125,927
Compared to previous week
Last month
16.1%
519,809
Compared to previous month
Last year
60.7%
4,829,957
Compared to previous year
2
46
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:
1const 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 references1const JSONSchemaSampler = require('@stoplight/json-schema-sampler'); 2JSONSchemaSampler.sample({ 3 type: 'object', 4 properties: { 5 a: {type: 'integer', minimum: 10}, 6 b: {type: 'string', format: 'password', minLength: 10}, 7 c: {type: 'boolean', readOnly: true} 8 } 9}, {skipReadOnly: true}); 10// { a: 10, b: 'pa$$word_q' }
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 9/19 approved changesets -- score normalized to 4
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
73 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More