Finatra v21.5.0 Release Notes
* finatra-jackson: Do not enforce `CaseClassDeserializer` deserialization semantics for a field until after any deserializer annotation has been resolved. This fully allows a deserializer to specify how to deserialize a field completely independent of the `CaseClassDeserializer` requirements for fields. For example, if a user wanted to allow parsing of a JSON `null` value into a `null` field instance value, they could define a custom deserializer to do so and annotate the case class field with `@JsonDeserialize(using = classOf[CustomNullableDeserializer])`. Additionally, we fix a bug in how String case class fields are handled when the incoming JSON is not a String-type. The current code incorrectly returns an empty string when the field value is parsed into Jackson ContainerNode or ObjectNode types and an incorrect `toString` representation for a PojoNode type. We now correctly represent the field value as a string in these cases to deserialize into the case class field. ``PHAB_ID=D676938`` * finatra-jackson: Properly handle Scala enumeration fields wrapped in an `Option` during deserialization failures in the `CaseClassDeserializer#isScalaEnumerationType` method. ``PHAB_ID=D665062`` 🔄 Changed
🗄 finatra-kafka: Deprecate
c.t.finatra.kafka.consumers.TracingKafkaConsumeras it only produced single-span traces and there is no way to propagate the
TraceIdback to the caller without changing the entire API. Users should use the
c.t.finatra.kafka.consumers.KafkaConsumerTracer.tracemethod instead to enable tracing for Kafka Consumers. Also added
c.t.finatra.kafka.consumers.KafkaConsumerTraceAnnotatorservices which will can be used to add custom trace annotations to the producer and consumer spans.
⚡️ finatra (BREAKING API CHANGE): Update to use the new util/util-validator
ScalaValidatorfor case class field validations. We've removed the custom Finatra
c.t.finatra.validation.Validatorand instead now use the
c.t.util.validation.ScalaValidator. Constraint annotations and validator implementations now use the standard
jakarta.validationAPI interface classes instead of any custom Finatra types. We've deprecated the custom Finatra constraints as they are duplicative of already existing "standard" or otherwise provided constraints and validators. Additionally,
c.t.finatra.validation.ErrorCodeis deprecated with no replacement. The same data carried can be obtained via the standard
Adapting the Finatra framework to use the util/util-validator also includes the framework Jackson integration. We're also taking this opportunity to clean up the error reporting interface of the
CaseClassFieldMappingExceptionto define a
CaseClassFieldMappingException.Reasontype to replace the usage of the (removed)
Reasoncarries a message String as well as a
CaseClassFieldMappingException.Detailwhich can be one of several possible types including a
CaseClassFieldMappingException.ValidationErrorwhich carries any failed validation information including the emitted
Lastly, we are deprecating support for JSON serialization/deserialization of JodaTime fields in case classes. This support will be dropped in an upcoming release. Users should prefer to use the JDK 8
java.timeclasses and we will be adding support for these types in the Finatra Jackson integration in the future.
- finatra-jackson: (BREAKING API CHANGE) JsonLogging should use the lazy Scala SLF4J logger
and no longer return the passed in argument that's logged as JSON.