From 43989affc1f9e62e6e5751f2f2b322b9262d71a8 Mon Sep 17 00:00:00 2001 From: Fabian Steeg Date: Thu, 22 Sep 2022 11:05:06 +0200 Subject: [PATCH] Add missing space in `@Description`, inline JSONObject (#443) --- .../src/main/java/org/metafacture/json/JsonValidator.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/metafacture-json/src/main/java/org/metafacture/json/JsonValidator.java b/metafacture-json/src/main/java/org/metafacture/json/JsonValidator.java index ed99265f..3b603aff 100644 --- a/metafacture-json/src/main/java/org/metafacture/json/JsonValidator.java +++ b/metafacture-json/src/main/java/org/metafacture/json/JsonValidator.java @@ -45,7 +45,7 @@ */ @Description("Validate JSON against a given schema, send only valid input to the receiver. Pass the schema location to validate against. " + "Set `schemaRoot` for resolving sub-schemas referenced in `$id` or `$ref` (defaults to the classpath root: `/`). " + - "Write valid and/or invalid output to locations specified with `writeValid` and `writeInvalid`." + + "Write valid and/or invalid output to locations specified with `writeValid` and `writeInvalid`. " + "Set the JSON key for the record ID value with `idKey` (for logging output, defaults to `id`).") @In(String.class) @Out(String.class) @@ -101,10 +101,8 @@ public void setIdKey(final String idKey) { @Override public void process(final String json) { - final JSONObject object; try { - object = new JSONObject(json); // throws JSONException on syntax error - validate(json, object); + validate(json, new JSONObject(json) /* throws JSONException on syntax error */); } catch (final JSONException e) { handleInvalid(json, null, e.getMessage());