Skip to content

Commit

Permalink
Extend custom error extension
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman Lovakov authored and jmartisk committed Aug 28, 2024
1 parent 4a397dc commit 3ea8019
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,12 @@ private void populateCustomExtensions(JsonObjectBuilder objectBuilder, Map<Strin
|| (config.getErrorExtensionFields().isPresent()
&& config.getErrorExtensionFields().get().contains(entry.getKey()))) {
Object value = entry.getValue();
addKeyValue(objectBuilder, entry.getKey(), value != null ? value.toString() : null);
if (value instanceof JsonValue)
addKeyValue(objectBuilder, entry.getKey(), (JsonValue) value);
else if (value instanceof Map)
addKeyValue(objectBuilder, entry.getKey(), JSON_PROVIDER.createObjectBuilder((Map) value).build());
else
addKeyValue(objectBuilder, entry.getKey(), value != null ? value.toString() : null);
}
}
}
Expand Down

0 comments on commit 3ea8019

Please sign in to comment.