Skip to content

Commit 43989af

Browse files
committed
Add missing space in @Description, inline JSONObject (#443)
1 parent 4a4d537 commit 43989af

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

metafacture-json/src/main/java/org/metafacture/json/JsonValidator.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
*/
4646
@Description("Validate JSON against a given schema, send only valid input to the receiver. Pass the schema location to validate against. " +
4747
"Set `schemaRoot` for resolving sub-schemas referenced in `$id` or `$ref` (defaults to the classpath root: `/`). " +
48-
"Write valid and/or invalid output to locations specified with `writeValid` and `writeInvalid`." +
48+
"Write valid and/or invalid output to locations specified with `writeValid` and `writeInvalid`. " +
4949
"Set the JSON key for the record ID value with `idKey` (for logging output, defaults to `id`).")
5050
@In(String.class)
5151
@Out(String.class)
@@ -101,10 +101,8 @@ public void setIdKey(final String idKey) {
101101

102102
@Override
103103
public void process(final String json) {
104-
final JSONObject object;
105104
try {
106-
object = new JSONObject(json); // throws JSONException on syntax error
107-
validate(json, object);
105+
validate(json, new JSONObject(json) /* throws JSONException on syntax error */);
108106
}
109107
catch (final JSONException e) {
110108
handleInvalid(json, null, e.getMessage());

0 commit comments

Comments
 (0)