Czar
11/17/2015, 12:08 PMapatrida
11/17/2015, 12:08 PMCzar
11/17/2015, 12:08 PMapatrida
11/17/2015, 12:08 PMapatrida
11/17/2015, 12:08 PM/**
give it POST `{"host":{"id":"1","name":"Czar"},"activity":"playing RPG","invited":[]}` and you'll get:
`.c.j.MappingJackson2HttpMessageConverter : Failed to evaluate deserialization for type [simple type, class controllers.Event]: com.fasterxml.jackson.databind.JsonMappingException: Argument #0 of constructor [constructor for controllers.Guest, annotations: {interface com.fasterxml.jackson.annotation.JsonCreator=@com.fasterxml.jackson.annotation.JsonCreator()}] has no property name annotation; must have name when multiple-parameter constructor annotated as Creator`
*/
apatrida
11/17/2015, 12:08 PMCzar
11/17/2015, 12:08 PMapatrida
11/17/2015, 12:09 PMapatrida
11/17/2015, 12:10 PMapatrida
11/17/2015, 12:10 PMapatrida
11/17/2015, 12:12 PMCzar
11/17/2015, 12:13 PM@JsonCreator
and @JsonProperty
makes things worse 😄
java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.introspect.AnnotatedConstructor.getContextClass()Lcom/fasterxml/jackson/databind/introspect/AnnotatedClass;
apatrida
11/17/2015, 12:15 PMapatrida
11/17/2015, 12:15 PMCzar
11/17/2015, 12:15 PMCzar
11/17/2015, 12:16 PM2.4.6
apatrida
11/17/2015, 12:18 PMCzar
11/17/2015, 12:19 PMapatrida
11/17/2015, 12:19 PM2.6.3
since usually it is mostly backwards compatibleapatrida
11/17/2015, 12:19 PMCzar
11/17/2015, 12:20 PMapatrida
11/17/2015, 12:23 PMapatrida
11/17/2015, 12:23 PMapatrida
11/17/2015, 12:23 PMapatrida
11/17/2015, 12:24 PMapatrida
11/17/2015, 12:25 PMapatrida
11/17/2015, 12:25 PMapatrida
11/17/2015, 12:26 PMapatrida
11/17/2015, 12:28 PMdata class Guest @JsonCreator constructor(
@param:JsonProperty("id") @get:JsonProperty("id") val id: String,
@param:JsonProperty("name") @get:JsonProperty("name") val name: String,
@param:JsonProperty("rsvp") @get:JsonProperty("rsvp") var rsvp: RSVP = RSVP.interested)
apatrida
11/17/2015, 12:28 PM