@Test public void createJsonSchemaFromEClassWithMandatoryStringAttribute() { EClass eClass = EcoreTestUtil.emptyEClass(ECLASS_NAME); EAttribute mandatoryStringEAttribute = EcoreTestUtil.stringEAttribute(ATTRIBUTE_NAME, 1, 1); eClass.getEStructuralFeatures().add(mandatoryStringEAttribute); final JsonNode actual = JsonSchema.from(eClass); final ObjectNode expected = Json.object( prop("type", Json.text("object")), prop("properties", Json.object( prop(ATTRIBUTE_NAME, Json.object(prop("type", Json.text("string")))))), prop("additionalProperties", Json.bool(false)), prop("required", Json.array(Collections.singletonList(ATTRIBUTE_NAME)))); 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);  }