agave-metadata/metadata-core/src/main/java/org/iplantc/service/metadata/search/JsonHandler.java
/**
     * Validate given JsonNode against the schemaId
     *
     * @deprecated
     */
Validate given JsonNode against the schemaId
@deprecated
Validate given JsonNode against the schemaId @deprecated
public String validateValueAgainstSchema(String value, String schema) throws
            MetadataSchemaValidationException {
        try {
            JsonFactory factory = mapper.getFactory();
            JsonNode jsonSchemaNode = factory.createParser(schema).readValueAsTree();
            JsonNode jsonMetadataNode = factory.createParser(value).readValueAsTree();
            AgaveJsonValidator validator = AgaveJsonSchemaFactory.byDefault().getValidator();
            ProcessingReport report = validator.validate(jsonSchemaNode, jsonMetadataNode);
            if (!report.isSuccess()) {
                StringBuilder sb = new StringBuilder();
                for (ProcessingMessage processingMessage : report) {
                    sb.append(processingMessage.toString());
                    sb.append("\n");
                }
                throw new MetadataSchemaValidationException("Metadata does not conform to schema.");
            }
            return value;
        } catch (Exception e) {
            throw new MetadataSchemaValidationException("Metadata does not conform to schema.");
        }
    }
public String validateValueAgainstSchema ( String value , String schema ) throws MetadataSchemaValidationException { try { JsonFactory factory = mapper . getFactory ( ) ; JsonNode jsonSchemaNode = factory . createParser ( schema ) . readValueAsTree ( ) ; JsonNode jsonMetadataNode = factory . createParser ( value ) . readValueAsTree ( ) ; AgaveJsonValidator validator = AgaveJsonSchemaFactory . byDefault ( ) . getValidator ( ) ; ProcessingReport report = validator . validate ( jsonSchemaNode , jsonMetadataNode ) ; if ( ! report . isSuccess ( ) ) { StringBuilder sb = new StringBuilder ( ) ; for ( ProcessingMessage processingMessage : report ) { sb . append ( processingMessage . toString ( ) ) ; sb . append ( "\n" ) ; } throw new MetadataSchemaValidationException ( "Metadata does not conform to schema." ) ; } return value ; } catch ( Exception e ) { throw new MetadataSchemaValidationException ( "Metadata does not conform to schema." ) ; } }
Validate given JsonNode against the schemaId
 @deprecated
Validate given JsonNode against the schemaId @deprecated