aboutsummaryrefslogtreecommitdiffstats
path: root/gson/src/main/java/org/onap/policy/common/gson/GsonMessageBodyHandler.java
AgeCommit message (Collapse)AuthorFilesLines
2019-04-11Don't map JSON values to DoubleJim Hahn1-9/+6
By default, gson treats all numbers as Double when placed into a generic Map. This is not backward compatible with existing policy APIs. Added a type adapter that walks Map objects and converts the Double values to Integer or Long, where possible. Made this the default behavior in the GsonMessageBodyHandler, the JacksonHandler, and the StandardCoder. Also fixed a couple of checkstyle errors in the gson project. Change-Id: I9ac0c77e6592d1c039646f0662c077b77a1e9aaf Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-03-14Add support for TOSCA JSON Parsingliamfallon1-1/+6
Added a getter to allow the Gson object to be retrieved from a GSON message body handler, useful for testing. Moved the TextFileUtils utility class from APEX utilites to policy common utils Issue-ID: POLICY-1195 Change-Id: I7c8074e8177a90b292c6dfd6e7f0d352063818e7 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-02-22Log which gson style is being usedJim Hahn1-0/+6
Different gson providers may be used for REST APIs. Updated the code to identify which was being used. Change-Id: I8ffbda7409142ec728e217a87c9bcba3c34b814b Issue-ID: POLICY-1428 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-02-13Refactor common class from gson codeJim Hahn1-2/+1
The TypeAdapters in the gson-jackson code were nearly identical, so a common class was factored out. This also enabled junit tests to attain 100% coverage on that code, whereas there were a couple of branches that could not be tested previously. Addressed new sonar issues. Removed unused import. Change-Id: Id8e6460c881c6ce0239768f182e4e652cd10645f Issue-ID: POLICY-1428 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-02-12Fix sonar issues in gson superclassesJim Hahn1-3/+6
Fixing some of the issues necessitated the use of generic/raw types. Removed version from assertj in pom. Removed trailing spaces. Change-Id: I76e0a05ca06c103ccc876675be04a4ab5e4de5ea Issue-ID: POLICY-1428 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-02-08Add superclasses for gson-jackson migrationJim Hahn1-0/+124
Added common classes needed by other gson-jackson code. Modified some logic to make it more maintainable or perform better. Updated comments and spacing. Fix another comment. Moved gson classes from utils to a separate gson project. Added GsonXxx annotations to mirror jackson annotations. Removed unneeded dependencies from gson pom. Removed old GsonMessage class from policy-endpoints. Removed trailing spaces. Updated licenses. Removed more trailing spaces. Removed unneeded checkstyle suppression file from utils. Change-Id: I1a285500faeb0a0b6a1467d09b92ecd3cded713e Issue-ID: POLICY-1428 Signed-off-by: Jim Hahn <jrh3@att.com>