Closed cyril265 closed 2 years ago
Hi @cyril265 ,
Can you elaborate a bit more? Would you want to skip invalid objects instead of throwing an error?
Hey @juanjoDiaz, thank you for responding!
Would you want to skip invalid objects instead of throwing an error?
Yeah, I would like to skip invalid objects without discarding the whole stream. Basically a callback validate
where the original object is passed as parameter and a boolean is returned. The object is skipped if false is returned.
But now I am thinking maybe it's better to handle this outside json2csv to avoid adding additional complexity to the library.
Is there a way to validate/skip objects? Similar to the
transforms
parameter but for validation. For example I am streaming JSON from an http request into a csv file:I tried piping the request into a "filter" but it's not straightforwarded because you need to parse the json stream.