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
com.fasterxml.jackson.databind.JsonMappingException: No Object Id found for an instance of Student, to assign to property '@id'
at [Source: student_yaml.yml; line: 3, column: 7]
at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:270)
at com.fasterxml.jackson.databind.DeserializationContext.reportUnresolvedObjectId(DeserializationContext.java:1259)
at com.fasterxml.jackson.databind.deser.impl.PropertyValueBuffer.handleIdValue(PropertyValueBuffer.java:241)
at com.fasterxml.jackson.databind.deser.impl.PropertyBasedCreator.build(PropertyBasedCreator.java:143)
at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeUsingPropertyBased(BeanDeserializer.java:471)
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1198)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:314)
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeWithObjectId(BeanDeserializerBase.java:1168)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:146)
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3798)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2740)
at JacksonTester.main(JacksonTester.java:50)
So for this, when attempting to use the YAML anchor notation, it doesn't seem to be recognized. Everything works fine when I make Student stop using JsonCreator (and make the fields public, of course), or change student_yaml.yml to
---
'@id': 1
name: "billy"
age: 5
The text was updated successfully, but these errors were encountered:
Java code:
student_yaml.yml:
Runtime Error:
So for this, when attempting to use the YAML anchor notation, it doesn't seem to be recognized. Everything works fine when I make Student stop using JsonCreator (and make the fields public, of course), or change student_yaml.yml to
The text was updated successfully, but these errors were encountered: