diff --git a/a2a/src/main/java/com/google/adk/a2a/converters/PartConverter.java b/a2a/src/main/java/com/google/adk/a2a/converters/PartConverter.java index a0f9026a7..0b5ea5503 100644 --- a/a2a/src/main/java/com/google/adk/a2a/converters/PartConverter.java +++ b/a2a/src/main/java/com/google/adk/a2a/converters/PartConverter.java @@ -33,7 +33,8 @@ */ public final class PartConverter { private static final Logger logger = LoggerFactory.getLogger(PartConverter.class); - private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); + private static final ObjectMapper objectMapper = new ObjectMapper(); + // Constants for metadata types. By convention metadata keys are prefixed with "adk_" to align // with the Python and Golang libraries. public static final String A2A_DATA_PART_METADATA_TYPE_KEY = "adk_type"; @@ -172,7 +173,7 @@ private static Optional convertDataPartToGenAiPart( } try { - String json = OBJECT_MAPPER.writeValueAsString(data); + String json = objectMapper.writeValueAsString(data); return Optional.of(com.google.genai.types.Part.builder().text(json).build()); } catch (JsonProcessingException e) { logger.warn("Failed to serialize DataPart payload", e); @@ -254,7 +255,7 @@ public static Optional> fromGenaiPart(Part part) { return Optional.empty(); } - @SuppressWarnings("unchecked") // safe conversion from OBJECT_MAPPER.readValue + @SuppressWarnings("unchecked") // safe conversion from objectMapper.readValue private static Map coerceToMap(Object value) { if (value == null) { return new HashMap<>(); @@ -272,7 +273,7 @@ private static Map coerceToMap(Object value) { return new HashMap<>(); } try { - return OBJECT_MAPPER.readValue(str, Map.class); + return objectMapper.readValue(str, Map.class); } catch (JsonProcessingException e) { logger.warn("Failed to parse map from string payload", e); Map fallback = new HashMap<>(); diff --git a/core/src/main/java/com/google/adk/examples/ExampleUtils.java b/core/src/main/java/com/google/adk/examples/ExampleUtils.java index 92ebf2859..b806dbd81 100644 --- a/core/src/main/java/com/google/adk/examples/ExampleUtils.java +++ b/core/src/main/java/com/google/adk/examples/ExampleUtils.java @@ -50,7 +50,7 @@ public final class ExampleUtils { private static final String FUNCTION_RESPONSE_PREFIX = "```tool_outputs\n"; private static final String FUNCTION_RESPONSE_SUFFIX = "\n```\n"; - private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); + private static final ObjectMapper objectMapper = new ObjectMapper(); /** * Converts a list of examples into a formatted few-shot prompt string. @@ -140,7 +140,7 @@ private static void appendFunctionResponse(FunctionResponse response, StringBuil Object responseMap = response.response().orElse(ImmutableMap.of()); builder .append(FUNCTION_RESPONSE_PREFIX) - .append(OBJECT_MAPPER.writeValueAsString(responseMap)) + .append(objectMapper.writeValueAsString(responseMap)) .append(FUNCTION_RESPONSE_SUFFIX); } catch (JsonProcessingException e) { builder.append(FUNCTION_RESPONSE_PREFIX).append(FUNCTION_RESPONSE_SUFFIX); diff --git a/core/src/main/java/com/google/adk/flows/llmflows/RequestConfirmationLlmRequestProcessor.java b/core/src/main/java/com/google/adk/flows/llmflows/RequestConfirmationLlmRequestProcessor.java index 6d582e615..e00c0093d 100644 --- a/core/src/main/java/com/google/adk/flows/llmflows/RequestConfirmationLlmRequestProcessor.java +++ b/core/src/main/java/com/google/adk/flows/llmflows/RequestConfirmationLlmRequestProcessor.java @@ -51,7 +51,7 @@ public class RequestConfirmationLlmRequestProcessor implements RequestProcessor { private static final Logger logger = LoggerFactory.getLogger(RequestConfirmationLlmRequestProcessor.class); - private static final ObjectMapper OBJECT_MAPPER = JsonBaseModel.getMapper(); + private static final ObjectMapper objectMapper = JsonBaseModel.getMapper(); private static final String ORIGINAL_FUNCTION_CALL = "originalFunctionCall"; @Override @@ -177,7 +177,7 @@ private Optional getOriginalFunctionCall(FunctionCall functionCall } try { FunctionCall originalFunctionCall = - OBJECT_MAPPER.convertValue( + objectMapper.convertValue( functionCall.args().get().get(ORIGINAL_FUNCTION_CALL), FunctionCall.class); if (originalFunctionCall.id().isEmpty()) { return Optional.empty(); @@ -229,14 +229,14 @@ private static Optional> maybeCreateToolConf return Optional.of( Map.entry( functionResponse.id().get(), - OBJECT_MAPPER.convertValue(responseMap, ToolConfirmation.class))); + objectMapper.convertValue(responseMap, ToolConfirmation.class))); } try { return Optional.of( Map.entry( functionResponse.id().get(), - OBJECT_MAPPER.readValue( + objectMapper.readValue( (String) responseMap.get("response"), ToolConfirmation.class))); } catch (JsonProcessingException e) { logger.error("Failed to parse tool confirmation response", e); diff --git a/core/src/main/java/com/google/adk/tools/FunctionCallingUtils.java b/core/src/main/java/com/google/adk/tools/FunctionCallingUtils.java index 2e94da9a0..eec115127 100644 --- a/core/src/main/java/com/google/adk/tools/FunctionCallingUtils.java +++ b/core/src/main/java/com/google/adk/tools/FunctionCallingUtils.java @@ -45,7 +45,7 @@ public final class FunctionCallingUtils { private static final Logger logger = LoggerFactory.getLogger(FunctionCallingUtils.class); - private static final ObjectMapper OBJECT_MAPPER = JsonBaseModel.getMapper(); + private static final ObjectMapper objectMapper = JsonBaseModel.getMapper(); /** Holds the state during a single schema generation process to handle caching and recursion. */ private static class SchemaGenerationContext { @@ -162,7 +162,7 @@ private static Schema buildSchemaFromParameter(Parameter param) { * @throws IllegalArgumentException if a type is encountered that cannot be serialized by Jackson. */ public static Schema buildSchemaFromType(Type type) { - return buildSchemaRecursive(OBJECT_MAPPER.constructType(type), new SchemaGenerationContext()); + return buildSchemaRecursive(objectMapper.constructType(type), new SchemaGenerationContext()); } /** @@ -217,7 +217,7 @@ private static Schema buildSchemaRecursive(JavaType javaType, SchemaGenerationCo } builder.enum_(enumValues).type("STRING").format("enum"); } else { // POJO - if (!OBJECT_MAPPER.canSerialize(rawClass)) { + if (!objectMapper.canSerialize(rawClass)) { throw new IllegalArgumentException( "Unsupported type: " + rawClass.getName() @@ -226,7 +226,7 @@ private static Schema buildSchemaRecursive(JavaType javaType, SchemaGenerationCo + " directly."); } BeanDescription beanDescription = - OBJECT_MAPPER.getSerializationConfig().introspect(javaType); + objectMapper.getSerializationConfig().introspect(javaType); Map properties = new LinkedHashMap<>(); List required = new ArrayList<>(); for (BeanPropertyDefinition property : beanDescription.findProperties()) { diff --git a/core/src/main/java/com/google/adk/tools/FunctionTool.java b/core/src/main/java/com/google/adk/tools/FunctionTool.java index 8cbc5d6f8..b856c2435 100644 --- a/core/src/main/java/com/google/adk/tools/FunctionTool.java +++ b/core/src/main/java/com/google/adk/tools/FunctionTool.java @@ -44,7 +44,7 @@ public class FunctionTool extends BaseTool { private static final Logger logger = LoggerFactory.getLogger(FunctionTool.class); - private static final ObjectMapper OBJECT_MAPPER = JsonBaseModel.getMapper(); + private static final ObjectMapper objectMapper = JsonBaseModel.getMapper(); private final @Nullable Object instance; private final Method func; @@ -241,17 +241,15 @@ private Maybe> call(Map args, ToolContext to } else if (result instanceof Maybe) { return ((Maybe) result) .map( - data -> - OBJECT_MAPPER.convertValue(data, new TypeReference>() {})); + data -> objectMapper.convertValue(data, new TypeReference>() {})); } else if (result instanceof Single) { return ((Single) result) - .map( - data -> OBJECT_MAPPER.convertValue(data, new TypeReference>() {})) + .map(data -> objectMapper.convertValue(data, new TypeReference>() {})) .toMaybe(); } else { try { return Maybe.just( - OBJECT_MAPPER.convertValue(result, new TypeReference>() {})); + objectMapper.convertValue(result, new TypeReference>() {})); } catch (IllegalArgumentException e) { // Conversion to map failed, in this case we follow // https://google.github.io/adk-docs/tools-custom/function-tools/#return-type and return @@ -326,7 +324,7 @@ private Object[] buildArguments( continue; } } else if (argValue instanceof Map) { - arguments[i] = OBJECT_MAPPER.convertValue(argValue, paramType); + arguments[i] = objectMapper.convertValue(argValue, paramType); continue; } arguments[i] = castValue(argValue, paramType); @@ -363,7 +361,7 @@ private static List createList(List values, Class type) { || cls == String.class) { list.add(castValue(value, cls)); } else { - list.add(OBJECT_MAPPER.convertValue(value, type)); + list.add(objectMapper.convertValue(value, type)); } } return list; @@ -414,6 +412,6 @@ private static Object castValue(Object value, Class type) { return value; } } - return OBJECT_MAPPER.convertValue(value, type); + return objectMapper.convertValue(value, type); } } diff --git a/core/src/main/java/com/google/adk/tools/applicationintegrationtoolset/ApplicationIntegrationToolset.java b/core/src/main/java/com/google/adk/tools/applicationintegrationtoolset/ApplicationIntegrationToolset.java index 7bad261ed..83618e3b2 100644 --- a/core/src/main/java/com/google/adk/tools/applicationintegrationtoolset/ApplicationIntegrationToolset.java +++ b/core/src/main/java/com/google/adk/tools/applicationintegrationtoolset/ApplicationIntegrationToolset.java @@ -28,7 +28,7 @@ public class ApplicationIntegrationToolset implements BaseToolset { String serviceAccountJson; @Nullable String toolNamePrefix; @Nullable String toolInstructions; - public static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); + public static final ObjectMapper objectMapper = new ObjectMapper(); private final HttpClient httpClient; private final CredentialsHelper credentialsHelper; @@ -118,13 +118,13 @@ public ApplicationIntegrationToolset( List getPathUrl(String openApiSchemaString) throws Exception { List pathUrls = new ArrayList<>(); - JsonNode topLevelNode = OBJECT_MAPPER.readTree(openApiSchemaString); + JsonNode topLevelNode = objectMapper.readTree(openApiSchemaString); JsonNode specNode = topLevelNode.path("openApiSpec"); if (specNode.isMissingNode() || !specNode.isTextual()) { throw new IllegalArgumentException( "Failed to get OpenApiSpec, please check the project and region for the integration."); } - JsonNode rootNode = OBJECT_MAPPER.readTree(specNode.asText()); + JsonNode rootNode = objectMapper.readTree(specNode.asText()); JsonNode pathsNode = rootNode.path("paths"); Iterator> paths = pathsNode.fields(); while (paths.hasNext()) { @@ -184,12 +184,12 @@ private List getAllTools() throws Exception { this.serviceAccountJson, this.httpClient, this.credentialsHelper); - ObjectNode parentOpenApiSpec = OBJECT_MAPPER.createObjectNode(); + ObjectNode parentOpenApiSpec = objectMapper.createObjectNode(); ObjectNode openApiSpec = integrationClient.getOpenApiSpecForConnection(toolNamePrefix, toolInstructions); - String openApiSpecString = OBJECT_MAPPER.writeValueAsString(openApiSpec); + String openApiSpecString = objectMapper.writeValueAsString(openApiSpec); parentOpenApiSpec.put("openApiSpec", openApiSpecString); - openApiSchemaString = OBJECT_MAPPER.writeValueAsString(parentOpenApiSpec); + openApiSchemaString = objectMapper.writeValueAsString(parentOpenApiSpec); List pathUrls = getPathUrl(openApiSchemaString); for (String pathUrl : pathUrls) { String toolName = integrationClient.getOperationIdFromPathUrl(openApiSchemaString, pathUrl); @@ -202,7 +202,7 @@ private List getAllTools() throws Exception { this.serviceAccountJson, this.httpClient, this.credentialsHelper, - OBJECT_MAPPER); + objectMapper); ConnectionsClient.ConnectionDetails connectionDetails = connectionsClient.getConnectionDetails(); diff --git a/core/src/main/java/com/google/adk/tools/applicationintegrationtoolset/IntegrationClient.java b/core/src/main/java/com/google/adk/tools/applicationintegrationtoolset/IntegrationClient.java index bb2ec5365..b1958d56a 100644 --- a/core/src/main/java/com/google/adk/tools/applicationintegrationtoolset/IntegrationClient.java +++ b/core/src/main/java/com/google/adk/tools/applicationintegrationtoolset/IntegrationClient.java @@ -38,7 +38,7 @@ public class IntegrationClient { private final HttpClient httpClient; private final CredentialsHelper credentialsHelper; - public static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); + public static final ObjectMapper objectMapper = new ObjectMapper(); IntegrationClient( String project, @@ -155,7 +155,7 @@ String generateOpenApiSpec() throws Exception { this.location, this.project, this.location); String jsonRequestBody = - OBJECT_MAPPER.writeValueAsString( + objectMapper.writeValueAsString( ImmutableMap.of( "apiTriggerResources", ImmutableList.of( @@ -192,7 +192,7 @@ ObjectNode getOpenApiSpecForConnection(String toolName, String toolInstructions) ConnectionsClient connectionsClient = createConnectionsClient(); ImmutableMap baseSpecMap = ConnectionsClient.getConnectorBaseSpec(); - ObjectNode connectorSpec = OBJECT_MAPPER.valueToTree(baseSpecMap); + ObjectNode connectorSpec = objectMapper.valueToTree(baseSpecMap); ObjectNode paths = (ObjectNode) connectorSpec.path("paths"); ObjectNode schemas = (ObjectNode) connectorSpec.path("components").path("schemas"); @@ -217,12 +217,12 @@ ObjectNode getOpenApiSpecForConnection(String toolName, String toolInstructions) operations = supportedOperations; } - String jsonSchemaAsString = OBJECT_MAPPER.writeValueAsString(schemaMap); + String jsonSchemaAsString = objectMapper.writeValueAsString(schemaMap); String entityLower = entity.toLowerCase(Locale.ROOT); schemas.set( "connectorInputPayload_" + entityLower, - OBJECT_MAPPER.valueToTree(connectionsClient.connectorPayload(schemaMap))); + objectMapper.valueToTree(connectionsClient.connectorPayload(schemaMap))); for (String operation : operations) { String operationLower = operation.toLowerCase(Locale.ROOT); @@ -240,49 +240,49 @@ ObjectNode getOpenApiSpecForConnection(String toolName, String toolInstructions) case "create": paths.set( path, - OBJECT_MAPPER.valueToTree( + objectMapper.valueToTree( ConnectionsClient.createOperation(entityLower, toolName, toolInstructions))); schemas.set( "create_" + entityLower + "_Request", - OBJECT_MAPPER.valueToTree(ConnectionsClient.createOperationRequest(entityLower))); + objectMapper.valueToTree(ConnectionsClient.createOperationRequest(entityLower))); break; case "update": paths.set( path, - OBJECT_MAPPER.valueToTree( + objectMapper.valueToTree( ConnectionsClient.updateOperation(entityLower, toolName, toolInstructions))); schemas.set( "update_" + entityLower + "_Request", - OBJECT_MAPPER.valueToTree(ConnectionsClient.updateOperationRequest(entityLower))); + objectMapper.valueToTree(ConnectionsClient.updateOperationRequest(entityLower))); break; case "delete": paths.set( path, - OBJECT_MAPPER.valueToTree( + objectMapper.valueToTree( ConnectionsClient.deleteOperation(entityLower, toolName, toolInstructions))); schemas.set( "delete_" + entityLower + "_Request", - OBJECT_MAPPER.valueToTree(ConnectionsClient.deleteOperationRequest())); + objectMapper.valueToTree(ConnectionsClient.deleteOperationRequest())); break; case "list": paths.set( path, - OBJECT_MAPPER.valueToTree( + objectMapper.valueToTree( ConnectionsClient.listOperation( entityLower, jsonSchemaAsString, toolName, toolInstructions))); schemas.set( "list_" + entityLower + "_Request", - OBJECT_MAPPER.valueToTree(ConnectionsClient.listOperationRequest())); + objectMapper.valueToTree(ConnectionsClient.listOperationRequest())); break; case "get": paths.set( path, - OBJECT_MAPPER.valueToTree( + objectMapper.valueToTree( ConnectionsClient.getOperation( entityLower, jsonSchemaAsString, toolName, toolInstructions))); schemas.set( "get_" + entityLower + "_Request", - OBJECT_MAPPER.valueToTree(ConnectionsClient.getOperationRequest())); + objectMapper.valueToTree(ConnectionsClient.getOperationRequest())); break; default: throw new IllegalArgumentException( @@ -293,7 +293,7 @@ ObjectNode getOpenApiSpecForConnection(String toolName, String toolInstructions) } else if (this.actions != null) { for (String action : this.actions) { ObjectNode actionDetails = - OBJECT_MAPPER.valueToTree(connectionsClient.getActionSchema(action)); + objectMapper.valueToTree(connectionsClient.getActionSchema(action)); JsonNode inputSchemaNode = actionDetails.path("inputSchema"); JsonNode outputSchemaNode = actionDetails.path("outputSchema"); @@ -301,30 +301,29 @@ ObjectNode getOpenApiSpecForConnection(String toolName, String toolInstructions) String actionDisplayName = actionDetails.path("displayName").asText("").replace(" ", ""); String operation = "EXECUTE_ACTION"; - Map inputSchemaMap = OBJECT_MAPPER.treeToValue(inputSchemaNode, Map.class); - Map outputSchemaMap = - OBJECT_MAPPER.treeToValue(outputSchemaNode, Map.class); + Map inputSchemaMap = objectMapper.treeToValue(inputSchemaNode, Map.class); + Map outputSchemaMap = objectMapper.treeToValue(outputSchemaNode, Map.class); if (Objects.equals(action, "ExecuteCustomQuery")) { schemas.set( actionDisplayName + "_Request", - OBJECT_MAPPER.valueToTree(ConnectionsClient.executeCustomQueryRequest())); + objectMapper.valueToTree(ConnectionsClient.executeCustomQueryRequest())); operation = "EXECUTE_QUERY"; } else { schemas.set( actionDisplayName + "_Request", - OBJECT_MAPPER.valueToTree(ConnectionsClient.actionRequest(actionDisplayName))); + objectMapper.valueToTree(ConnectionsClient.actionRequest(actionDisplayName))); schemas.set( "connectorInputPayload_" + actionDisplayName, - OBJECT_MAPPER.valueToTree(connectionsClient.connectorPayload(inputSchemaMap))); + objectMapper.valueToTree(connectionsClient.connectorPayload(inputSchemaMap))); } schemas.set( "connectorOutputPayload_" + actionDisplayName, - OBJECT_MAPPER.valueToTree(connectionsClient.connectorPayload(outputSchemaMap))); + objectMapper.valueToTree(connectionsClient.connectorPayload(outputSchemaMap))); schemas.set( actionDisplayName + "_Response", - OBJECT_MAPPER.valueToTree(ConnectionsClient.actionResponse(actionDisplayName))); + objectMapper.valueToTree(ConnectionsClient.actionResponse(actionDisplayName))); String path = String.format( @@ -333,7 +332,7 @@ ObjectNode getOpenApiSpecForConnection(String toolName, String toolInstructions) paths.set( path, - OBJECT_MAPPER.valueToTree( + objectMapper.valueToTree( ConnectionsClient.getActionOperation( action, operation, actionDisplayName, toolName, toolInstructions))); } @@ -345,13 +344,13 @@ ObjectNode getOpenApiSpecForConnection(String toolName, String toolInstructions) } String getOperationIdFromPathUrl(String openApiSchemaString, String pathUrl) throws Exception { - JsonNode topLevelNode = OBJECT_MAPPER.readTree(openApiSchemaString); + JsonNode topLevelNode = objectMapper.readTree(openApiSchemaString); JsonNode specNode = topLevelNode.path("openApiSpec"); if (specNode.isMissingNode() || !specNode.isTextual()) { throw new IllegalArgumentException( "Failed to get OpenApiSpec, please check the project and region for the integration."); } - JsonNode rootNode = OBJECT_MAPPER.readTree(specNode.asText()); + JsonNode rootNode = objectMapper.readTree(specNode.asText()); JsonNode paths = rootNode.path("paths"); Iterator> pathsFields = paths.fields(); @@ -384,6 +383,6 @@ ConnectionsClient createConnectionsClient() { this.serviceAccountJson, this.httpClient, this.credentialsHelper, - OBJECT_MAPPER); + objectMapper); } } diff --git a/core/src/main/java/com/google/adk/tools/applicationintegrationtoolset/IntegrationConnectorTool.java b/core/src/main/java/com/google/adk/tools/applicationintegrationtoolset/IntegrationConnectorTool.java index ed938d4b7..d69a4d3e3 100644 --- a/core/src/main/java/com/google/adk/tools/applicationintegrationtoolset/IntegrationConnectorTool.java +++ b/core/src/main/java/com/google/adk/tools/applicationintegrationtoolset/IntegrationConnectorTool.java @@ -43,7 +43,7 @@ public class IntegrationConnectorTool extends BaseTool { private String operation; private String action; - private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); + private static final ObjectMapper objectMapper = new ObjectMapper(); private static final ImmutableList EXCLUDE_FIELDS = ImmutableList.of("connectionName", "serviceName", "host", "entity", "operation", "action"); @@ -166,7 +166,7 @@ private String executeIntegration(Map args) throws Exception { String url = String.format("https://integrations.googleapis.com%s", this.pathUrl); String jsonRequestBody; try { - jsonRequestBody = OBJECT_MAPPER.writeValueAsString(args); + jsonRequestBody = objectMapper.writeValueAsString(args); } catch (IOException e) { throw new Exception("Error converting args to JSON: " + e.getMessage(), e); } @@ -193,13 +193,13 @@ private String executeIntegration(Map args) throws Exception { } String getOperationIdFromPathUrl(String openApiSchemaString, String pathUrl) throws Exception { - JsonNode topLevelNode = OBJECT_MAPPER.readTree(openApiSchemaString); + JsonNode topLevelNode = objectMapper.readTree(openApiSchemaString); JsonNode specNode = topLevelNode.path("openApiSpec"); if (specNode.isMissingNode() || !specNode.isTextual()) { throw new IllegalArgumentException( "Failed to get OpenApiSpec, please check the project and region for the integration."); } - JsonNode rootNode = OBJECT_MAPPER.readTree(specNode.asText()); + JsonNode rootNode = objectMapper.readTree(specNode.asText()); JsonNode paths = rootNode.path("paths"); // Iterate through each path in the OpenAPI spec. @@ -239,13 +239,13 @@ String getOperationIdFromPathUrl(String openApiSchemaString, String pathUrl) thr private String getResolvedRequestSchemaByOperationId( String openApiSchemaString, String operationId) throws Exception { - JsonNode topLevelNode = OBJECT_MAPPER.readTree(openApiSchemaString); + JsonNode topLevelNode = objectMapper.readTree(openApiSchemaString); JsonNode specNode = topLevelNode.path("openApiSpec"); if (specNode.isMissingNode() || !specNode.isTextual()) { throw new IllegalArgumentException( "Failed to get OpenApiSpec, please check the project and region for the integration."); } - JsonNode rootNode = OBJECT_MAPPER.readTree(specNode.asText()); + JsonNode rootNode = objectMapper.readTree(specNode.asText()); JsonNode operationNode = findOperationNodeById(rootNode, operationId); if (operationNode == null) { throw new Exception("Could not find operation with operationId: " + operationId); @@ -290,7 +290,7 @@ private String getResolvedRequestSchemaByOperationId( } } } - return OBJECT_MAPPER.writerWithDefaultPrettyPrinter().writeValueAsString(resolvedSchema); + return objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(resolvedSchema); } private @Nullable JsonNode findOperationNodeById(JsonNode rootNode, String operationId) { @@ -322,7 +322,7 @@ private JsonNode resolveRefs(JsonNode currentNode, JsonNode rootNode) { } return resolveRefs(referencedNode, rootNode); } else { - ObjectNode newObjectNode = OBJECT_MAPPER.createObjectNode(); + ObjectNode newObjectNode = objectMapper.createObjectNode(); Iterator> fields = currentNode.fields(); while (fields.hasNext()) { Map.Entry field = fields.next(); @@ -336,12 +336,12 @@ private JsonNode resolveRefs(JsonNode currentNode, JsonNode rootNode) { private String getOperationDescription(String openApiSchemaString, String operationId) throws Exception { - JsonNode topLevelNode = OBJECT_MAPPER.readTree(openApiSchemaString); + JsonNode topLevelNode = objectMapper.readTree(openApiSchemaString); JsonNode specNode = topLevelNode.path("openApiSpec"); if (specNode.isMissingNode() || !specNode.isTextual()) { return ""; } - JsonNode rootNode = OBJECT_MAPPER.readTree(specNode.asText()); + JsonNode rootNode = objectMapper.readTree(specNode.asText()); JsonNode operationNode = findOperationNodeById(rootNode, operationId); if (operationNode == null) { return "";