I am in process of updating and older backend using MongoDB-scala 4.7 and am tinkering with using codec macros for mapping to/from Document and case class. Current solution is using json to and from documents and is working well.
It appears that the macro fromProviders works well and handles Some/None but I am unable to get it to work in instance where one of the case class fields is a list which can be empty - all I get is messages can’t be found where case class is
Contrived example case class (All four cases classes are included in setting up Codec.
case class ModuleUpates(
device: Option[DeviceUpates] = None,
messages: List[MessageUpdates] = Nil,
firmwareUpdates: Option[FirmwareUpdates] = None)
If device or firmwareUpdates work as expected whether field is set or not, but if messages is not present then I get error message that field messages is missing.
Appreciate any input.