swaggerhub-maven-plugin icon indicating copy to clipboard operation
swaggerhub-maven-plugin copied to clipboard

Add support for domains

Open batwad opened this issue 7 years ago • 8 comments

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

batwad avatar Jan 28 '19 10:01 batwad

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

jsfrench avatar Jan 30 '19 22:01 jsfrench

Could you describe your use case @batwad?

jsfrench avatar Feb 04 '19 10:02 jsfrench

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.

batwad avatar Feb 04 '19 13:02 batwad

:+1:

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.

octmueller avatar Feb 04 '19 16:02 octmueller

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.

jsfrench avatar Feb 05 '19 10:02 jsfrench

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.

batwad avatar Feb 05 '19 16:02 batwad

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

VictorKrapivin avatar Apr 05 '19 12:04 VictorKrapivin

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.

hkosova avatar Mar 17 '20 13:03 hkosova