Uploaded image for project: 'Jira Align'
  1. Jira Align
  2. JIRAALIGN-2117

[JIRAALIGN-2117] API 2.0: Swagger renders cURL calls with double quotes, which don't work on Unix based command prompts

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • 10.99.0
    • 10.80
    • REST API
    • Severity 3 - Minor
    • Breakers - WT1
    • No

      Issue Summary

      Swagger renders cURL calls with double quotes which only work on Windows command prompts. Users must adjust to use apostrophes (instead of double quotes) in order to run curl statements on unix based command prompts (e.g. on a Mac).

      curl -X GET "https://uat.agilecraft.xyz/rest/align/api/2/Products?filter=title%20eq%20%27Er1Product%27" -H "accept: application/json;odata.metadata=minimal;odata.streaming=true" -H "Authorization: bearer MyObfuscatedToken"

      Steps to Reproduce

      1. Browse to Swagger
      2. Authorise a token
      3. Expand any endpoint
      4. Click Try out button
      5. Provide any details (if necessary)
      6. Click Execute button
      7. Notice the cURL statement

      Expected Results

      Swagger should be updated to let users know that cURL calls with double quotes only work on Windows command prompts. Users must adjust to use apostrophes (instead of double quotes) in order to run curl statements on unix based command prompts (e.g. on a Mac).

      Actual Results

      • The presented URL statement does not work from a MacOS console.

      Workaround

      1. Edit the provided cURL statement and replace all double quotes with apostrophes, like the example below:
        Swagger Provided Edited Statement
        curl -X GET "https://uat.agilecraft.xyz/rest/align/api/2/Products?filter=title%20eq%20%27Er1Product%27" -H "accept: application/json;odata.metadata=minimal;odata.streaming=true" -H "Authorization: bearer MyObfuscatedToken"
        curl -X GET 'https://uat.agilecraft.xyz/rest/align/api/2/Products?filter=title%20eq%20%27Er1Product%27' -H "accept: application/json;odata.metadata=minimal;odata.streaming=true" -H 'Authorization: bearer MyObfuscatedToken'

            kforeman@atlassian.com Kyle Foreman
            fd18f17e9ccb align-connector-bot
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: