Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Job within a folder results in Not Found error #58

Open
cliffano opened this issue Jun 15, 2022 · 1 comment
Open

Job within a folder results in Not Found error #58

cliffano opened this issue Jun 15, 2022 · 1 comment

Comments

@cliffano
Copy link
Owner

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

@cliffano
Copy link
Owner Author

cliffano commented Jun 27, 2022

This is temporarily fixed ad-hoc-ly in swaggy-jenkins 2.0.1 https://github.com/cliffano/swaggy-jenkins/releases/tag/2.0.1 , which is used in nestor 2.2.2.

Keeping this ticket open until I can put in long-term fix in swaggy-jenkins (will require openapi-generator patch).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant