private String getResultantSchema(String schemaText, Map<String, SchemaParsingState> schemaParsingStates) throws InvalidSchemaException, SchemaNotFoundException { Map<String, Schema> complexTypes = traverseIncludedSchemaTypes(schemaText, schemaParsingStates); Schema.Parser parser = new Schema.Parser(); parser.addTypes(complexTypes); Schema schema = parser.parse(schemaText); Set<String> visitingTypes = new HashSet<>(); Schema updatedSchema = handleUnionFieldsWithNull(schema, visitingTypes); return (schema == updatedSchema && complexTypes.isEmpty()) ? schemaText : updatedSchema.toString(); }
private String getResultantSchema(String schemaText, Map<String, SchemaParsingState> schemaParsingStates) throws InvalidSchemaException, SchemaNotFoundException { Map<String, Schema> complexTypes = traverseIncludedSchemaTypes(schemaText, schemaParsingStates); Schema.Parser parser = new Schema.Parser(); parser.addTypes(complexTypes); Schema schema = parser.parse(schemaText); Set<String> visitingTypes = new HashSet<>(); Schema updatedSchema = handleUnionFieldsWithNull(schema, visitingTypes); return (schema == updatedSchema && complexTypes.isEmpty()) ? schemaText : updatedSchema.toString(); }
Schema updatedFieldSchema = handleUnionFieldsWithNull(fieldSchema, visitingTypes); if (fieldSchema != updatedFieldSchema) { hasUnionType = true;
Schema updatedFieldSchema = handleUnionFieldsWithNull(fieldSchema, visitingTypes); if (fieldSchema != updatedFieldSchema) { hasUnionType = true;