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

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

Open
edugarias opened this issue May 31, 2022 · 0 comments

Comments

@edugarias
Copy link

edugarias commented May 31, 2022

  • 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.

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