bhardwajrahul20 commented on a change in pull request #1: Sling-7346-Json
response converting response property value to string even if it is json object
URL:
https://github.com/apache/sling-org-apache-sling-servlets-post/pull/1#discussion_r159596372
##########
File path: src/main/java/org/apache/sling/servlets/post/JSONResponse.java
##########
@@ -103,9 +104,13 @@ JsonObject getJson() {
JsonObjectBuilder jsonBuilder = Json.createObjectBuilder();
for (Map.Entry<String, Object> entry : json.entrySet()) {
if (entry.getValue() != null) {
- jsonBuilder.add(entry.getKey(), entry.getValue().toString());
- }
- else {
+ try {
Review comment:
@kwin - That's difficult because the class type of entry value is not always
javax json. If I am not too wrong, it can as well be
org.apache.sling.commons.json.JSONObject or com.google.gson.JsonObject. We
can't really restrict the end user to only javax json or can we?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services