New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

swagger-axios-codegen

Package Overview
Dependencies
Maintainers
1
Versions
149
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

swagger-axios-codegen - npm Package Compare versions

Comparing version 0.2.13 to 0.2.14

4

CHANGELOG.md

@@ -0,1 +1,5 @@

## 0.2.14
- Adds support of primitive response types ([bbc907](https://github.com/Manweill/swagger-axios-codegen/commit/bbc9072a634a996beab19e1a8fd58ea52b8d09d7) by [kt81](https://github.com/Manweill/swagger-axios-codegen/commits?author=kt81))
## 0.2.13

@@ -2,0 +6,0 @@

@@ -38,2 +38,4 @@ export interface ISwaggerOptions {

'$ref': string;
'type'?: string;
'items'?: IParameterItems;
};

@@ -40,0 +42,0 @@ };

@@ -110,5 +110,33 @@ "use strict";

}
let responseType = v.responses['200'] && v.responses['200'].schema && v.responses['200'].schema.$ref
? utils_1.refClassName(v.responses['200'].schema.$ref)
: 'any';
// 确定响应的类型
// It does not allow the schema defined directly, but only the primitive type is allowed.
let responseType;
if (!v.responses['200'] || !v.responses['200'].schema) {
responseType = 'any';
}
else if (v.responses['200'].schema.$ref) {
responseType = utils_1.refClassName(v.responses['200'].schema.$ref);
}
else {
let checkType = v.responses[200].schema.type;
if (!checkType) {
// implicit types
if (v.responses[200].schema.items) {
responseType = 'array';
}
else { // if (v.responses[200].schema.properties) // actual check
responseType = 'object';
}
}
else {
responseType = checkType; // string? -> string
}
if (responseType == 'object') {
responseType = 'any';
}
else if (responseType == 'array') {
responseType = 'any[]';
}
// else ... JSON primitive types (string, boolean, number)
}
// 模版

@@ -115,0 +143,0 @@ RequestMethods[className] += `

2

package.json
{
"name": "swagger-axios-codegen",
"version": "0.2.13",
"version": "0.2.14",
"main": "./dist/index",

@@ -5,0 +5,0 @@ "typings": "./dist/",

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