-
-
Notifications
You must be signed in to change notification settings - Fork 111
Open
Labels
Description
I have a question similar to #306 and I wonder if there is a better solution to that after 5 years.
Basically, sometimes I get a json structure that contains a field (let's call it raw_payload) that contains more raw json without a schema. I want to just forward that raw_payload and store it in the database and/or return it in my API. I don't care what exact json is inside that field, but it needs to be valid json.
Example 1:
{
"foo": 1,
"bar": 2,
"raw_payload": [{"random": "stuff"}]
}
Example 2:
{
"foo": 1,
"bar": 2,
"raw_payload": {"even": {"more": "random", "stuff": [1,2,3] } }
}
I'd like to map that into case class Data(foo: Int, bar: Int, raw_payload: SomeRawJsonType)
What's currently the best approach to achieve that?