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

Java codegen fails to create an Any class for swagger specs with an "any" type #997

Closed
elibixby opened this issue Jul 22, 2015 · 7 comments

Comments

@elibixby
Copy link

As an example you can run codegen on https://github.com/GoogleCloudPlatform/kubernetes/blob/master/api/swagger-spec/v1.json

@wing328
Copy link
Contributor

wing328 commented Jul 22, 2015

According to swagger spec, there's no type named "any".

@elibixby
Copy link
Author

  1. It's a 1.2 spec
  2. It is an entry in the "type" field of which "any" is a valid value as a String, however, "any" is not created elsewhere in the spec. Additionally, the spec validates against the 1.2 swagger spec

@wing328
Copy link
Contributor

wing328 commented Jul 23, 2015

@elibixby According to swagger spec 1.2, there's no type named "any" either.

Do you expect "any" to be a class named "Any" without any properties in the generated code?

@wing328
Copy link
Contributor

wing328 commented Jul 23, 2015

@elibixby I think it's a known issue as documented by the owner of kubernetes:

kubernetes/kubernetes#4700

@elibixby
Copy link
Author

@wing328 Thanks! I missed that issue I guess!

@wing328
Copy link
Contributor

wing328 commented Jul 28, 2015

@elibixby As a workaround, you can do a find & replace for "any" with "object". I can generate code without exception using this approach.

@elibixby
Copy link
Author

@wing328 Thanks, yeah I ended up replacing it with Map<String,String> and it seems to work fine.

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