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

Generated enum valueOf method is incorrectly case-insensitive #134

Closed
sfackler opened this issue Dec 11, 2018 · 6 comments
Closed

Generated enum valueOf method is incorrectly case-insensitive #134

sfackler opened this issue Dec 11, 2018 · 6 comments

Comments

@sfackler
Copy link
Member

The valueOf method generated for enums (which is also used for deserialization) upper-cases input, in violation of the conjure spec.

https://github.com/palantir/conjure-java/blob/develop/conjure-java-core/src/integrationInput/java/com/palantir/product/EnumExample.java#L60-L71

@sfackler
Copy link
Member Author

palantir/conjure#184

@markelliot
Copy link
Contributor

I think the case-insensitivity here is reasonably desirable and likely hard to remove without a major break (and I'm not sure it's worth a major break).

@sfackler
Copy link
Member Author

Should this be a spec update instead then?

I don't really see where this behavior is providing all that much value - nothing else in the code we generate is case insensitive (field names etc).

@markelliot
Copy link
Contributor

I'd prefer a spec update -- we added this leniency at the request of early adopters.

More broadly, we might want to consider allowing unions to contain 'null' object values and dropping enums, as they're a subset of the functionality of unions.

@carterkozak
Copy link
Contributor

Could you expand upon the rationale for supporting mixed case strings? Are we certain the concerns raised by early adopters are still relevant? I'd appreciate if you could link me to that discussion.

@iamdanfox
Copy link
Contributor

Discussion moved to palantir/conjure#193

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

4 participants