Closed finci-square closed 2 years ago
HttpResponse
and HttpRequest
have TreeMap as a property of https://github.com/square/square-java-sdk/blob/72737e98a6463184c2031629c6f6389c7ab924e4/src/main/java/com/squareup/square/http/Headers.java
Why would the implementation use TreeMap? Is it important that the header order is preserved?
All of the java response models, e.g.
SearchOrdersResponse
contain anHttpContext
HttpContext
containsHttpRequest
andHttpResponse
which both containsHeaders
instances which are not serializable.This is very strange because for all other intents and purposes, the response models are themselves exact representations of the vanilla JSON that they are deserialized from.
We should consider using the
@JsonIgnore
annotation in every*Response
class on theHttpContext
getter such that the*Response
classes are serializable back to their source JSON.