openapi-sampler
Advanced tools
Comparing version 1.1.1 to 1.2.0
@@ -661,6 +661,7 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.OpenAPISampler = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){ | ||
if (schema && _typeof(schema.additionalProperties) === 'object') { | ||
res.property1 = (0, _traverse.traverse)(schema.additionalProperties, options, spec, { | ||
var propertyName = schema.additionalProperties['x-additionalPropertiesName'] || 'property'; | ||
res["".concat(String(propertyName), "1")] = (0, _traverse.traverse)(schema.additionalProperties, options, spec, { | ||
depth: depth + 1 | ||
}).value; | ||
res.property2 = (0, _traverse.traverse)(schema.additionalProperties, options, spec, { | ||
res["".concat(String(propertyName), "2")] = (0, _traverse.traverse)(schema.additionalProperties, options, spec, { | ||
depth: depth + 1 | ||
@@ -667,0 +668,0 @@ }).value; |
{ | ||
"name": "openapi-sampler", | ||
"version": "1.1.1", | ||
"version": "1.2.0", | ||
"description": "Tool for generation samples based on OpenAPI payload/response schema", | ||
@@ -5,0 +5,0 @@ "main": "dist/openapi-sampler.js", |
@@ -11,3 +11,3 @@ # openapi-sampler | ||
- Supports compound keywords: `allOf`, `oneOf`, `anyOf`, `if/then/else` | ||
- Supports `additionalProperties` | ||
- Supports `additionalProperties` with [`x-additionalPropertiesName`](https://github.com/Redocly/redoc/blob/master/docs/redoc-vendor-extensions.md#x-additionalpropertiesname) | ||
- Uses `const`, `examples`, `enum` and `default` where possible - in this order | ||
@@ -14,0 +14,0 @@ - Good array support: supports `contains`, `minItems`, `maxItems`, and tuples (`items` as an array) |
@@ -32,6 +32,7 @@ import { traverse } from '../traverse'; | ||
if (schema && typeof schema.additionalProperties === 'object') { | ||
res.property1 = traverse(schema.additionalProperties, options, spec, {depth: depth + 1 }).value; | ||
res.property2 = traverse(schema.additionalProperties, options, spec, {depth: depth + 1 }).value; | ||
const propertyName = schema.additionalProperties['x-additionalPropertiesName'] || 'property'; | ||
res[`${String(propertyName)}1`] = traverse(schema.additionalProperties, options, spec, {depth: depth + 1 }).value; | ||
res[`${String(propertyName)}2`] = traverse(schema.additionalProperties, options, spec, {depth: depth + 1 }).value; | ||
} | ||
return res; | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
58960
1465