Allow users to download swagger file

(Agofer) #1

Is there a simple way to include “download swagger file” link on my OpenAPI documentation pages, to download the .oas2 file of this page?
thanks !

(Vincenzo Chianese) #2


in case your API is public, Stoplight provides a way to get a direct link to your file and make it available for your users to download.

All you need to do is go in your project, figure out its ID, the branch you want to expose and then construct an URL based on these informations. For instance:

I hope that helps/clarify. To get more info, you can visit our documentation section on the topic

(Agofer) #3

Thanks @vncz. I was aware of this option, but it is not good enough.
My project is private, and I share the hub with the developers. I need a way for them to be able to download the swagger files. (preferably as a link from the hub).
I was actually under the impression that once I protect the hub using username/password they will have access to the files once they log in, but I was wrong.
So I am back to square one - I can share the documentation with them, but no way to share the files.
Any suggestion?

(Vincenzo Chianese) #4

Ah ok, I see what you mean.

This feature is currently on our backlog and hopefully it’s not a big change.

We hope to work on it soon™. I’m going to ask for a status update and see if I can give you an ETA or at least an update.

(Agofer) #5

perfect @vncz. looking forward hearing about the plans.
thanks !

(Agofer) #6

Sorry to nudge :). This becomes a real issue as I need to provide access to the swagger files to our developers.
Is there any forecast?
Thanks !

(Vincenzo Chianese) #7

Hey @agofer,

We’re looking into the alternatives to make it happen. As soon I have news on this regards, I’ll make sure to post it here.

(Taylor Barnett) #8

Hey @agofer, have you checked out exporting it with a token? I talk more about it here:

(Agofer) #9

Yes, I saw it before posting my question. it is a little cumbersome IMHO.
That said, if the authentication token can be sent as a querystring parameter, then it can be a great workaround for my needs.
thanks !

(Taylor Barnett) #10

We’re working on adding this in the next sprint. So hopefully it will be a nicer experience soon.