Tool for generation samples based on OpenAPI payload/response schema. Current stable version is 1.7.4. Released as needed with moderate cadence. Differentiators: deterministic output, supports compound keywords (allOf, oneOf, anyOf, if/then/else), uses const, examples, enum, and default in priority order, and supports $ref resolving.
npm install openapi-samplerNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Generate a sample object from an OpenAPI schema object using default options.
Pass the full OpenAPI spec object as third argument to `sample()`.
If you need non-deterministic output, consider using another library or manually post-processing the sample.
Be explicit with `type` in schema to avoid unexpected inferences.
Ensure the first argument to `sample()` is a valid schema object.
Pass the full OpenAPI spec object as third argument to `sample()`.
No dependency data recorded yet.