File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
metafacture-json/src/main/java/org/metafacture/json Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change 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 ());
You can’t perform that action at this time.
0 commit comments