@samchon/openapi
Advanced tools
Comparing version 0.4.1 to 0.4.2
@@ -70,2 +70,4 @@ import { OpenApi } from "./OpenApi"; | ||
* List of path parameters. | ||
* | ||
* Note that, not a list of every parameters, but only path parameters. | ||
*/ | ||
@@ -203,2 +205,4 @@ parameters: IMigrateRoute.IParameter<Schema>[]; | ||
description: () => string | undefined; | ||
example: () => any | undefined; | ||
examples: () => Record<string, any> | undefined; | ||
} | ||
@@ -214,2 +218,4 @@ /** | ||
description: () => string | undefined; | ||
example: () => any | undefined; | ||
examples: () => Record<string, any> | undefined; | ||
} | ||
@@ -241,2 +247,6 @@ /** | ||
/** | ||
* Media type of the request/response body. | ||
*/ | ||
media: () => OpenApi.IOperation.IMediaType<Schema>; | ||
/** | ||
* Whether the body is encrypted or not. | ||
@@ -258,3 +268,7 @@ */ | ||
response: () => OpenApi.IOperation.IResponse<Schema>; | ||
/** | ||
* Media type of the response body. | ||
*/ | ||
media: () => OpenApi.IOperation.IMediaType<Schema>; | ||
} | ||
} |
@@ -55,3 +55,3 @@ "use strict"; | ||
OpenApiTypeChecker_1.OpenApiTypeChecker.isArray(p.schema)); | ||
const out = (elem) => (Object.assign(Object.assign({}, elem), { name: type, key: type, title: () => elem.title, description: () => elem.description })); | ||
const out = (elem) => (Object.assign(Object.assign({}, elem), { name: type, key: type, title: () => elem.title, description: () => elem.description, example: () => elem.example, examples: () => elem.examples })); | ||
if (objects.length === 1 && primitives.length === 0) | ||
@@ -206,2 +206,3 @@ return out(parameters[0]); | ||
response: () => response, | ||
media: () => { var _a, _b; return (_b = (_a = response.content) === null || _a === void 0 ? void 0 : _a["application/json"]) !== null && _b !== void 0 ? _b : {}; }, | ||
}, | ||
@@ -284,4 +285,5 @@ ]; | ||
: {}, | ||
description: () => meta.description, | ||
media: () => json[1], | ||
"x-nestia-encrypted": meta["x-nestia-encrypted"], | ||
description: () => meta.description, | ||
}; | ||
@@ -302,2 +304,3 @@ } | ||
description: () => meta.description, | ||
media: () => query[1], | ||
}; | ||
@@ -313,2 +316,3 @@ } | ||
description: () => meta.description, | ||
media: () => text[1], | ||
}; | ||
@@ -329,2 +333,3 @@ if (from === "request") { | ||
description: () => meta.description, | ||
media: () => multipart[1], | ||
}; | ||
@@ -331,0 +336,0 @@ } |
@@ -382,5 +382,5 @@ import { IMigrateDocument } from "./IMigrateDocument"; | ||
interface IRequestBody<Schema extends IJsonSchema = IJsonSchema> { | ||
content?: IContent<Schema>; | ||
description?: string; | ||
required?: boolean; | ||
content?: IContent<Schema>; | ||
"x-nestia-encrypted"?: boolean; | ||
@@ -392,4 +392,4 @@ } | ||
interface IResponse<Schema extends IJsonSchema = IJsonSchema> { | ||
headers?: Record<string, IOperation.IParameter<Schema>>; | ||
content?: IContent<Schema>; | ||
headers?: Record<string, IOperation.IParameter<Schema>>; | ||
description?: string; | ||
@@ -396,0 +396,0 @@ "x-nestia-encrypted"?: boolean; |
{ | ||
"name": "@samchon/openapi", | ||
"version": "0.4.1", | ||
"version": "0.4.2", | ||
"description": "OpenAPI definitions and converters for 'typia' and 'nestia'.", | ||
@@ -19,2 +19,4 @@ "main": "./lib/index.js", | ||
"openapi", | ||
"converter", | ||
"migrate", | ||
"typia", | ||
@@ -21,0 +23,0 @@ "nestia" |
@@ -78,2 +78,4 @@ import { OpenApi } from "./OpenApi"; | ||
* List of path parameters. | ||
* | ||
* Note that, not a list of every parameters, but only path parameters. | ||
*/ | ||
@@ -228,2 +230,4 @@ parameters: IMigrateRoute.IParameter<Schema>[]; | ||
description: () => string | undefined; | ||
example: () => any | undefined; | ||
examples: () => Record<string, any> | undefined; | ||
} | ||
@@ -242,2 +246,4 @@ | ||
description: () => string | undefined; | ||
example: () => any | undefined; | ||
examples: () => Record<string, any> | undefined; | ||
} | ||
@@ -281,2 +287,7 @@ | ||
/** | ||
* Media type of the request/response body. | ||
*/ | ||
media: () => OpenApi.IOperation.IMediaType<Schema>; | ||
/** | ||
* Whether the body is encrypted or not. | ||
@@ -302,3 +313,8 @@ */ | ||
response: () => OpenApi.IOperation.IResponse<Schema>; | ||
/** | ||
* Media type of the response body. | ||
*/ | ||
media: () => OpenApi.IOperation.IMediaType<Schema>; | ||
} | ||
} |
@@ -89,2 +89,4 @@ import { IMigrateRoute } from "../IMigrateRoute"; | ||
description?: string; | ||
example?: any; | ||
examples?: Record<string, any>; | ||
}) => | ||
@@ -97,2 +99,4 @@ ({ | ||
description: () => elem.description, | ||
example: () => elem.example, | ||
examples: () => elem.examples, | ||
}) satisfies IMigrateRoute.IHeaders; | ||
@@ -274,2 +278,3 @@ | ||
response: () => response, | ||
media: () => response.content?.["application/json"] ?? {}, | ||
}, | ||
@@ -379,4 +384,5 @@ ]), | ||
: {}, | ||
description: () => meta.description, | ||
media: () => json[1], | ||
"x-nestia-encrypted": meta["x-nestia-encrypted"], | ||
description: () => meta.description, | ||
}; | ||
@@ -400,2 +406,3 @@ } | ||
description: () => meta.description, | ||
media: () => query[1], | ||
}; | ||
@@ -412,2 +419,3 @@ } | ||
description: () => meta.description, | ||
media: () => text[1], | ||
}; | ||
@@ -431,2 +439,3 @@ | ||
description: () => meta.description, | ||
media: () => multipart[1], | ||
}; | ||
@@ -433,0 +442,0 @@ } |
@@ -509,5 +509,5 @@ import { IMigrateDocument } from "./IMigrateDocument"; | ||
export interface IRequestBody<Schema extends IJsonSchema = IJsonSchema> { | ||
content?: IContent<Schema>; | ||
description?: string; | ||
required?: boolean; | ||
content?: IContent<Schema>; | ||
"x-nestia-encrypted"?: boolean; | ||
@@ -520,4 +520,4 @@ } | ||
export interface IResponse<Schema extends IJsonSchema = IJsonSchema> { | ||
headers?: Record<string, IOperation.IParameter<Schema>>; | ||
content?: IContent<Schema>; | ||
headers?: Record<string, IOperation.IParameter<Schema>>; | ||
description?: string; | ||
@@ -524,0 +524,0 @@ "x-nestia-encrypted"?: boolean; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
724839
11553