conjure-typescript
Advanced tools
Comparing version 3.8.1 to 3.8.2
@@ -135,2 +135,3 @@ "use strict"; | ||
}); | ||
var pathParamsFromPath = parsePathParamsFromPath(endpointDefinition.httpPath); | ||
if (bodyArgs.length > 1) { | ||
@@ -168,3 +169,3 @@ throw Error("endpoint cannot have more than one body arg, found: " + bodyArgs.length); | ||
writer.write("pathArguments: ["); | ||
pathArgNames.forEach(function (pathArgName) { return writer.indent().writeLine(pathArgName + ","); }); | ||
pathParamsFromPath.forEach(function (pathArgName) { return writer.indent().writeLine(pathArgName + ","); }); | ||
writer.writeLine("],"); | ||
@@ -186,2 +187,11 @@ writer.write("queryArguments: {"); | ||
} | ||
function parsePathParamsFromPath(httpPath) { | ||
// first fix up the path to remove any ':.+' stuff in path params | ||
var fixedPath = httpPath.replace(/{(.*):[^}]*}/, "{$1}"); | ||
// follow-up by just pulling out any path segment with a starting '{' and trailing '}' | ||
return fixedPath | ||
.split("/") | ||
.filter(function (segment) { return segment.startsWith("{") && segment.endsWith("}"); }) | ||
.map(function (segment) { return segment.slice(1, -1); }); | ||
} | ||
//# sourceMappingURL=serviceGenerator.js.map |
{ | ||
"name": "conjure-typescript", | ||
"version": "3.8.1", | ||
"version": "3.8.2", | ||
"description": "A conjure generator for Typescript", | ||
@@ -5,0 +5,0 @@ "bin": { |
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
151246
2084