agave-metadata/metadata-core/src/main/java/org/iplantc/service/metadata/util/ServiceUtils.java
/**
	 * Escapes {@code $ref} fields in serialized json schema objects
	 * with their unicode values for persisting in MongoDB.
	 * 
	 * @param json
	 * @return
	 */
Escapes  $ref fields in serialized json schema objects
with their unicode values for persisting in MongoDB.

@param json
@return
Escapes $ref fields in serialized json schema objects with their unicode values for persisting in MongoDB . @param json @return
public static String escapeSchemaRefFieldNames(String json) {
		String escapedRef = MongoDBSafeKey.escapeFieldName("$ref");
		String escapedSchema = MongoDBSafeKey.escapeFieldName("$schema");
    	return StringUtils.replace(StringUtils.replace(json, "$ref", escapedRef), "$schema", escapedSchema);
	}
public static String escapeSchemaRefFieldNames ( String json ) { String escapedRef = MongoDBSafeKey . escapeFieldName ( "$ref" ) ; String escapedSchema = MongoDBSafeKey . escapeFieldName ( "$schema" ) ; return StringUtils . replace ( StringUtils . replace ( json , "$ref" , escapedRef ) , "$schema" , escapedSchema ) ; }
Escapes {@code $ref} fields in serialized json schema objects
 with their unicode values for persisting in MongoDB.
Escapes { @code $ref } fields in serialized json schema objects with their unicode values for persisting in MongoDB .