@samchon/openapi
Advanced tools
Comparing version 0.1.23-dev.20240626-3 to 0.1.23-dev.20240626-4
@@ -5,2 +5,3 @@ import { OpenApi } from "./OpenApi"; | ||
path: string; | ||
emendedPath: string; | ||
accessor: string[]; | ||
@@ -7,0 +8,0 @@ parameters: IMigrateOperation.IParameter[]; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.MigrateConverter = void 0; | ||
const StringUtil_1 = require("../utils/StringUtil"); | ||
const MigrateOperationConverter_1 = require("./MigrateOperationConverter"); | ||
@@ -20,2 +21,3 @@ const MigrateOperationNamespacer_1 = require("./MigrateOperationNamespacer"); | ||
path, | ||
emendedPath: StringUtil_1.StringUtil.reJoinWithDecimalParameters(path), | ||
original, | ||
@@ -22,0 +24,0 @@ }); |
@@ -8,2 +8,3 @@ import { IMigrateOperation } from "../IMigrateOperation"; | ||
path: string; | ||
emendedPath: string; | ||
original: OpenApi.IOperation; | ||
@@ -10,0 +11,0 @@ } |
@@ -124,5 +124,5 @@ "use strict"; | ||
//---- | ||
const parameterNames = StringUtil_1.StringUtil.splitWithNormalization(props.path) | ||
.filter((str) => str[0] === "{" || str[0] === ":") | ||
.map((str) => str[0] === "{" ? str.substring(1, str.length - 1) : str.substring(1)); | ||
const parameterNames = StringUtil_1.StringUtil.splitWithNormalization(props.emendedPath) | ||
.filter((str) => str[0] === ":") | ||
.map((str) => str.substring(1)); | ||
const pathParameters = ((_f = props.original.parameters) !== null && _f !== void 0 ? _f : []).filter((p) => p.in === "path"); | ||
@@ -150,4 +150,5 @@ if (parameterNames.length !== pathParameters.length) | ||
return { | ||
method: props.method, | ||
path: props.path, | ||
method: props.method, | ||
emendedPath: props.emendedPath, | ||
accessor: ["@lazy"], | ||
@@ -154,0 +155,0 @@ headers: headers |
@@ -10,5 +10,5 @@ "use strict"; | ||
MigrateOperationNamespacer.overwrite = (operations) => { | ||
const dict = collect((op) => op.path | ||
const dict = collect((op) => op.emendedPath | ||
.split("/") | ||
.filter((str) => !!str.length && !(str[0] === "{" && str[str.length - 1] === "}")) | ||
.filter((str) => !!str.length && str[0] !== ":") | ||
.map(StringUtil_1.StringUtil.normalize) | ||
@@ -15,0 +15,0 @@ .map((str) => (Escaper_1.Escaper.variable(str) ? str : `_${str}`)))(operations); |
{ | ||
"name": "@samchon/openapi", | ||
"version": "0.1.23-dev.20240626-3", | ||
"version": "0.1.23-dev.20240626-4", | ||
"description": "OpenAPI definitions and converters for 'typia' and 'nestia'.", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
@@ -5,3 +5,4 @@ import { OpenApi } from "./OpenApi"; | ||
method: "head" | "get" | "post" | "put" | "patch" | "delete"; | ||
path: string; // emended path | ||
path: string; | ||
emendedPath: string; | ||
accessor: string[]; // function accessor | ||
@@ -8,0 +9,0 @@ parameters: IMigrateOperation.IParameter[]; // path parameters |
import { IMigrateOperation } from "../IMigrateOperation"; | ||
import { IMigrationResult } from "../IMigrationResult"; | ||
import { OpenApi } from "../OpenApi"; | ||
import { Escaper } from "../utils/Escaper"; | ||
import { StringUtil } from "../utils/StringUtil"; | ||
import { MigrateOperationConverter } from "./MigrateOperationConverter"; | ||
import { MigrateOperationNamespacer } from "./MigrateOperationNamespacer"; | ||
import { OpenApiTypeChecker } from "./OpenApiTypeChecker"; | ||
@@ -26,2 +24,3 @@ export namespace MigrateConverter { | ||
path, | ||
emendedPath: StringUtil.reJoinWithDecimalParameters(path), | ||
original, | ||
@@ -28,0 +27,0 @@ }); |
@@ -12,2 +12,3 @@ import { IMigrateOperation } from "../IMigrateOperation"; | ||
path: string; | ||
emendedPath: string; | ||
original: OpenApi.IOperation; | ||
@@ -168,8 +169,6 @@ } | ||
const parameterNames: string[] = StringUtil.splitWithNormalization( | ||
props.path, | ||
props.emendedPath, | ||
) | ||
.filter((str) => str[0] === "{" || str[0] === ":") | ||
.map((str) => | ||
str[0] === "{" ? str.substring(1, str.length - 1) : str.substring(1), | ||
); | ||
.filter((str) => str[0] === ":") | ||
.map((str) => str.substring(1)); | ||
const pathParameters: OpenApi.IOperation.IParameter[] = ( | ||
@@ -207,4 +206,5 @@ props.original.parameters ?? [] | ||
return { | ||
method: props.method, | ||
path: props.path, | ||
method: props.method, | ||
emendedPath: props.emendedPath, | ||
accessor: ["@lazy"], | ||
@@ -211,0 +211,0 @@ headers: headers |
@@ -9,8 +9,5 @@ import { IMigrateOperation } from "../IMigrateOperation"; | ||
const dict: Map<string, IElement> = collect((op) => | ||
op.path | ||
op.emendedPath | ||
.split("/") | ||
.filter( | ||
(str) => | ||
!!str.length && !(str[0] === "{" && str[str.length - 1] === "}"), | ||
) | ||
.filter((str) => !!str.length && str[0] !== ":") | ||
.map(StringUtil.normalize) | ||
@@ -17,0 +14,0 @@ .map((str) => (Escaper.variable(str) ? str : `_${str}`)), |
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
299914
7431