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

Add support for domains #11

Open
batwad opened this issue Jan 28, 2019 · 8 comments
Open

Add support for domains #11

batwad opened this issue Jan 28, 2019 · 8 comments

Comments

@batwad
Copy link

batwad commented Jan 28, 2019

I've started using domains in my APIs but this tool cannot upload or download them

@jsfrench
Copy link
Contributor

Nobody asked for it till now!
Should be fairly straightforward to add support for this.

@jsfrench
Copy link
Contributor

jsfrench commented Feb 4, 2019

Could you describe your use case @batwad?

@batwad
Copy link
Author

batwad commented Feb 4, 2019

Could you describe your use case @batwad?

This is so I can have an offline copy of the APIs in sync with whatever's in swaggerhub.

I have a build process at the moment which uses the codegen plugin, but it means the code can't be built if swaggerhub is down (which never happens of course) or a dev is working offline. I want to build a separate build that will download the APIs and push them to our on-prem git repo, a poor man's version of your git sync integration if you like.

@octmueller
Copy link

👍

We would like to do some openapi validation on incoming requests. We don't want to connect online to swaggerhub in order to retrieve the spec plus all references.

SwaggerParser provides some nice functionality in order to facilitate this: dereference and bundle.

Maybe this plugin could use that and provide an option to have the downloaded file completely dereferenced or bundled into one big file. Otherwise you'd probably have to tweak the $ref uris, I imagine.

@jsfrench
Copy link
Contributor

jsfrench commented Feb 5, 2019

Ok, gotcha.

Yeah I think you're right @octmueller, it looks like SwaggerParser/OpenAPIParser is probably the way to go here. Maybe add an optional boolean <resolve> parameter to the plugin config.

@batwad
Copy link
Author

batwad commented Feb 5, 2019

I was hoping that a relative address would work in a $ref, thereby avoiding the problem @octmueller mentioned. But downloading a resolved version of the API would be even better.

Still, I'd like the ability to download domains so that I can mirror them in our SCM.

@VictorKrapivin
Copy link

Yes, it would be great to download resolved version of api with models included from domains

@hkosova
Copy link
Contributor

hkosova commented Mar 17, 2020

v. 1.0.8 now supports downloading and uploading domains. Use the <definitionType>domain</definitionType> configuration parameter to indicate that the target file is a domain.

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

5 participants