[generate/api] ensure that paths start with a /

This commit is contained in:
spalger
2018-05-14 11:56:45 -07:00
parent a1042f6310
commit 2925948e12

View File

@ -216,6 +216,7 @@ module.exports = function (branch, done) {
note[cmlKey] = param;
}
def.url.paths = def.url.paths.map(p => (p.startsWith('/') ? p : `/${p}`));
def.url.params = _.transform(def.url.params, transformParamKeys, {});
def.url.parts = _.transform(def.url.parts, transformParamKeys, {});