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

@samchon/openapi

Package Overview
Dependencies
Maintainers
1
Versions
101
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@samchon/openapi - npm Package Compare versions

Comparing version 0.1.19 to 0.1.20

15

lib/internal/OpenApiV3Downgrader.js

@@ -151,3 +151,4 @@ "use strict";

var _a;
const matched = union.find((u) => u.type === value);
const matched = union.find((u) => u.type ===
typeof value);
if (matched !== undefined) {

@@ -159,11 +160,13 @@ (_a = matched.enum) !== null && _a !== void 0 ? _a : (matched.enum = []);

union.push({ type: typeof value, enum: [value] });
if (OpenApiTypeChecker_1.OpenApiTypeChecker.isConstant(schema))
insert(schema.const);
else if (OpenApiTypeChecker_1.OpenApiTypeChecker.isOneOf(schema))
schema.oneOf.forEach(insert);
};
if (OpenApiTypeChecker_1.OpenApiTypeChecker.isConstant(schema))
insert(schema.const);
else if (OpenApiTypeChecker_1.OpenApiTypeChecker.isOneOf(schema))
for (const u of schema.oneOf)
if (OpenApiTypeChecker_1.OpenApiTypeChecker.isConstant(u))
insert(u.const);
};
visit(input);
visitConstant(input);
if (nullable)
if (nullable === true)
for (const u of union)

@@ -170,0 +173,0 @@ if (OpenApiTypeChecker_1.OpenApiTypeChecker.isReference(u))

9

lib/OpenApi.d.ts

@@ -27,8 +27,9 @@ import { OpenApiV3 } from "./OpenApiV3";

* - JSON Schema
* - Decomposed mixed type: {@link OpenApiV3_1.IJsonSchema.IMixed}
* - Resolved nullable property: {@link OpenApiV3_1.IJsonSchema.__ISignificant.nullable}
* - Decompose mixed type: {@link OpenApiV3_1.IJsonSchema.IMixed}
* - Resolve nullable property: {@link OpenApiV3_1.IJsonSchema.__ISignificant.nullable}
* - Array type utilizes only single {@link OpenAPI.IJsonSchema.IArray.items}
* - Tuple type utilizes only {@link OpenApi.IJsonSchema.ITuple.prefixItems}
* - Merged {@link OpenApiV3_1.IJsonSchema.IAnyOf} to {@link OpenApi.IJsonSchema.IOneOf}
* - Merged {@link OpenApiV3_1.IJsonSchema.IRecursiveReference} to {@link OpenApi.IJsonSchema.IReference}
* - Merge {@link OpenApiV3_1.IJsonSchema.IAnyOf} to {@link OpenApi.IJsonSchema.IOneOf}
* - Merge {@link OpenApiV3_1.IJsonSchema.IRecursiveReference} to {@link OpenApi.IJsonSchema.IReference}
* - Merge {@link OpenApiV3_1.IJsonSchema.IAllOf} to {@link OpenApi.IJsonSchema.IObject}
*

@@ -35,0 +36,0 @@ * @author Jeongho Nam - https://github.com/samchon

@@ -35,8 +35,9 @@ "use strict";

* - JSON Schema
* - Decomposed mixed type: {@link OpenApiV3_1.IJsonSchema.IMixed}
* - Resolved nullable property: {@link OpenApiV3_1.IJsonSchema.__ISignificant.nullable}
* - Decompose mixed type: {@link OpenApiV3_1.IJsonSchema.IMixed}
* - Resolve nullable property: {@link OpenApiV3_1.IJsonSchema.__ISignificant.nullable}
* - Array type utilizes only single {@link OpenAPI.IJsonSchema.IArray.items}
* - Tuple type utilizes only {@link OpenApi.IJsonSchema.ITuple.prefixItems}
* - Merged {@link OpenApiV3_1.IJsonSchema.IAnyOf} to {@link OpenApi.IJsonSchema.IOneOf}
* - Merged {@link OpenApiV3_1.IJsonSchema.IRecursiveReference} to {@link OpenApi.IJsonSchema.IReference}
* - Merge {@link OpenApiV3_1.IJsonSchema.IAnyOf} to {@link OpenApi.IJsonSchema.IOneOf}
* - Merge {@link OpenApiV3_1.IJsonSchema.IRecursiveReference} to {@link OpenApi.IJsonSchema.IReference}
* - Merge {@link OpenApiV3_1.IJsonSchema.IAllOf} to {@link OpenApi.IJsonSchema.IObject}
*

@@ -43,0 +44,0 @@ * @author Jeongho Nam - https://github.com/samchon

