private ResolvedClassType resolveRefs(String name, JsonNode node, Schema schema) {
    if (node.has("$ref")) {
      final String nameFromRef = nameFromRef(node.get("$ref").asText());
      Schema childSchema = ruleFactory.getSchemaStore()
        .create(schema, node.get("$ref").asText(), ruleFactory.getGenerationConfig().getRefFragmentPathDelimiters());
      JsonNode schemaNode = childSchema.getContent();
      return resolveRefs(nameFromRef != null ? nameFromRef : name, schemaNode, childSchema);
    }
    schema = schema.deriveChildSchema(node);
    return new ResolvedClassType(name, node, schema);
  }
private ResolvedClassType resolveRefs(String name, JsonNode node, Schema schema)