Bitbucket Cloud OpenAPI spec: workspace_access.administrator typed as string but API returns boolean

XMLWordPrintable

    • Severity 3 - Minor

      Issue Summary

      The Bitbucket Cloud OpenAPI specification declares the administrator property on the workspace_access schema as a string, but the live API for /2.0/user/workspaces returns this field as a boolean.

      Steps to Reproduce

      1. Fetch the current OpenAPI spec:
        • URL:
          https://dac-static.atlassian.com/cloud/bitbucket/swagger.v3.json?_v=2.300.154
        • In the spec, navigate to:
          components.schemas.workspace_access.properties.administrator
        • Observe that administrator is declared as:
          "administrator": {
            "type": "string",
            "description": "The permission level the user has for the workspace. \"True\" if the user is an administrator, otherwise \"False\"."
          }
      2. Call the Bitbucket Cloud API for the current user’s workspaces, for example:
        curl -sS \
          -u "${BITBUCKET_EMAIL}:${BITBUCKET_TOKEN}" \
          "https://api.bitbucket.org/2.0/user/workspaces" \
        | jq '.values[0] | { administrator, administrator_type: (.administrator | type) }'
      3. Observe the response shape. A typical result looks like:
        {
          "administrator": false,
          "administrator_type": "boolean"
        }

      Expected Results

      The OpenAPI schema should match the actual API response.
      components.schemas.workspace_access.properties.administrator should be defined as:

      "administrator": {
        "type": "boolean",
        "description": "True if the user is an administrator, otherwise false."
      }

      Actual Results

      The OpenAPI schema currently defines administrator as:

      "administrator": {
        "type": "string",
        "description": "The permission level the user has for the workspace. \"True\" if the user is an administrator, otherwise \"False\"."
      } 


      The live API (GET https://api.bitbucket.org/2.0/user/workspaces) returns:
      "administrator": true | false
      i.e. a boolean value, not a string.

      Workaround

      Currently there is no known workaround for this behavior. A workaround will be added here when available

              Assignee:
              Unassigned
              Reporter:
              Syahrul
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: