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 downloading resolved specs #44

Open
olensmar opened this issue Jul 3, 2019 · 4 comments
Open

Add support for downloading resolved specs #44

olensmar opened this issue Jul 3, 2019 · 4 comments
Assignees

Comments

@olensmar
Copy link

olensmar commented Jul 3, 2019

My OAS3 spec references a domain - when downloading I would like to get that resolved in the same way as the "Export/Download API/JSON/YAML Resolved" menu actions in SwaggerHub

@andrii-ashomok
Copy link

andrii-ashomok commented Jul 4, 2019

I found workaround using swagger-codegen-maven-plugin with:

					<id>spec-generator</id>
					<goals>
						<goal>generate</goal>
					</goals>
					<configuration>
						<inputSpec>${swaggerhub.apis.host}/${portal-api.apis.owner}/${portal.api.name}/${portal.api.version}</inputSpec>
						<!-- If the API is private or uses private domains, specify your SwaggerHub API key -->
						<auth>Authorization: ${swaggerhub.apis.token}</auth>
						<!-- Use 'openapi-yaml' to get resolved YAML or 'openapi' to get resolved JSON -->
						<language>openapi-yaml</language>
						<!-- Default is ${project.build.directory}/generated-sources/swagger -->
						<output>${codegen.directory}</output>

						<configOptions>
							<!-- Default file name is openapi.yaml or openapi.json -->
							<outputFile>${portal.app.swagger.file}</outputFile>
						</configOptions>
					</configuration>
				</execution>

@michaelmelody91
Copy link
Contributor

@olensmar I have to agree with @scorpioA on this one. As part of our backend services, we use the swaggerhub-maven-plugin in conjunction with the swagger-codegen-maven-plugin. Firstly to download the unresolved definition and then to use that for generation.

This plugin is in essence a wrapper of the SwaggerHub API. At this time, there is no API available to download resolved definitions.

I'll close this issue unless there are any objections?

@michaelmelody91 michaelmelody91 self-assigned this Jul 16, 2019
@olensmar
Copy link
Author

thanks @michaelmelodysmartbear - i'm fine with that workaround for now - although I think we should revisit this if we start seeing external usage of the plugin for other purposes than running the downloaded spec through codegen!

@michaelmelody91
Copy link
Contributor

@olensmar I've came to the realization that you were right in creating this issue! Currently facing my own issues with unresolved definitions...

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

3 participants