-
Couldn't load subscription status.
- Fork 5
Home
Welcome to the API4JSON wiki!
If you have any questions about this API, please contact:
Nathaniel Mills
c/o IBM
16 Deer Hill Ln
Coventry, CT, 06238-1235
+1 860 812 5089
[email protected]
[email protected]
The purpose of these JSON manipulation API's is to provide similar function to IBM's json4j library shipping with Liberty, but to make them available for use with Cloud Functions (e.g., in OpenWhisk) or for command line utilities, etc. You should be able to build or retrieve the jar file and change import statements from com.ibm.json.java to com.api.json.
There is one difference in behavior. In json4j, if you put values and retrieve them without serialization first, the values object retains its class. For example, checking in an Integer or Float would return an Integer or Float. However, if you then serialized and reparsed the object, the get would return a Long or Double. API4JSON is more consistent as it will only return Long or Double values for their corresponding Numeric values, regardless what was passed to the put. This should make data retrieval easier as it avoids unexpected ClassCastException errors.
I will add some JUnit test cases as soon as possible. And, I will post the jar to the maven repository so it can be retrieved via pom.xml dependencies.