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

openapi-typescript

Package Overview
Dependencies
Maintainers
1
Versions
145
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

openapi-typescript - npm Package Compare versions

Comparing version 6.4.5 to 6.5.0

6

CHANGELOG.md
# openapi-typescript
## 6.5.0
### Minor Changes
- [#1295](https://github.com/drwpow/openapi-typescript/pull/1295) [`99a1648`](https://github.com/drwpow/openapi-typescript/commit/99a1648affd5731c2d303619f050fee2ed834eef) Thanks [@pvanagtmaal](https://github.com/pvanagtmaal)! - Avoid adding a undefined union to additionProperties
## 6.4.5

@@ -4,0 +10,0 @@

8

dist/transform/schema-object.js

@@ -144,3 +144,9 @@ import { escObjKey, escStr, getEntries, getSchemaObjectComment, indent, parseRef, tsArrayOf, tsIntersectionOf, tsOmit, tsOneOf, tsOptionalProperty, tsReadonly, tsTupleOf, tsUnionOf, tsWithRequired } from "../utils.js";

}
coreType.push(indent(`[key: string]: ${tsUnionOf(addlType ? addlType : "unknown", "undefined")};`, indentLv));
const numProperties = schemaObject.properties ? Object.keys(schemaObject.properties).length : 0;
if (schemaObject.properties && ((!schemaObject.required && numProperties) || (schemaObject.required && numProperties !== schemaObject.required.length))) {
coreType.push(indent(`[key: string]: ${tsUnionOf(addlType ? addlType : "unknown", "undefined")};`, indentLv));
}
else {
coreType.push(indent(`[key: string]: ${addlType ? addlType : "unknown"};`, indentLv));
}
}

@@ -147,0 +153,0 @@ indentLv--;

8

package.json
{
"name": "openapi-typescript",
"description": "Generate TypeScript types from Swagger OpenAPI specs",
"version": "6.4.5",
"version": "6.5.0",
"author": {

@@ -57,6 +57,6 @@ "name": "Drew Powers",

"esbuild": "^0.19.0",
"execa": "^6.1.0",
"execa": "^7.2.0",
"vite": "^4.4.9",
"vite-node": "^0.33.0",
"vitest": "^0.33.0"
"vite-node": "^0.34.1",
"vitest": "^0.34.1"
},

@@ -63,0 +63,0 @@ "scripts": {

@@ -190,3 +190,12 @@ import type { GlobalContext, ReferenceObject, SchemaObject } from "../types.js";

}
coreType.push(indent(`[key: string]: ${tsUnionOf(addlType ? addlType : "unknown", "undefined")};`, indentLv)); // note: `| undefined` is required to mesh with possibly-undefined keys
// We need to add undefined when there are other optional properties in the schema.properties object
// that is the case when either schemaObject.required is empty and there are defined properties, or
// schemaObject.required is only contains a part of the schemaObject.properties
const numProperties = schemaObject.properties ? Object.keys(schemaObject.properties).length : 0;
if (schemaObject.properties && ((!schemaObject.required && numProperties) || (schemaObject.required && numProperties !== schemaObject.required.length))) {
coreType.push(indent(`[key: string]: ${tsUnionOf(addlType ? addlType : "unknown", "undefined")};`, indentLv));
} else {
coreType.push(indent(`[key: string]: ${addlType ? addlType : "unknown"};`, indentLv));
}
}

@@ -193,0 +202,0 @@ indentLv--;

Sorry, the diff of this file is not supported yet

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