class SchemaGenerator {

  public Map<String, Object> generate(Class someClass) {
    Map<String, Object> result = new HashMap<>();

    if (includeSchemaReference) {
      result.put("$schema", JSON_SCHEMA_REFERENCE);
    }
    generateObjectTypeIn(result, someClass);
    if (!definedObjects.isEmpty()) {
      Map<String, Object> definitions = new TreeMap<>();
      result.put("definitions", definitions);
      for (Class<?> type : definedObjects.keySet()) {
        if (!definedObjects.get(type).equals(EXTERNAL_CLASS)) {
          definitions.put(getDefinitionKey(type), definedObjects.get(type));
        }
      }
    }

    return result;
  }

}