fieldParser returns null if no defaultValue is specified, jsonParser returns the "best match". (If best match really is needed sometimes, maybe make that a parameter for both instead.)
It may also be advisable to have both functions return Options instead of tossing any nulls around at all, because otherwise there's not really a way to distinguish between a null in the datum / JSON and non-existence of the path.
Moreover, the defaultValue for fieldParser should probably be of type Any. And once we make the switch to the jsonParser, we could use tuktu.api.utils.AnyToJsValue to convert it for the jsonParser.
fieldParser returns null if no defaultValue is specified, jsonParser returns the "best match". (If best match really is needed sometimes, maybe make that a parameter for both instead.)
It may also be advisable to have both functions return Options instead of tossing any nulls around at all, because otherwise there's not really a way to distinguish between a null in the datum / JSON and non-existence of the path.
Moreover, the defaultValue for fieldParser should probably be of type Any. And once we make the switch to the jsonParser, we could use tuktu.api.utils.AnyToJsValue to convert it for the jsonParser.