SmartBear / swaggerhub-cli

SwaggerHub CLI
Apache License 2.0
51 stars 14 forks source link

Default yaml version #362

Closed Angel0926 closed 1 year ago

Angel0926 commented 1 year ago

HI. How i can take default yaml swagger version https://swaggerhub.organisation.com/v1/apis/company/myapi/????/swagger.yaml. What i can add instead of ?????

CalemRoelofsSB commented 1 year ago

Hi @Angel0926 are you looking do this using the CLI?

If so, using swaggerhub api:get company/myapi without the [VERSION] paramter as outlined in the documentation here will pull the default version of the API from SwaggerHub.

Angel0926 commented 1 year ago

@CalemRoelofsSB i use it i this script oasdiff breaking "can/target/generated/openapi.yaml" "https://swaggerhub.company.com/v1/apis/company/myapi/0.1.0-ci.2345/swagger.yaml" --fail-on ERR and i want use latest or default swagger version instead of 0.1.0-ci.2345

CalemRoelofsSB commented 1 year ago

@Angel0926 I'm not familiar with that tool, but assuming that it lets you use local file paths, the easiest thing to do here would be to download the file using the CLI and save it locally with something like:

swaggerhub api:get company/myapi > myapi-latest.yaml
oasdiff "canary-api/target/generated/openapi.yaml"  "./myapi-latest.yaml" 

We don't currently have a direct link available to pull the YAML file for the default version without the version being specified, but the CLI does provide this functionality to save you trying to do this manually through CURL or something similar.

Angel0926 commented 1 year ago

swaggerhub myapi:get company/myapi > myapi-latest.yaml oasdiff breaking "can/target/generated/openapi.yaml" "./myapi-latest.yaml" but file myapi-latest.yaml is empty

CalemRoelofsSB commented 1 year ago

swaggerhub myapi:get company/myapi > myapi-latest.yaml

This should be swaggerhub *api:get* as opposed to *myapi:get*, refer to the above comment.

Angel0926 commented 1 year ago

yes) swaggerhub api:get company/myapi > myapi-latest.yaml oasdiff breaking "can/target/generated/openapi.yaml" "./myapi-latest.yaml" but file myapi-latest.yaml is empty

Angel0926 commented 1 year ago

i try only swaggerhub api:get company/myapi > myapi-latest.yaml , but that say Error: Please verify that the configured SwaggerHub URL is correct.

mhiggins-SA commented 1 year ago

SwaggerHub cli for On-premise needs /v1 on the end, the URL for SaaS is api.swaggerhub.com NOT app.swaggerhub.com.

Mise le meas

Micheál Higgins | Senior Solutions Architect m: +353.86.235.4599 e: @.**@.> @.***https://smartbear.com/

smartbear.comhttps://www.smartbear.com/ @.https://www.facebook.com/smartbear @. https://www.linkedin.com/company/smartbear @. https://twitter.com/SmartBear @. https://www.youtube.com/channel/UC3iDZqrLWQZ4dh8zn2rU9hA

From: ANJELA @.> Sent: Wednesday, September 13, 2023 1:48 PM To: SmartBear/swaggerhub-cli @.> Cc: Subscribed @.***> Subject: Re: [SmartBear/swaggerhub-cli] Default yaml version (Issue #362)

i try only swaggerhub api:get company/myapi > myapi-latest.yaml , but that say Error: Please verify that the configured SwaggerHub URL is correct.

— Reply to this email directly, view it on GitHubhttps://github.com/SmartBear/swaggerhub-cli/issues/362#issuecomment-1717563974, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ANMNL5WIKWNTTGY64GDBW7LX2GTOXANCNFSM6AAAAAA4WDP5SA. You are receiving this because you are subscribed to this thread.Message ID: @.**@.>>

We hope you found this email of interest; however, click here if you wish to unsubscribehttp://www2.smartbear.com/SubscriptionCenter.html?utm_source=outlook&utm_medium=email&utm_content=emailsig or manage your email preferences. Privacy Policy.https://smartbear.com/privacy/

Disclaimer

The information contained in this communication from the sender is confidential. It is intended solely for use by the recipient and others authorized to receive it. If you are not the recipient, you are hereby notified that any disclosure, copying, distribution or taking action in relation of the contents of this information is strictly prohibited and may be unlawful.

Angel0926 commented 1 year ago

i dont understant what should i write and where ?

CalemRoelofsSB commented 1 year ago

@Angel0926 from the looks of it you haven't configured the CLI properly for SwaggerHub On-Premise, please refer to the documentation in the README regarding swaggerhub configure and Additional configuration for SwaggerHub On-Premise

CalemRoelofsSB commented 1 year ago

Hi @Angel0926, we mainly just deal with issues with the SwaggerHub CLI tool in this repo. For general questions about OpenAPI schemas and related topics, I invite you to come over to our community site at https://community.smartbear.com/t5/SwaggerHub/ct-p/SwaggerHub :)