You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
conjure-java currently normalizes enum values to uppercase when deserializing, so the JSON value "one", "One", "ONE", etc will all successfully deserialize to an EnumExample.ONE (and unknown variants will be upper-cased).
This behavior isn't actually specified, however.
The text was updated successfully, but these errors were encountered:
The wire spec states that string comparison should be used when comparing enums and the language spec state that all enum values must be UPPERCASE. It follows that "ONE" is valid but "One", "one" are invalid. The documentation could probably be a little more explicit about the handling of such cases.
It does seem like you've found conjure-java being overly permissive. We should follow up with test cases in conjure-validation and then fix things up in conjure-java
conjure-java currently normalizes enum values to uppercase when deserializing, so the JSON value
"one"
,"One"
,"ONE"
, etc will all successfully deserialize to anEnumExample.ONE
(and unknown variants will be upper-cased).This behavior isn't actually specified, however.
The text was updated successfully, but these errors were encountered: