Open nmiyake opened 6 years ago
This is also an issue for field names:
java.lang.RuntimeException: com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize Map key of type `com.palantir.conjure.parser.types.names.FieldName` from String "Name": not a valid representation, problem: (java.lang.reflect.InvocationTargetException) null
at [Source: UNKNOWN; line: -1, column: -1] (through reference chain: com.palantir.conjure.parser.ImmutableConjureSourceFile$Json["types"]->com.palantir.conjure.parser.types.ImmutableTypesDefinition$Json["definitions"]->com.palantir.conjure.parser.types.ImmutableNamedTypesDefinition$Json["objects"]->java.util.LinkedHashMap["Feature"]->com.palantir.conjure.parser.types.complex.ImmutableObjectTypeDefinition$Json["fields"])
The error should instead clearly indicate that field names cannot start with an uppercase letter.
Got bit by this again today
The CLI properly generates an IR for the following input YAML:
However, when the object type name is changed to
ExampleA
:The CLI fails with the following output:
The output message in the exception is "Can not construct Map key of type com.palantir.conjure.parser.types.names.TypeName from String ("ExampleA"): not a valid representation: null" -- this does not make it clear at all why this name failed.
The failure should be more along the lines of
"ExampleA" is not a valid type name: type names be PascalCase and cannot contain 1-letter words
or"ExampleA" is not a valid type name: type names must match regular expression ...