Socket
Socket
Sign inDemoInstall

@samchon/openapi

Package Overview
Dependencies
Maintainers
1
Versions
79
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.0 to 0.1.1

2

lib/index.d.ts

@@ -0,2 +1,4 @@

export * from "./OpenApi";
export * from "./SwaggerV2";
export * from "./OpenApiV3";
export * from "./OpenApiV3_1";

@@ -17,3 +17,5 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./OpenApi"), exports);
__exportStar(require("./SwaggerV2"), exports);
__exportStar(require("./OpenApiV3"), exports);
__exportStar(require("./OpenApiV3_1"), exports);

2

lib/internal/OpenApiV3_1Converter.js

@@ -109,3 +109,3 @@ "use strict";

key,
Object.assign(Object.assign({}, value), { schema: convertSchema(value.schema) }),
Object.assign(Object.assign({}, value), { schema: value.schema ? convertSchema(value.schema) : undefined }),
]));

@@ -112,0 +112,0 @@ /* -----------------------------------------------------------

@@ -97,3 +97,3 @@ "use strict";

key,
Object.assign(Object.assign({}, value), { schema: convertSchema(value.schema) }),
Object.assign(Object.assign({}, value), { schema: value.schema ? convertSchema(value.schema) : undefined }),
]));

@@ -138,5 +138,7 @@ /* -----------------------------------------------------------

union.push(Object.assign(Object.assign({}, schema), {
properites: Object.fromEntries(Object.entries(schema.properties)
.filter(([_, v]) => v !== undefined)
.map(([key, value]) => [key, convertSchema(value)])),
properites: schema.properties
? Object.fromEntries(Object.entries(schema.properties)
.filter(([_, v]) => v !== undefined)
.map(([key, value]) => [key, convertSchema(value)]))
: undefined,
additionalProperties: schema.additionalProperties

@@ -143,0 +145,0 @@ ? typeof schema.additionalProperties === "object" &&

@@ -61,4 +61,4 @@ "use strict";

description: input.description,
required: input.required,
schema: convertSchema(input),
required: true,
});

@@ -206,5 +206,7 @@ const convertRequestBody = (input) => ({

union.push(Object.assign(Object.assign({}, schema), {
properites: Object.fromEntries(Object.entries(schema.properties)
.filter(([_, v]) => v !== undefined)
.map(([key, value]) => [key, convertSchema(value)])),
properites: schema.properties
? Object.fromEntries(Object.entries(schema.properties)
.filter(([_, v]) => v !== undefined)
.map(([key, value]) => [key, convertSchema(value)]))
: undefined,
additionalProperties: schema.additionalProperties

@@ -211,0 +213,0 @@ ? typeof schema.additionalProperties === "object" &&

@@ -44,4 +44,4 @@ import { OpenApiV3 } from "./OpenApiV3";

name?: string;
/** @format uri */ url?: string;
/** @format email */ email?: string;
url?: string;
email?: string;
}

@@ -51,7 +51,7 @@ interface ILicense {

identifier?: string;
/** @format email */ url?: string;
url?: string;
}
}
interface IServer {
/** @format uri */ url: string;
url: string;
description?: string;

@@ -80,3 +80,3 @@ variables?: Record<string, IServer.IVariable>;

description?: string;
security?: Record<string, string[]>;
security?: Record<string, string[]>[];
tags?: string[];

@@ -104,3 +104,3 @@ deprecated?: boolean;

interface IMediaType {
schema: IJsonSchema;
schema?: IJsonSchema;
}

@@ -204,3 +204,3 @@ }

type: "openIdConnect";
/** @format uri */ openIdConnectUrl: string;
openIdConnectUrl: string;
description?: string;

@@ -216,5 +216,5 @@ }

interface IFlow {
/** @format uri */ authorizationUrl?: string;
/** @format uri */ tokenUrl?: string;
/** @format uri */ refreshUrl?: string;
authorizationUrl?: string;
tokenUrl?: string;
refreshUrl?: string;
scopes?: Record<string, string>;

@@ -221,0 +221,0 @@ }

@@ -38,4 +38,4 @@ /**

name?: string;
/** @format uri */ url?: string;
/** @format email */ email?: string;
url?: string;
email?: string;
}

@@ -45,7 +45,7 @@ interface ILicense {

identifier?: string;
/** @format email */ url?: string;
url?: string;
}
}
interface IServer {
/** @format uri */ url: string;
url: string;
description?: string;

@@ -75,3 +75,3 @@ variables?: Record<string, IServer.IVariable>;

description?: string;
security?: Record<string, string[]>;
security?: Record<string, string[]>[];
tags?: string[];

@@ -99,3 +99,3 @@ deprecated?: boolean;

interface IMediaType {
schema: IJsonSchema;
schema?: IJsonSchema;
}

@@ -176,3 +176,3 @@ }

interface IObject extends __ISignificant<"object"> {
properties: Record<string, IJsonSchema>;
properties?: Record<string, IJsonSchema>;
required?: string[];

@@ -221,3 +221,3 @@ additionalProperties?: boolean | IJsonSchema;

type: "openIdConnect";
/** @format uri */ openIdConnectUrl: string;
openIdConnectUrl: string;
description?: string;

@@ -233,5 +233,5 @@ }

interface IFlow {
/** @format uri */ authorizationUrl?: string;
/** @format uri */ tokenUrl?: string;
/** @format uri */ refreshUrl?: string;
authorizationUrl?: string;
tokenUrl?: string;
refreshUrl?: string;
scopes?: Record<string, string>;

@@ -238,0 +238,0 @@ }

@@ -13,3 +13,3 @@ /**

interface IDocument {
openapi: `3.0.${number}`;
openapi: "3.0" | `3.0.${number}`;
servers?: IServer[];

@@ -37,12 +37,12 @@ info?: IDocument.IInfo;

name?: string;
/** @format uri */ url?: string;
/** @format email */ email?: string;
url?: string;
email?: string;
}
interface ILicense {
name: string;
/** @format email */ url?: string;
url?: string;
}
}
interface IServer {
/** @format uri */ url: string;
url: string;
description?: string;

@@ -72,3 +72,3 @@ variables?: Record<string, IServer.IVariable>;

description?: string;
security?: Record<string, string[]>;
security?: Record<string, string[]>[];
tags?: string[];

@@ -96,3 +96,3 @@ deprecated?: boolean;

interface IMediaType {
schema: IJsonSchema;
schema?: IJsonSchema;
}

@@ -147,3 +147,3 @@ }

interface IObject extends __ISignificant<"object"> {
properties: Record<string, IJsonSchema>;
properties?: Record<string, IJsonSchema>;
required?: string[];

@@ -208,3 +208,3 @@ additionalProperties?: boolean | IJsonSchema;

type: "openIdConnect";
/** @format uri */ openIdConnectUrl: string;
openIdConnectUrl: string;
description?: string;

@@ -220,5 +220,5 @@ }

interface IFlow {
/** @format uri */ authorizationUrl?: string;
/** @format uri */ tokenUrl?: string;
/** @format uri */ refreshUrl?: string;
authorizationUrl?: string;
tokenUrl?: string;
refreshUrl?: string;
scopes?: Record<string, string>;

@@ -225,0 +225,0 @@ }

@@ -13,3 +13,3 @@ /**

interface IDocument {
swagger: `2.0.${number}`;
swagger: "2.0" | `2.0.${number}`;
host?: string;

@@ -19,9 +19,9 @@ basePath?: string;

produces?: string[];
definitions: Record<string, IJsonSchema>;
parameters: Record<string, IOperation.IParameter>;
responses: Record<string, IOperation.IResponse>;
definitions?: Record<string, IJsonSchema>;
parameters?: Record<string, IOperation.IParameter>;
responses?: Record<string, IOperation.IResponse>;
securityDefinitions?: Record<string, ISecurityDefinition>;
security?: Record<string, string[]>[];
paths?: Record<string, IPathItem>;
tags: IDocument.ITag[];
tags?: IDocument.ITag[];
}

@@ -60,3 +60,3 @@ namespace IDocument {

description?: string;
security?: Record<string, string[]>;
security?: Record<string, string[]>[];
tags?: string[];

@@ -71,3 +71,2 @@ deprecated?: boolean;

description?: string;
required?: boolean;
};

@@ -86,5 +85,2 @@ interface IBodyParameter {

}
interface IMediaType {
schema: IJsonSchema;
}
}

@@ -130,3 +126,3 @@ type IJsonSchema = IJsonSchema.IBoolean | IJsonSchema.IInteger | IJsonSchema.INumber | IJsonSchema.IString | IJsonSchema.IArray | IJsonSchema.IObject | IJsonSchema.IReference | IJsonSchema.IUnknown | IJsonSchema.INullOnly | IJsonSchema.IAllOf | IJsonSchema.IAnyOf | IJsonSchema.IOneOf;

interface IObject extends __ISignificant<"object"> {
properties: Record<string, IJsonSchema>;
properties?: Record<string, IJsonSchema>;
required?: string[];

@@ -133,0 +129,0 @@ additionalProperties?: boolean | IJsonSchema;

{
"name": "@samchon/openapi",
"version": "0.1.0",
"version": "0.1.1",
"description": "",

@@ -5,0 +5,0 @@ "main": "./lib/index.js",

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