fix: APIPathGen에서 NumVar, StrVar 동작 오류
This commit is contained in:
@@ -14,16 +14,23 @@ export function APIPathGen(obj, callback, path, pathParams) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const varType = target.__nextVarType;
|
const varType = target.__nextVarType;
|
||||||
const varKey = target.__nextVarKey;
|
let varKey = target.__nextVarKey;
|
||||||
let next;
|
let next;
|
||||||
if (varType !== undefined && varKey !== undefined) {
|
if (varType !== undefined && varKey !== undefined) {
|
||||||
if (typeof key !== varType) {
|
if(varType == 'number'){
|
||||||
throw `${key} is not ${varType}`;
|
if(key != Number(key)){
|
||||||
|
throw `${key} is not ${varType}`;
|
||||||
|
}
|
||||||
|
key = Number(key);
|
||||||
|
}
|
||||||
|
else if ((typeof key) !== varType) {
|
||||||
|
throw `${key} is not ${varType}, but ${typeof key}`;
|
||||||
}
|
}
|
||||||
if(pathParams === undefined){
|
if(pathParams === undefined){
|
||||||
pathParams = {}
|
pathParams = {}
|
||||||
}
|
}
|
||||||
pathParams[varKey] = key;
|
pathParams[varKey] = key;
|
||||||
|
nextPath.pop();
|
||||||
next = target.next;
|
next = target.next;
|
||||||
}
|
}
|
||||||
else if (key in target) {
|
else if (key in target) {
|
||||||
|
|||||||
Reference in New Issue
Block a user