{
"name": "@samchon/openapi",
"version": "0.1.19",
"version": "0.1.20",
"description": "OpenAPI definitions and converters for 'typia' and 'nestia'.",

@@ -32,2 +32,3 @@ "main": "./lib/index.js",

"devDependencies": {
"@nestia/e2e": "^0.4.3",
"@types/node": "^20.12.7",

@@ -34,0 +35,0 @@ "prettier": "^3.2.5",

@@ -29,11 +29,12 @@ # `@samchon/openapi`

- Operation
- Merged `OpenApiV3_1.IPathItem.parameters` to `OpenApi.IOperation.parameters`
- Merge `OpenApiV3_1.IPathItem.parameters` to `OpenApi.IOperation.parameters`
- Resolved references of `OpenApiV3_1.IOperation` mebers
- JSON Schema
- Decomposed mixed type: `OpenApiV3_1.IJsonSchema.IMixed`
- Decompose mixed type: `OpenApiV3_1.IJsonSchema.IMixed`
- Resolved nullable property: `OpenApiV3_1.IJsonSchema.__ISignificant.nullable`
- Array type utilizes only single `OpenAPI.IJsonSchema.IArray.items`
- Tuple type utilizes only `OpenApi.IJsonSchema.ITuple.prefixItems`
- Merged `OpenApiV3_1.IJsonSchema.IAnyOf` to `OpenApi.IJsonSchema.IOneOf`
- Merged `OpenApiV3_1.IJsonSchema.IRecursiveReference` to `OpenApi.IJsonSchema.IReference`
- Merge `OpenApiV3_1.IJsonSchema.IAnyOf` to `OpenApi.IJsonSchema.IOneOf`
- Merge `OpenApiV3_1.IJsonSchema.IRecursiveReference` to `OpenApi.IJsonSchema.IReference`
- Merge `OpenApiV3_1.IJsonSchema.IAllOf` to `OpenApi.IJsonSchema.IObject`

@@ -40,0 +41,0 @@

@@ -261,3 +261,4 @@ import { OpenApi } from "../OpenApi";

(u) =>
(u as OpenApiV3.IJsonSchema.__ISignificant<any>).type === value,
(u as OpenApiV3.IJsonSchema.__ISignificant<any>).type ===
typeof value,
) as OpenApiV3.IJsonSchema.INumber | undefined;

@@ -268,6 +269,7 @@ if (matched !== undefined) {

} else union.push({ type: typeof value as "number", enum: [value] });
if (OpenApiTypeChecker.isConstant(schema)) insert(schema.const);
else if (OpenApiTypeChecker.isOneOf(schema))
schema.oneOf.forEach(insert);
};
if (OpenApiTypeChecker.isConstant(schema)) insert(schema.const);
else if (OpenApiTypeChecker.isOneOf(schema))
for (const u of schema.oneOf)
if (OpenApiTypeChecker.isConstant(u)) insert(u.const);
};

@@ -277,3 +279,3 @@

visitConstant(input);
if (nullable)
if (nullable === true)
for (const u of union)

@@ -283,3 +285,2 @@ if (OpenApiTypeChecker.isReference(u))

else (u as OpenApiV3.IJsonSchema.IArray).nullable = true;
if (nullable === true && union.length === 0)

@@ -286,0 +287,0 @@ return { type: "null", ...attribute };

@@ -33,8 +33,9 @@ import { OpenApiV3 } from "./OpenApiV3";

* - JSON Schema
* - Decomposed mixed type: {@link OpenApiV3_1.IJsonSchema.IMixed}
* - Resolved nullable property: {@link OpenApiV3_1.IJsonSchema.__ISignificant.nullable}
* - Decompose mixed type: {@link OpenApiV3_1.IJsonSchema.IMixed}
* - Resolve nullable property: {@link OpenApiV3_1.IJsonSchema.__ISignificant.nullable}
* - Array type utilizes only single {@link OpenAPI.IJsonSchema.IArray.items}
* - Tuple type utilizes only {@link OpenApi.IJsonSchema.ITuple.prefixItems}
* - Merged {@link OpenApiV3_1.IJsonSchema.IAnyOf} to {@link OpenApi.IJsonSchema.IOneOf}
* - Merged {@link OpenApiV3_1.IJsonSchema.IRecursiveReference} to {@link OpenApi.IJsonSchema.IReference}
* - Merge {@link OpenApiV3_1.IJsonSchema.IAnyOf} to {@link OpenApi.IJsonSchema.IOneOf}
* - Merge {@link OpenApiV3_1.IJsonSchema.IRecursiveReference} to {@link OpenApi.IJsonSchema.IReference}
* - Merge {@link OpenApiV3_1.IJsonSchema.IAllOf} to {@link OpenApi.IJsonSchema.IObject}
*

@@ -41,0 +42,0 @@ * @author Jeongho Nam - https://github.com/samchon

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