There's always a way :)
"Pulling default from the class" sounds like runtime reflection work or macro work to me - neither is a simple task if you don't have any prior experience with it.
There seems to be a reflection solution here which you may be able to adapt: How do I access default parameter values via Scala reflection?
But that has runtime performance cost and may impact your expected deserialization speed.
I would recommend going with the defaultValues
map and creating apply
methods on the companion object that handle the default value logic. It will get the job done.