Skip to content

The api:validate subcommand doesn't work from a bash script in an Azure DevOps pipeline #253

@edugarias

Description

@edugarias
  • CLI version: 0.6.1
  • OS: Linux (Ubuntu 20.04)
  • Node.js version: 16.x
  • SwaggerHub version if On-Premise: 1.29.1-89

Describe the bug you're encountering

When trying to validate an API from a bash task in an Azure DevOps deployment pipeline using the following command:
swaggerhub api:validate {SWAGGERHUB_ORGANIZATION}/{API_NAME}/{API_VERSION}

It fails with this output error:
Error: request to https://{SERVER}/v1/apis/{OWNER}/{API}/{VERSION}/validation failed, reason: Parse Error: Invalid header value char

Note: the above command fails even when a direct call to the validation operation from the same pipeline via curl using the same parameters works correctly.

To reproduce...

Steps to reproduce the behavior:

  1. Given
    A deployment pipeline in Azure DevOps Services (Microsoft-hosted agent) using an Ubuntu virtual machine image
    An on-premise (reachable) instance of SwaggerHub that has API Standardization enabled
    An API specification to be validated
    A bash script to run the API validation command from the pipeline

  2. Execute command 'swaggerhub api:validate {SWAGGERHUB_ORGANIZATION}/{API_NAME}/{API_VERSION}'

  3. See error
    Error: request to https://SERVER/v1/apis/OWNER/API/VERSION/validation failed, reason: Parse Error: Invalid header value char

Expected behavior

The command should validate the API and print the relevant validation messages as output.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions