3 ms·
You might expect your service to only receive a particular JSON format, but it could really receive any JSON, or any String, or any bytes, etc. At some point i
by mrkeen 6y ago
You might expect your service to only receive a particular JSON format, but it could really receive any JSON, or any String, or any bytes, etc.
At some point in the program you want to rely on your data already having been validated. HashMaps are not a good fit for this.
For me the neatest way to address both of these is to have a very narrow conversion window. Transform the data from bytes/string/hashmaps into well-typed objects only within the controller.