Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

swagger-client

Package Overview
Dependencies
Maintainers
1
Versions
295
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

swagger-client - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

20

lib/swagger.js

@@ -355,9 +355,11 @@ // Generated by CoffeeScript 1.4.0

SwaggerModel.prototype.createJSONSample = function(modelToIgnore) {
SwaggerModel.prototype.createJSONSample = function(modelsToIgnore) {
var prop, result, _i, _len, _ref;
result = {};
modelsToIgnore = modelsToIgnore || [];
modelsToIgnore.push(this.name);
_ref = this.properties;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
prop = _ref[_i];
result[prop.name] = prop.getSampleValue(modelToIgnore);
result[prop.name] = prop.getSampleValue(modelsToIgnore);
}

@@ -376,3 +378,3 @@ return result;

this.dataType = obj.type;
this.isArray = this.dataType.toLowerCase() === 'array';
this.isCollection = this.dataType && (this.dataType.toLowerCase() === 'array' || this.dataType.toLowerCase() === 'list' || this.dataType.toLowerCase() === 'set');
this.descr = obj.description;

@@ -398,8 +400,8 @@ this.required = obj.required;

SwaggerModelProperty.prototype.getSampleValue = function(modelToIgnore) {
SwaggerModelProperty.prototype.getSampleValue = function(modelsToIgnore) {
var result;
if ((this.refModel != null) && (!(this.refModel === modelToIgnore))) {
result = this.refModel.createJSONSample(this.refModel);
if ((this.refModel != null) && (modelsToIgnore.indexOf(this.refModel.name) === -1)) {
result = this.refModel.createJSONSample(modelsToIgnore);
} else {
if (this.isArray) {
if (this.isCollection) {
result = this.refDataType;

@@ -410,3 +412,3 @@ } else {

}
if (this.isArray) {
if (this.isCollection) {
return [result];

@@ -772,2 +774,4 @@ } else {

window.SwaggerModelProperty = SwaggerModelProperty;
}).call(this);

2

package.json

@@ -11,3 +11,3 @@ {

"description": "swagger.js is a javascript client for use with swaggering APIs.",
"version": "1.0.2",
"version": "1.0.3",
"homepage": "http://swagger.wordnik.com",

@@ -14,0 +14,0 @@ "repository": {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc