Schema extends ElementDefinitions<SchemaEntityDefinition, SchemaEdgeDefinition> implements Cloneable { public byte[] toCompactJson() throws SchemaException { return toJson(false, "description"); } Schema(); protected  Schema(final Map<String, TypeDefinition> types); static Schema fromJson(final InputStream... inputStreams); static Schema fromJson(final Path... filePaths); static Schema fromJson(final byte[]... jsonBytes); @Deprecated String getId(); @Deprecated void setId(final String id); @SuppressWarnings("CloneDoesntCallSuperClone") @SuppressFBWarnings(value = "CN_IDIOM_NO_SUPER_CALL", justification = "Uses toJson instead.") @Override Schema clone(); @JsonIgnore boolean isAggregationEnabled(); @JsonIgnore List<String> getAggregatedGroups(); ValidationResult validate(); boolean hasValidation(); Map<String, TypeDefinition> getTypes(); TypeDefinition getType(final String typeName); @JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.PROPERTY, property = "class") Serialiser getVertexSerialiser(); @Deprecated @JsonIgnore String getVertexSerialiserClass(); @Override SchemaElementDefinition getElement(final String group); String getVisibilityProperty(); @Deprecated String getTimestampProperty(); Map<String, String> getConfig(); String getConfig(final String key); void addConfig(final String key, final String value); @Override String toString(); byte[] toCompactJson();  }
@Test public void shouldDeserialiseAndReserialiseIntoTheSameJson() throws SerialisationException { final byte[] json1 = schema.toCompactJson(); final Schema schema2 = new Schema.Builder().json(json1).build(); final byte[] json2 = schema2.toCompactJson(); JsonAssert.assertEquals(json1, json2); }
@Test public void shouldSerialiseToCompactJson() { final String compactJson = new String(schema.toCompactJson()); assertFalse(compactJson.contains("description")); assertFalse(compactJson.contains(String.format("%n"))); }