{"repo":"Redocly/openapi-sampler","free":true,"listed":false,"github":"https://github.com/Redocly/openapi-sampler","clone":"git clone https://github.com/Redocly/openapi-sampler.git","description":":capital_abcd: Tool for generation samples based on OpenAPI(fka Swagger) payload/response schema","language":"JavaScript","stars":228,"topics":["openapi","openapi-sampler","schema","payload","fake","mock","openapi3","openapi31","swagger"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"openapi-sampler Tool for generation samples based on OpenAPI payload/response schema Features - Deterministic (given a particular input, will always produce the same output) - Supports compound keywords: allOf , oneOf , anyOf , if/then/else - Supports additionalProperties with x-additionalPropertiesName - Uses const , examples , enum and default where possible - in this order - Good array support: supports contains , minItems , maxItems , and tuples ( items as an array) - Supports minLength , maxLength , min , max , exclusiveMinimum , exclusiveMaximum , (limited) pattern - Supports the following string formats: - email - idn-email - password - date-time - date - time - ipv4 - ipv6 - hostname - idn-hostname - uri - uri-reference - uri-template - iri - iri-reference - uuid - json-pointer - relative-json-pointer - regex - Infers schema type automatically following same rules as json-schema-faker - Support for $ref resolving - Has basic supports for JSON Schema draft 7 (thanks to @P0lip from @stoplightio for contributing) Installation Install using npm npm install openapi-sampler or using yarn yarn add openapi-sampler Then require it in your code: Usage OpenAPISampler.sample(schema, [options], [spec]) - schema ( required ) - object An OpenAPI Schema Object or a JSON Schema Draft 7 document. - options ( optional ) - object Available options: - skipNonRequired - boolean Don't include non-required object properties not specified in required property of the schema object - skipReadOn","default_branch":null,"files":null,"tree":[],"storefront":"/r/Redocly","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/Redocly/openapi-sampler/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}