@Test public void createJsonSchemaFromEClassWithOptionalMultiReference() { EClass eClass = EcoreFactory.eINSTANCE.createEClass(); eClass.setName(ECLASS_NAME); EClass refClass = EcoreFactory.eINSTANCE.createEClass(); refClass.setName(ECLASS_NAME + "2"); EReference eReference = EcoreTestUtil.eReference(REFERENCE_NAME, -1, 10, refClass); eClass.getEStructuralFeatures().add(eReference); final JsonNode actual = JsonSchema.from(eClass); final ObjectNode expected = Json.object( prop("type", Json.text("object")), prop("properties", Json.object( prop(REFERENCE_NAME, Json.object( prop("type", Json.text("array")), prop("items", Json.object( prop("type", Json.text("object")), prop("properties", Json.object()), prop("additionalProperties", Json.bool(false)))))) )), prop("additionalProperties", Json.bool(false))); assertEquals(expected, actual); }
public static JsonNode from(final EClass eClass) { final JsonSchema conversion = new JsonSchema(); return conversion.createJsonSchema(eClass); }
JsonSchema { public static JsonNode from(final EClass eClass) { final JsonSchema conversion = new JsonSchema(); return conversion.createJsonSchema(eClass); } }
JsonSchema { public static JsonNode from(final EClass eClass) { final JsonSchema conversion = new JsonSchema(); return conversion.createJsonSchema(eClass); }  }
JsonSchema { public static JsonNode from(final EClass eClass) { final JsonSchema conversion = new JsonSchema(); return conversion.createJsonSchema(eClass); }  static JsonNode from(final EClass eClass); }
JsonSchema { public static JsonNode from(final EClass eClass) { final JsonSchema conversion = new JsonSchema(); return conversion.createJsonSchema(eClass); }  static JsonNode from(final EClass eClass);  }