3 ms·
In general sure. However, in a specific case, I find local types useful to do that for code that makes JSON requests to another service. You could care that th
by lesuorac 2y ago
In general sure.
However, in a specific case, I find local types useful to do that for code that makes JSON requests to another service. You could care that the request has a certain intermediate structure but serialization is fairly deterministic so I don't see an advantage of that over just testing you send a HTTP request with a valid (String) body.
If you control that endpoint then it would make sense so share that type between them but if you don't then might as well make the type scoped to just that method.