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 45
45
*/
46
46
@ Description ("Validate JSON against a given schema, send only valid input to the receiver. Pass the schema location to validate against. " +
47
47
"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`. " +
49
49
"Set the JSON key for the record ID value with `idKey` (for logging output, defaults to `id`)." )
50
50
@ In (String .class )
51
51
@ Out (String .class )
@@ -101,10 +101,8 @@ public void setIdKey(final String idKey) {
101
101
102
102
@ Override
103
103
public void process (final String json ) {
104
- final JSONObject object ;
105
104
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 */ );
108
106
}
109
107
catch (final JSONException e ) {
110
108
handleInvalid (json , null , e .getMessage ());
You can’t perform that action at this time.
0 commit comments