@Test public void testRelativeRefIncludingUrlRef(@Injectable final Schema mockedModel) throws Exception { final RefFormat refFormat = RefFormat.RELATIVE; final String url = "https: final String expectedResult = "components:\n" + " schemas:\n" + " link-object:\n" + " type: object\n" + " additionalProperties:\n" + " \"$ref\": \"#/components/schemas/rel-data\"\n" + " rel-data:\n" + " type: object\n" + " required:\n" + " - href\n" + " properties:\n" + " href:\n" + " type: string\n" + " note:\n" + " type: string\n" + " result:\n" + " type: object\n" + " properties:\n" + " name:\n" + " type: string\n" + " _links:\n" + " \"$ref\": \"#/components/schemas/link-object\"\n" + ""; List<AuthorizationValue> auths = null; new Expectations() {{ RemoteUrl.urlToString(url, auths); times = 1; result = expectedResult; }}; OpenAPI mockedOpenAPI = new OpenAPI(); mockedOpenAPI.setComponents(new Components()); mockedOpenAPI.getComponents().setSchemas(new HashMap<>()); ResolverCache mockedResolverCache = new ResolverCache(mockedOpenAPI, null, null); ExternalRefProcessor processor = new ExternalRefProcessor(mockedResolverCache, mockedOpenAPI); processor.processRefToExternalSchema("./relative-with-url/relative-with-url.yaml#/relative-with-url", refFormat); assertThat(((Schema) mockedOpenAPI.getComponents().getSchemas().get("relative-with-url").getProperties().get("Foo")).get$ref(), is("https: ); assertThat(mockedOpenAPI.getComponents().getSchemas().keySet().contains("link-object"), is(true)); assertThat(mockedOpenAPI.getComponents().getSchemas().keySet().contains("rel-data"), is(true)); assertThat(((Schema) mockedOpenAPI.getComponents().getSchemas().get("relative-with-url").getProperties().get("Bar")).get$ref(), is("./relative-with-url/relative-with-local.yaml#/relative-same-file") ); }
public String processRefToExternalSchema(String $ref, RefFormat refFormat) { String renamedRef = cache.getRenamedRef($ref); if(renamedRef != null) { return renamedRef; } final Schema schema = cache.loadRef($ref, refFormat, Schema.class); if(schema == null) { LOGGER.warn("unable to load model reference from `" + $ref + "`. It may not be available " + "or the reference isn't a valid model schema"); return $ref; } String newRef; if (openAPI.getComponents() == null) { openAPI.setComponents(new Components()); } Map<String, Schema> schemas = openAPI.getComponents().getSchemas(); if (schemas == null) { schemas = new LinkedHashMap<>(); } final String possiblyConflictingDefinitionName = computeDefinitionName($ref); String tryName = null; Schema existingModel = schemas.get(possiblyConflictingDefinitionName); if (existingModel != null) { LOGGER.warn("A model for " + existingModel + " already exists"); if(existingModel.get$ref() != null) { existingModel = null; }else{ if (!schema.equals(existingModel)){ int i = 2; for (String name : schemas.keySet()) { if (name.equals(possiblyConflictingDefinitionName)) { tryName = possiblyConflictingDefinitionName + "_" + i; existingModel = schemas.get(tryName); i++; } } } } } if (StringUtils.isNotBlank(tryName)){ newRef = tryName; }else{ newRef = possiblyConflictingDefinitionName; } cache.putRenamedRef($ref, newRef); if(existingModel == null) { openAPI.getComponents().addSchemas(newRef, schema); cache.addReferencedKey(newRef); String file = $ref.split("#/")[0]; if (schema.get$ref() != null) { RefFormat ref = computeRefFormat(schema.get$ref()); if (isAnExternalRefFormat(ref)) { schema.set$ref(processRefToExternalSchema(schema.get$ref(), ref)); } else { processRefToExternalSchema(file + schema.get$ref(), RefFormat.RELATIVE); } } if(schema instanceof ComposedSchema){ ComposedSchema composedSchema = (ComposedSchema) schema; if (composedSchema.getAllOf() != null){ for(Schema item : composedSchema.getAllOf()){ if (item.get$ref() != null){ processRefSchema(item,file); } else if (item.getProperties() != null) { processProperties(item.getProperties(), file); } } }if (composedSchema.getOneOf() != null){ for(Schema item : composedSchema.getOneOf()){ if (item.get$ref() != null){ if (item.get$ref() != null){ processRefSchema(item,file); } } } }if (composedSchema.getAnyOf() != null){ for(Schema item : composedSchema.getAnyOf()){ if (item.get$ref() != null){ if (item.get$ref() != null){ processRefSchema(item,file); } } } } } Map<String, Schema> subProps = schema.getProperties(); processProperties(subProps,file); processDiscriminator(schema.getDiscriminator(),file); if(schema.getAdditionalProperties() != null && schema.getAdditionalProperties() instanceof Schema){ Schema additionalProperty = (Schema) schema.getAdditionalProperties(); if (additionalProperty.get$ref() != null) { processRefSchema(additionalProperty, file); } else if (additionalProperty instanceof ArraySchema) { ArraySchema arrayProp = (ArraySchema) additionalProperty; if (arrayProp.getItems() != null && arrayProp.getItems().get$ref() != null && StringUtils.isNotBlank(arrayProp.get$ref())) { processRefSchema(arrayProp.getItems(), file); } } else if (additionalProperty.getAdditionalProperties() != null && additionalProperty.getAdditionalProperties() instanceof Schema) { Schema mapProp = (Schema) additionalProperty.getAdditionalProperties(); if (mapProp.get$ref() != null) { processRefSchema(mapProp, file); } else if (mapProp.getAdditionalProperties() instanceof ArraySchema && ((ArraySchema) mapProp).getItems() != null && ((ArraySchema) mapProp).getItems().get$ref() != null && StringUtils.isNotBlank(((ArraySchema) mapProp).getItems().get$ref())) { processRefSchema(((ArraySchema) mapProp).getItems(), file); } } } if (schema instanceof ArraySchema && ((ArraySchema) schema).getItems() != null) { ArraySchema arraySchema = (ArraySchema) schema; if (StringUtils.isNotBlank(arraySchema.getItems().get$ref())) { processRefSchema(((ArraySchema) schema).getItems(), file); } else { processProperties(arraySchema.getItems().getProperties() ,file); } } } return newRef; }
ExternalRefProcessor { public String processRefToExternalSchema(String $ref, RefFormat refFormat) { String renamedRef = cache.getRenamedRef($ref); if(renamedRef != null) { return renamedRef; } final Schema schema = cache.loadRef($ref, refFormat, Schema.class); if(schema == null) { LOGGER.warn("unable to load model reference from `" + $ref + "`. It may not be available " + "or the reference isn't a valid model schema"); return $ref; } String newRef; if (openAPI.getComponents() == null) { openAPI.setComponents(new Components()); } Map<String, Schema> schemas = openAPI.getComponents().getSchemas(); if (schemas == null) { schemas = new LinkedHashMap<>(); } final String possiblyConflictingDefinitionName = computeDefinitionName($ref); String tryName = null; Schema existingModel = schemas.get(possiblyConflictingDefinitionName); if (existingModel != null) { LOGGER.warn("A model for " + existingModel + " already exists"); if(existingModel.get$ref() != null) { existingModel = null; }else{ if (!schema.equals(existingModel)){ int i = 2; for (String name : schemas.keySet()) { if (name.equals(possiblyConflictingDefinitionName)) { tryName = possiblyConflictingDefinitionName + "_" + i; existingModel = schemas.get(tryName); i++; } } } } } if (StringUtils.isNotBlank(tryName)){ newRef = tryName; }else{ newRef = possiblyConflictingDefinitionName; } cache.putRenamedRef($ref, newRef); if(existingModel == null) { openAPI.getComponents().addSchemas(newRef, schema); cache.addReferencedKey(newRef); String file = $ref.split("#/")[0]; if (schema.get$ref() != null) { RefFormat ref = computeRefFormat(schema.get$ref()); if (isAnExternalRefFormat(ref)) { schema.set$ref(processRefToExternalSchema(schema.get$ref(), ref)); } else { processRefToExternalSchema(file + schema.get$ref(), RefFormat.RELATIVE); } } if(schema instanceof ComposedSchema){ ComposedSchema composedSchema = (ComposedSchema) schema; if (composedSchema.getAllOf() != null){ for(Schema item : composedSchema.getAllOf()){ if (item.get$ref() != null){ processRefSchema(item,file); } else if (item.getProperties() != null) { processProperties(item.getProperties(), file); } } }if (composedSchema.getOneOf() != null){ for(Schema item : composedSchema.getOneOf()){ if (item.get$ref() != null){ if (item.get$ref() != null){ processRefSchema(item,file); } } } }if (composedSchema.getAnyOf() != null){ for(Schema item : composedSchema.getAnyOf()){ if (item.get$ref() != null){ if (item.get$ref() != null){ processRefSchema(item,file); } } } } } Map<String, Schema> subProps = schema.getProperties(); processProperties(subProps,file); processDiscriminator(schema.getDiscriminator(),file); if(schema.getAdditionalProperties() != null && schema.getAdditionalProperties() instanceof Schema){ Schema additionalProperty = (Schema) schema.getAdditionalProperties(); if (additionalProperty.get$ref() != null) { processRefSchema(additionalProperty, file); } else if (additionalProperty instanceof ArraySchema) { ArraySchema arrayProp = (ArraySchema) additionalProperty; if (arrayProp.getItems() != null && arrayProp.getItems().get$ref() != null && StringUtils.isNotBlank(arrayProp.get$ref())) { processRefSchema(arrayProp.getItems(), file); } } else if (additionalProperty.getAdditionalProperties() != null && additionalProperty.getAdditionalProperties() instanceof Schema) { Schema mapProp = (Schema) additionalProperty.getAdditionalProperties(); if (mapProp.get$ref() != null) { processRefSchema(mapProp, file); } else if (mapProp.getAdditionalProperties() instanceof ArraySchema && ((ArraySchema) mapProp).getItems() != null && ((ArraySchema) mapProp).getItems().get$ref() != null && StringUtils.isNotBlank(((ArraySchema) mapProp).getItems().get$ref())) { processRefSchema(((ArraySchema) mapProp).getItems(), file); } } } if (schema instanceof ArraySchema && ((ArraySchema) schema).getItems() != null) { ArraySchema arraySchema = (ArraySchema) schema; if (StringUtils.isNotBlank(arraySchema.getItems().get$ref())) { processRefSchema(((ArraySchema) schema).getItems(), file); } else { processProperties(arraySchema.getItems().getProperties() ,file); } } } return newRef; } }
ExternalRefProcessor { public String processRefToExternalSchema(String $ref, RefFormat refFormat) { String renamedRef = cache.getRenamedRef($ref); if(renamedRef != null) { return renamedRef; } final Schema schema = cache.loadRef($ref, refFormat, Schema.class); if(schema == null) { LOGGER.warn("unable to load model reference from `" + $ref + "`. It may not be available " + "or the reference isn't a valid model schema"); return $ref; } String newRef; if (openAPI.getComponents() == null) { openAPI.setComponents(new Components()); } Map<String, Schema> schemas = openAPI.getComponents().getSchemas(); if (schemas == null) { schemas = new LinkedHashMap<>(); } final String possiblyConflictingDefinitionName = computeDefinitionName($ref); String tryName = null; Schema existingModel = schemas.get(possiblyConflictingDefinitionName); if (existingModel != null) { LOGGER.warn("A model for " + existingModel + " already exists"); if(existingModel.get$ref() != null) { existingModel = null; }else{ if (!schema.equals(existingModel)){ int i = 2; for (String name : schemas.keySet()) { if (name.equals(possiblyConflictingDefinitionName)) { tryName = possiblyConflictingDefinitionName + "_" + i; existingModel = schemas.get(tryName); i++; } } } } } if (StringUtils.isNotBlank(tryName)){ newRef = tryName; }else{ newRef = possiblyConflictingDefinitionName; } cache.putRenamedRef($ref, newRef); if(existingModel == null) { openAPI.getComponents().addSchemas(newRef, schema); cache.addReferencedKey(newRef); String file = $ref.split("#/")[0]; if (schema.get$ref() != null) { RefFormat ref = computeRefFormat(schema.get$ref()); if (isAnExternalRefFormat(ref)) { schema.set$ref(processRefToExternalSchema(schema.get$ref(), ref)); } else { processRefToExternalSchema(file + schema.get$ref(), RefFormat.RELATIVE); } } if(schema instanceof ComposedSchema){ ComposedSchema composedSchema = (ComposedSchema) schema; if (composedSchema.getAllOf() != null){ for(Schema item : composedSchema.getAllOf()){ if (item.get$ref() != null){ processRefSchema(item,file); } else if (item.getProperties() != null) { processProperties(item.getProperties(), file); } } }if (composedSchema.getOneOf() != null){ for(Schema item : composedSchema.getOneOf()){ if (item.get$ref() != null){ if (item.get$ref() != null){ processRefSchema(item,file); } } } }if (composedSchema.getAnyOf() != null){ for(Schema item : composedSchema.getAnyOf()){ if (item.get$ref() != null){ if (item.get$ref() != null){ processRefSchema(item,file); } } } } } Map<String, Schema> subProps = schema.getProperties(); processProperties(subProps,file); processDiscriminator(schema.getDiscriminator(),file); if(schema.getAdditionalProperties() != null && schema.getAdditionalProperties() instanceof Schema){ Schema additionalProperty = (Schema) schema.getAdditionalProperties(); if (additionalProperty.get$ref() != null) { processRefSchema(additionalProperty, file); } else if (additionalProperty instanceof ArraySchema) { ArraySchema arrayProp = (ArraySchema) additionalProperty; if (arrayProp.getItems() != null && arrayProp.getItems().get$ref() != null && StringUtils.isNotBlank(arrayProp.get$ref())) { processRefSchema(arrayProp.getItems(), file); } } else if (additionalProperty.getAdditionalProperties() != null && additionalProperty.getAdditionalProperties() instanceof Schema) { Schema mapProp = (Schema) additionalProperty.getAdditionalProperties(); if (mapProp.get$ref() != null) { processRefSchema(mapProp, file); } else if (mapProp.getAdditionalProperties() instanceof ArraySchema && ((ArraySchema) mapProp).getItems() != null && ((ArraySchema) mapProp).getItems().get$ref() != null && StringUtils.isNotBlank(((ArraySchema) mapProp).getItems().get$ref())) { processRefSchema(((ArraySchema) mapProp).getItems(), file); } } } if (schema instanceof ArraySchema && ((ArraySchema) schema).getItems() != null) { ArraySchema arraySchema = (ArraySchema) schema; if (StringUtils.isNotBlank(arraySchema.getItems().get$ref())) { processRefSchema(((ArraySchema) schema).getItems(), file); } else { processProperties(arraySchema.getItems().getProperties() ,file); } } } return newRef; } ExternalRefProcessor(ResolverCache cache, OpenAPI openAPI); }
ExternalRefProcessor { public String processRefToExternalSchema(String $ref, RefFormat refFormat) { String renamedRef = cache.getRenamedRef($ref); if(renamedRef != null) { return renamedRef; } final Schema schema = cache.loadRef($ref, refFormat, Schema.class); if(schema == null) { LOGGER.warn("unable to load model reference from `" + $ref + "`. It may not be available " + "or the reference isn't a valid model schema"); return $ref; } String newRef; if (openAPI.getComponents() == null) { openAPI.setComponents(new Components()); } Map<String, Schema> schemas = openAPI.getComponents().getSchemas(); if (schemas == null) { schemas = new LinkedHashMap<>(); } final String possiblyConflictingDefinitionName = computeDefinitionName($ref); String tryName = null; Schema existingModel = schemas.get(possiblyConflictingDefinitionName); if (existingModel != null) { LOGGER.warn("A model for " + existingModel + " already exists"); if(existingModel.get$ref() != null) { existingModel = null; }else{ if (!schema.equals(existingModel)){ int i = 2; for (String name : schemas.keySet()) { if (name.equals(possiblyConflictingDefinitionName)) { tryName = possiblyConflictingDefinitionName + "_" + i; existingModel = schemas.get(tryName); i++; } } } } } if (StringUtils.isNotBlank(tryName)){ newRef = tryName; }else{ newRef = possiblyConflictingDefinitionName; } cache.putRenamedRef($ref, newRef); if(existingModel == null) { openAPI.getComponents().addSchemas(newRef, schema); cache.addReferencedKey(newRef); String file = $ref.split("#/")[0]; if (schema.get$ref() != null) { RefFormat ref = computeRefFormat(schema.get$ref()); if (isAnExternalRefFormat(ref)) { schema.set$ref(processRefToExternalSchema(schema.get$ref(), ref)); } else { processRefToExternalSchema(file + schema.get$ref(), RefFormat.RELATIVE); } } if(schema instanceof ComposedSchema){ ComposedSchema composedSchema = (ComposedSchema) schema; if (composedSchema.getAllOf() != null){ for(Schema item : composedSchema.getAllOf()){ if (item.get$ref() != null){ processRefSchema(item,file); } else if (item.getProperties() != null) { processProperties(item.getProperties(), file); } } }if (composedSchema.getOneOf() != null){ for(Schema item : composedSchema.getOneOf()){ if (item.get$ref() != null){ if (item.get$ref() != null){ processRefSchema(item,file); } } } }if (composedSchema.getAnyOf() != null){ for(Schema item : composedSchema.getAnyOf()){ if (item.get$ref() != null){ if (item.get$ref() != null){ processRefSchema(item,file); } } } } } Map<String, Schema> subProps = schema.getProperties(); processProperties(subProps,file); processDiscriminator(schema.getDiscriminator(),file); if(schema.getAdditionalProperties() != null && schema.getAdditionalProperties() instanceof Schema){ Schema additionalProperty = (Schema) schema.getAdditionalProperties(); if (additionalProperty.get$ref() != null) { processRefSchema(additionalProperty, file); } else if (additionalProperty instanceof ArraySchema) { ArraySchema arrayProp = (ArraySchema) additionalProperty; if (arrayProp.getItems() != null && arrayProp.getItems().get$ref() != null && StringUtils.isNotBlank(arrayProp.get$ref())) { processRefSchema(arrayProp.getItems(), file); } } else if (additionalProperty.getAdditionalProperties() != null && additionalProperty.getAdditionalProperties() instanceof Schema) { Schema mapProp = (Schema) additionalProperty.getAdditionalProperties(); if (mapProp.get$ref() != null) { processRefSchema(mapProp, file); } else if (mapProp.getAdditionalProperties() instanceof ArraySchema && ((ArraySchema) mapProp).getItems() != null && ((ArraySchema) mapProp).getItems().get$ref() != null && StringUtils.isNotBlank(((ArraySchema) mapProp).getItems().get$ref())) { processRefSchema(((ArraySchema) mapProp).getItems(), file); } } } if (schema instanceof ArraySchema && ((ArraySchema) schema).getItems() != null) { ArraySchema arraySchema = (ArraySchema) schema; if (StringUtils.isNotBlank(arraySchema.getItems().get$ref())) { processRefSchema(((ArraySchema) schema).getItems(), file); } else { processProperties(arraySchema.getItems().getProperties() ,file); } } } return newRef; } ExternalRefProcessor(ResolverCache cache, OpenAPI openAPI); String processRefToExternalSchema(String $ref, RefFormat refFormat); PathItem processRefToExternalPathItem(String $ref, RefFormat refFormat); String processRefToExternalResponse(String $ref, RefFormat refFormat); String processRefToExternalRequestBody(String $ref, RefFormat refFormat); String processRefToExternalHeader(String $ref, RefFormat refFormat); String processRefToExternalSecurityScheme(String $ref, RefFormat refFormat); String processRefToExternalLink(String $ref, RefFormat refFormat); String processRefToExternalExample(String $ref, RefFormat refFormat); String processRefToExternalParameter(String $ref, RefFormat refFormat); String processRefToExternalCallback(String $ref, RefFormat refFormat); static String join(String source, String fragment); }
ExternalRefProcessor { public String processRefToExternalSchema(String $ref, RefFormat refFormat) { String renamedRef = cache.getRenamedRef($ref); if(renamedRef != null) { return renamedRef; } final Schema schema = cache.loadRef($ref, refFormat, Schema.class); if(schema == null) { LOGGER.warn("unable to load model reference from `" + $ref + "`. It may not be available " + "or the reference isn't a valid model schema"); return $ref; } String newRef; if (openAPI.getComponents() == null) { openAPI.setComponents(new Components()); } Map<String, Schema> schemas = openAPI.getComponents().getSchemas(); if (schemas == null) { schemas = new LinkedHashMap<>(); } final String possiblyConflictingDefinitionName = computeDefinitionName($ref); String tryName = null; Schema existingModel = schemas.get(possiblyConflictingDefinitionName); if (existingModel != null) { LOGGER.warn("A model for " + existingModel + " already exists"); if(existingModel.get$ref() != null) { existingModel = null; }else{ if (!schema.equals(existingModel)){ int i = 2; for (String name : schemas.keySet()) { if (name.equals(possiblyConflictingDefinitionName)) { tryName = possiblyConflictingDefinitionName + "_" + i; existingModel = schemas.get(tryName); i++; } } } } } if (StringUtils.isNotBlank(tryName)){ newRef = tryName; }else{ newRef = possiblyConflictingDefinitionName; } cache.putRenamedRef($ref, newRef); if(existingModel == null) { openAPI.getComponents().addSchemas(newRef, schema); cache.addReferencedKey(newRef); String file = $ref.split("#/")[0]; if (schema.get$ref() != null) { RefFormat ref = computeRefFormat(schema.get$ref()); if (isAnExternalRefFormat(ref)) { schema.set$ref(processRefToExternalSchema(schema.get$ref(), ref)); } else { processRefToExternalSchema(file + schema.get$ref(), RefFormat.RELATIVE); } } if(schema instanceof ComposedSchema){ ComposedSchema composedSchema = (ComposedSchema) schema; if (composedSchema.getAllOf() != null){ for(Schema item : composedSchema.getAllOf()){ if (item.get$ref() != null){ processRefSchema(item,file); } else if (item.getProperties() != null) { processProperties(item.getProperties(), file); } } }if (composedSchema.getOneOf() != null){ for(Schema item : composedSchema.getOneOf()){ if (item.get$ref() != null){ if (item.get$ref() != null){ processRefSchema(item,file); } } } }if (composedSchema.getAnyOf() != null){ for(Schema item : composedSchema.getAnyOf()){ if (item.get$ref() != null){ if (item.get$ref() != null){ processRefSchema(item,file); } } } } } Map<String, Schema> subProps = schema.getProperties(); processProperties(subProps,file); processDiscriminator(schema.getDiscriminator(),file); if(schema.getAdditionalProperties() != null && schema.getAdditionalProperties() instanceof Schema){ Schema additionalProperty = (Schema) schema.getAdditionalProperties(); if (additionalProperty.get$ref() != null) { processRefSchema(additionalProperty, file); } else if (additionalProperty instanceof ArraySchema) { ArraySchema arrayProp = (ArraySchema) additionalProperty; if (arrayProp.getItems() != null && arrayProp.getItems().get$ref() != null && StringUtils.isNotBlank(arrayProp.get$ref())) { processRefSchema(arrayProp.getItems(), file); } } else if (additionalProperty.getAdditionalProperties() != null && additionalProperty.getAdditionalProperties() instanceof Schema) { Schema mapProp = (Schema) additionalProperty.getAdditionalProperties(); if (mapProp.get$ref() != null) { processRefSchema(mapProp, file); } else if (mapProp.getAdditionalProperties() instanceof ArraySchema && ((ArraySchema) mapProp).getItems() != null && ((ArraySchema) mapProp).getItems().get$ref() != null && StringUtils.isNotBlank(((ArraySchema) mapProp).getItems().get$ref())) { processRefSchema(((ArraySchema) mapProp).getItems(), file); } } } if (schema instanceof ArraySchema && ((ArraySchema) schema).getItems() != null) { ArraySchema arraySchema = (ArraySchema) schema; if (StringUtils.isNotBlank(arraySchema.getItems().get$ref())) { processRefSchema(((ArraySchema) schema).getItems(), file); } else { processProperties(arraySchema.getItems().getProperties() ,file); } } } return newRef; } ExternalRefProcessor(ResolverCache cache, OpenAPI openAPI); String processRefToExternalSchema(String $ref, RefFormat refFormat); PathItem processRefToExternalPathItem(String $ref, RefFormat refFormat); String processRefToExternalResponse(String $ref, RefFormat refFormat); String processRefToExternalRequestBody(String $ref, RefFormat refFormat); String processRefToExternalHeader(String $ref, RefFormat refFormat); String processRefToExternalSecurityScheme(String $ref, RefFormat refFormat); String processRefToExternalLink(String $ref, RefFormat refFormat); String processRefToExternalExample(String $ref, RefFormat refFormat); String processRefToExternalParameter(String $ref, RefFormat refFormat); String processRefToExternalCallback(String $ref, RefFormat refFormat); static String join(String source, String fragment);  }