public static JsonNode buildTypeSchemaFromJson(String jsonText) throws IOException {
      return buildTypeSchemaFromJson(JsonSchemaValidator.getJsonNode(jsonText));
   }
@Test
   void testBuildTypeSchemaFromJson() {
      JsonNode jsonNode = null;
      ObjectMapper mapper = new ObjectMapper();

      String jsonText = "{\"foo\": \"bar\", \"flag\": true, " + "\"list\": [1, 2], " + "\"obj\": {\"fizz\": \"bar\"}, "
            + "\"objList\": [{\"number\": 1}, {\"number\": 2}]}";

      String expectedSchema = "{\"type\":\"object\",\"properties\":{\"foo\":{\"type\":\"string\"},\"flag\":{\"type\":\"boolean\"},\"list\":{\"type\":\"array\",\"items\":{\"type\":\"number\"}},\"obj\":{\"type\":\"object\",\"properties\":{\"fizz\":{\"type\":\"string\"}}},\"objList\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"number\":{\"type\":\"number\"}}}}}}";
      try {
         jsonNode = mapper.readTree(jsonText);
      } catch (Exception e) {
         fail("Exception should not occur");
      }

      JsonNode schemaNode = OpenAPISchemaBuilder.buildTypeSchemaFromJson(jsonNode);
      try {
         String actual = mapper.writeValueAsString(schemaNode);
         assertEquals(expectedSchema, actual);
      } catch (JsonProcessingException e) {
         fail("No exception should be thrown");
      }
   }