Details
-
Type:
Bug
-
Status: Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: Mercury
-
Fix Version/s: All Time Backlog
-
Component/s: API
-
Labels:
-
Environment:
aml-keyword-service feature/sapi-documentation branch
Description
In order to allow for XML support, there were changes made to methods in KeywordService.java, KeywordServiceProxy.java, and KeywordRestService.
Problem:
Originally, SAPI would call KeywordServiceProxy#searchKeywordLists, which would get a response from KeywordRestService#searchKeywordLists. The original method in KeywordRestService would return a QueryResponse<KeywordList>.
KeywordServiceProxy#searchKeywordLists retrieves this response and attempts to deserialize the JSON into a QueryResponse<KeywordList>. However, this deserialization caused type erasure, turning all of the lists within QueryResponse to LinkedHashMaps. Because of this, XML responses could not be generated.
Changes:
To fix this problem and support XML responses, the following changes were made:
- KeywordRestService#searchKeywordLists now returns a List<KeywordList>, not QueryResponse<KeywordList>
- A new method was created in KeywordServiceProxy, called searchKeywordListsAsList
- The original KeywordServiceProxy#searchKeywordLists was set to deprecated
- KeywordService in SAPI now calls searchKeywordListsAsList
In the feature/sapi-documentation branch, the original KeywordServiceProxy#searchKeywordLists is dead code. Should it be kept in, or should it be removed?