CybercentreCanada / assemblyline-java-client

Java client for Assemblyline V4
MIT License
3 stars 0 forks source link

Remove ObjectMapper parameter from AssemblylineClient constructor #136

Open cccs-mk opened 11 months ago

cccs-mk commented 11 months ago

Given the limited scope and constrained usage of the ObjectMapper in AssemblylineClient, it might make sense to just construct a brand new instance instead of accepting one as a parameter.

Coming from a different angle: What configuration changes by users are we trying to support by accepting a pre-configured ObjectMapper?

Originally posted by @cccs-mk in https://github.com/CybercentreCanada/assemblyline-java-client/issues/26#issuecomment-916327760

cccs-mk commented 11 months ago

The use cases I can think of for having an externally-configurable ObjectMapper feel fairly niche:

cccs-mk commented 11 months ago

Maybe it would be sufficient to just add new constructor that doesn't accept an ObjectMapper (and then create an instance ourselves).

We could add documentation to the old constructor that says something like, "It's up to you to provide an ObjectMapper that works." At that point, though, does it still make sense for AssemblylineClient to do any configuration of the mapper?

cccs-mk commented 11 months ago

I've marked the ObjectMapper-accepting constructor as deprecated. It's probably safe to remove, but I don't know exactly how other people are using this library.