@accelbyte/codegen 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -454,7 +454,7 @@ class ParserUtils {
|
|
|
454
454
|
} else {
|
|
455
455
|
const currentPrerelease = semver.prerelease(currentSemver);
|
|
456
456
|
if (currentPrerelease) {
|
|
457
|
-
nextSemver += `-${currentPrerelease}`;
|
|
457
|
+
nextSemver += `-${currentPrerelease.join(".")}`;
|
|
458
458
|
}
|
|
459
459
|
nextSemver = semver.inc(nextSemver, "prerelease", void 0, prereleaseId);
|
|
460
460
|
}
|
|
@@ -538,6 +538,9 @@ class ParserUtils {
|
|
|
538
538
|
*/
|
|
539
539
|
${content}`;
|
|
540
540
|
};
|
|
541
|
+
static sortPathParamsByPath = (pathParams, path2) => {
|
|
542
|
+
return pathParams.sort((a, b) => path2.indexOf(a.name) - path2.indexOf(b.name));
|
|
543
|
+
};
|
|
541
544
|
}
|
|
542
545
|
const mappedMethod = (httpMethod, isForm) => {
|
|
543
546
|
if (httpMethod === "get") {
|
|
@@ -710,7 +713,8 @@ const templateMethod = ({
|
|
|
710
713
|
let methodParamsNoTypes = "";
|
|
711
714
|
let newPath = `'${path}'`;
|
|
712
715
|
let importStatements = [];
|
|
713
|
-
|
|
716
|
+
const sortedPathParams = ParserUtils.sortPathParamsByPath(pathParams, path);
|
|
717
|
+
for (const pathParam of sortedPathParams) {
|
|
714
718
|
const type = ParserUtils.parseType(pathParam);
|
|
715
719
|
if (pathParam.name !== "namespace") {
|
|
716
720
|
methodParams += pathParam.name + `:${type}, `;
|