Skip to content

Job within a folder results in Not Found error #58

@cliffano

Description

@cliffano

When triggering a build for a job that sits under a folder, e.g.

nestor build abc/job/123 "param1=a&param2=b"

The above results in Not Found error.

The root cause for this scenario is due to "abc/job/123" is being passed to swaggy-jenkins' buildUrl which encodes the value to "abc%2Fjob%2F123"

    function buildUrl(path, pathParams, apiBasePath) {
      var _this = this;

      if (!path.match(/^\//)) {
        path = '/' + path;
      }

      var url = this.basePath + path; // use API (operation, path) base path if defined

      if (apiBasePath !== null && apiBasePath !== undefined) {
        url = apiBasePath + path;
      }

      url = url.replace(/\{([\w-\.]+)\}/g, function (fullMatch, key) {
        var value;

        if (pathParams.hasOwnProperty(key)) {
          value = _this.paramToString(pathParams[key]);
        } else {
          value = fullMatch;
        }

        return encodeURIComponent(value);
      });
      return url;

Tested with nestor 2.2.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions