Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import io.orkes.conductor.client.ApiClient;
import io.orkes.conductor.client.OrkesClients;

import com.fasterxml.jackson.databind.ObjectMapper;
import tools.jackson.databind.ObjectMapper;


/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import org.conductoross.conductor.ai.internal.ToolRegistry;
import org.conductoross.conductor.ai.model.AgentResult;

import com.fasterxml.jackson.databind.ObjectMapper;
import tools.jackson.databind.ObjectMapper;

/**
* Example 57 — Plan Dry Run
Expand Down
13 changes: 7 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,13 @@ subprojects {
implementation "com.google.guava:guava:${versions.guava}"
// #################################

implementation "com.fasterxml.jackson.core:jackson-databind:${versions.jackson}"
implementation "com.fasterxml.jackson.core:jackson-core:${versions.jackson}"
implementation "com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:${versions.jackson}"
implementation "com.fasterxml.jackson.module:jackson-module-kotlin:${versions.jackson}"
implementation "com.fasterxml.jackson.module:jackson-module-afterburner:${versions.jackson}"
// Jackson 3: databind/core/modules live under tools.jackson; annotations remain on the
// com.fasterxml.jackson 2.x line. java.time (jsr310) and jdk8 datatypes plus the
// afterburner optimisations are part of core in Jackson 3, so those modules are gone.
implementation "tools.jackson.core:jackson-databind:${versions.jackson}"
implementation "tools.jackson.core:jackson-core:${versions.jackson}"
implementation "com.fasterxml.jackson.core:jackson-annotations:${versions.jacksonAnnotations}"
implementation "tools.jackson.module:jackson-module-kotlin:${versions.jackson}"
implementation "org.openjdk.nashorn:nashorn-core:15.6"

implementation "org.slf4j:slf4j-api:${versions.slf4j}"
Expand Down
9 changes: 4 additions & 5 deletions conductor-client-ai/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@ dependencies {
// so downstream modules and user code must see conductor-client transitively.
api project(":conductor-client")

api "com.fasterxml.jackson.core:jackson-databind:${versions.jackson}"
api "com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}"
api "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:${versions.jackson}"
// not injected by the root subprojects block — must stay explicit
api "com.fasterxml.jackson.datatype:jackson-datatype-jdk8:${versions.jackson}"
// Jackson 3: jsr310/jdk8 datatypes are part of core, so only databind and the
// 2.x-line annotations remain on the public surface.
api "tools.jackson.core:jackson-databind:${versions.jackson}"
api "com.fasterxml.jackson.core:jackson-annotations:${versions.jacksonAnnotations}"

// compileOnly so the SDK doesn't force LLM frameworks onto users: the framework
// bridge classes only link at runtime when the user passes a native object in —
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

import org.conductoross.conductor.ai.internal.JsonMapper;

import com.fasterxml.jackson.databind.JsonNode;
import tools.jackson.databind.JsonNode;

/**
* Execute code against a Jupyter Kernel Gateway.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

import org.conductoross.conductor.ai.internal.JsonMapper;

import com.fasterxml.jackson.databind.JsonNode;
import tools.jackson.databind.JsonNode;

/**
* Execute code via a remote serverless execution service.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
*/
package org.conductoross.conductor.ai.internal;

import java.io.IOException;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
Expand All @@ -35,9 +34,9 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import tools.jackson.core.JsonGenerator;
import tools.jackson.databind.SerializationContext;
import tools.jackson.databind.ValueSerializer;

