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

[gnostic-go-generator] Generated names for non-200 responses do not compile #74

Closed
sslavic opened this issue Dec 28, 2017 · 1 comment
Closed

Comments

@sslavic
Copy link

sslavic commented Dec 28, 2017

As by https://swagger.io/docs/specification/describing-responses/

An API specification needs to specify the responses for all API operations. Each operation must have at least one response defined, usually a successful response. A response is defined by its HTTP status code and the data returned in the response body and/or headers.

https://github.com/googleapis/gnostic/blob/master/plugins/gnostic-go-generator/language.go#L89 handles well only "200" response by using OK as field name. For all other responses, response code is being used as field name and since response codes are numbers they do not satisfy Go's requirement that variable names have to start with a letter. So types.go and client.go get generated with syntax errors.

timburks added a commit that referenced this issue Jan 26, 2018
This commit addresses these issues:
	#74
	#73

Disclaimer: gnostic-go-generator is a demo plugin;
many OpenAPI features remain unsupported.
@timburks
Copy link
Contributor

timburks commented Feb 2, 2018

Thanks for posting this. An update that addresses it was just merged to master.

@timburks timburks closed this as completed Feb 2, 2018
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

2 participants