/**
* Serializes an {@link Agent} tree to the camelCase JSON dict for POST /agent/start.
Expand Down Expand Up @@ -727,18 +726,18 @@ private Map<String, Object> generateJsonSchema(Class<?> cls) {
}

/**
* Jackson {@link JsonSerializer} that delegates to {@link AgentConfigSerializer#serialize(Agent)}.
* Jackson {@link ValueSerializer} that delegates to {@link AgentConfigSerializer#serialize(Agent)}.
* Applied via {@code @JsonSerialize(using = AgentConfigSerializer.AsJson.class)} on
* {@code Agent}-typed fields so Jackson writes the correct wire format (camelCase
* map matching the server's AgentConfig DTO) without requiring the caller to
* pre-serialize to a Map.
*/
public static final class AsJson extends JsonSerializer<Agent> {
public static final class AsJson extends ValueSerializer<Agent> {
private static final AgentConfigSerializer INSTANCE = new AgentConfigSerializer();

@Override
public void serialize(Agent agent, JsonGenerator gen, SerializerProvider provider) throws IOException {
provider.defaultSerializeValue(INSTANCE.serialize(agent), gen);
public void serialize(Agent agent, JsonGenerator gen, SerializationContext context) {
context.writeValue(gen, INSTANCE.serialize(agent));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,29 @@
package org.conductoross.conductor.ai.internal;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.datatype.jdk8.Jdk8Module;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import tools.jackson.databind.DeserializationFeature;
import tools.jackson.databind.ObjectMapper;
import tools.jackson.databind.cfg.DateTimeFeature;

/**
* Singleton ObjectMapper factory with consistent configuration.
*
* <p>Unlike the client's ObjectMapperProvider (which keeps the numeric timestamp wire format for
* server compatibility), this mapper intentionally writes dates as ISO-8601 strings. The jdk8 and
* java.time datatypes are part of Jackson 3 core, so no modules are registered. The builder is
* referenced by its fully qualified name because this class shares the JsonMapper simple name.
*/
public class JsonMapper {
private static final ObjectMapper INSTANCE;

static {
INSTANCE = new ObjectMapper();
INSTANCE.registerModule(new JavaTimeModule());
INSTANCE.registerModule(new Jdk8Module());
INSTANCE.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
INSTANCE.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
INSTANCE.setSerializationInclusion(JsonInclude.Include.NON_NULL);
}
private static final ObjectMapper INSTANCE =
tools.jackson.databind.json.JsonMapper.builder()
.disable(DateTimeFeature.WRITE_DATES_AS_TIMESTAMPS)
.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
.changeDefaultPropertyInclusion(
value ->
JsonInclude.Value.construct(
JsonInclude.Include.NON_NULL,
JsonInclude.Include.USE_DEFAULTS))
.build();

private JsonMapper() {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -322,9 +322,9 @@ private static Object coerce(Object value, Class<?> targetType, Type genericType
// even when the method signature declares List<Double>.
if (List.class.isAssignableFrom(targetType)) {
try {
com.fasterxml.jackson.databind.type.TypeFactory tf =
tools.jackson.databind.type.TypeFactory tf =
JsonMapper.get().getTypeFactory();
com.fasterxml.jackson.databind.JavaType jt = (genericType != null)
tools.jackson.databind.JavaType jt = (genericType != null)
? tf.constructType(genericType)
: tf.constructCollectionType(List.class, Object.class);
return JsonMapper.get().convertValue(value, jt);
Expand Down Expand Up @@ -355,7 +355,7 @@ private static Object coerce(Object value, Class<?> targetType, Type genericType
}
// Fallback: try Jackson conversion for complex types
try {
com.fasterxml.jackson.databind.JavaType jt = (genericType != null)
tools.jackson.databind.JavaType jt = (genericType != null)
? JsonMapper.get().getTypeFactory().constructType(genericType)
: JsonMapper.get().getTypeFactory().constructType(targetType);
return JsonMapper.get().convertValue(value, jt);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import org.conductoross.conductor.ai.enums.AgentStatus;
import org.conductoross.conductor.ai.internal.JsonMapper;

import com.fasterxml.jackson.databind.ObjectMapper;
import tools.jackson.databind.ObjectMapper;

/**
* The result of a completed agent execution.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,14 @@
*/
package org.conductoross.conductor.ai.plans;

import java.io.IOException;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import tools.jackson.core.JsonGenerator;
import tools.jackson.databind.SerializationContext;
import tools.jackson.databind.ValueSerializer;

/**
* A compiled plan ready for {@code Strategy.PLAN_EXECUTE} execution.
Expand Down Expand Up @@ -114,10 +113,10 @@ public Plan build() {
* in {@code AgentRequest} writes the correct wire format without the caller
* pre-converting to a {@code Map}.
*/
public static final class AsJson extends JsonSerializer<Plan> {
public static final class AsJson extends ValueSerializer<Plan> {
@Override
public void serialize(Plan plan, JsonGenerator gen, SerializerProvider provider) throws IOException {
provider.defaultSerializeValue(plan.toJson(), gen);
public void serialize(Plan plan, JsonGenerator gen, SerializationContext context) {
context.writeValue(gen, plan.toJson());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Timeout;

import com.fasterxml.jackson.databind.ObjectMapper;
import okhttp3.mockwebserver.Dispatcher;
import okhttp3.mockwebserver.MockResponse;
import okhttp3.mockwebserver.MockWebServer;
import okhttp3.mockwebserver.RecordedRequest;
import tools.jackson.databind.ObjectMapper;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import io.orkes.conductor.client.http.OrkesAgentClient;
import io.orkes.conductor.client.model.agent.AgentStatusResponse;

import com.fasterxml.jackson.databind.ObjectMapper;
import tools.jackson.databind.ObjectMapper;

import static org.junit.jupiter.api.Assertions.*;

Expand Down
4 changes: 2 additions & 2 deletions conductor-client-spring-boot4/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ repositories {

dependencies {
api project(":conductor-client")
implementation 'org.springframework.boot:spring-boot-starter:4.0.6'
implementation 'org.springframework.boot:spring-boot-starter:4.1.1'

testImplementation 'org.springframework.boot:spring-boot-starter-test:4.0.6'
testImplementation 'org.springframework.boot:spring-boot-starter-test:4.1.1'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
testImplementation "org.mockito:mockito-core:${versions.mockito}"
testImplementation "org.mockito:mockito-junit-jupiter:${versions.mockito}"
Expand Down
1 change: 0 additions & 1 deletion conductor-client/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ dependencies {
testImplementation 'org.spockframework:spock-core:2.3-groovy-3.0'
testImplementation 'org.codehaus.groovy:groovy:3.0.25'
testImplementation 'ch.qos.logback:logback-classic:1.5.32'
testImplementation "com.fasterxml.jackson.datatype:jackson-datatype-jdk8:${versions.jackson}"
}

java {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@
import com.netflix.conductor.client.metrics.PayloadKind;
import com.netflix.conductor.common.config.ObjectMapperProvider;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.SneakyThrows;
import okhttp3.Call;
import okhttp3.ConnectionPool;
Expand All @@ -68,6 +64,10 @@
import okhttp3.RequestBody;
import okhttp3.Response;
import okhttp3.internal.http.HttpMethod;
import tools.jackson.core.JacksonException;
import tools.jackson.core.type.TypeReference;
import tools.jackson.databind.JavaType;
import tools.jackson.databind.ObjectMapper;

public class ConductorClient {
private static final Logger LOGGER = LoggerFactory.getLogger(ConductorClient.class);
Expand Down Expand Up @@ -403,7 +403,7 @@ protected <T> T handleResponse(Response response, Type returnType) {
ConductorClientException exception = objectMapper.readValue(respBody, ConductorClientException.class);
exception.setStatus(response.code());
throw exception;
} catch (JsonProcessingException jpe) {
} catch (JacksonException jpe) {
// Ignore
}
throw new ConductorClientException(response.message(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import com.netflix.conductor.client.http.ConductorClientRequest.Method;
import com.netflix.conductor.common.metadata.events.EventHandler;

import com.fasterxml.jackson.core.type.TypeReference;
import tools.jackson.core.type.TypeReference;



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import com.netflix.conductor.common.metadata.tasks.TaskDef;
import com.netflix.conductor.common.metadata.workflow.WorkflowDef;

import com.fasterxml.jackson.core.type.TypeReference;
import tools.jackson.core.type.TypeReference;

public class MetadataClient {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
import com.netflix.conductor.common.run.ExternalStorageLocation;
import com.netflix.conductor.common.utils.ExternalPayloadStorage;

import com.fasterxml.jackson.core.type.TypeReference;
import lombok.extern.slf4j.Slf4j;
import tools.jackson.core.type.TypeReference;

/** An implementation of {@link ExternalPayloadStorage} for storing large JSON payload data. */
@Slf4j
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@
import com.netflix.conductor.common.run.Workflow;
import com.netflix.conductor.common.utils.ExternalPayloadStorage;

import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.extern.slf4j.Slf4j;
import tools.jackson.core.type.TypeReference;
import tools.jackson.databind.ObjectMapper;

/**
* Client for conductor task management including polling for task, updating
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@
import com.netflix.conductor.common.run.WorkflowTestRequest;
import com.netflix.conductor.common.utils.ExternalPayloadStorage;

import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.extern.slf4j.Slf4j;
import tools.jackson.core.type.TypeReference;
import tools.jackson.databind.ObjectMapper;

@Slf4j
public class WorkflowClient implements AutoCloseable {
Expand Down
Loading
Loading