Skip to content

Commit

Permalink
fix(document-handling): fixes after jonathan comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mathias-vandaele committed Dec 16, 2024
1 parent 7da40a1 commit 1a49d08
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ public ConsoleSecretApiClient consoleSecretApiClient(CamundaClientProperties cli
@Bean
@ConditionalOnMissingBean
public ObjectMapper objectMapper(DocumentFactory documentFactory) {
ConnectorsObjectMapperSupplier.getCopy(documentFactory, DocumentModuleSettings.create());
return ConnectorsObjectMapperSupplier.getCopy();
return ConnectorsObjectMapperSupplier.getCopy(documentFactory, DocumentModuleSettings.create());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import io.camunda.connector.api.json.ConnectorsObjectMapperSupplier;
import io.camunda.connector.api.secret.SecretProvider;
import io.camunda.connector.api.validation.ValidationProvider;
import io.camunda.connector.document.annotation.jackson.JacksonModuleDocument;
import io.camunda.connector.runtime.core.AbstractConnectorContext;
import io.camunda.connector.runtime.core.inbound.InboundConnectorElement;
import io.camunda.connector.runtime.core.inbound.InboundConnectorReportingContext;
Expand All @@ -50,13 +51,16 @@ public class InboundConnectorContextBuilder {
protected Map<String, Object> properties;
protected InboundConnectorDefinition definition;
protected ValidationProvider validationProvider;

protected ObjectMapper objectMapper = ConnectorsObjectMapperSupplier.getCopy();

protected CorrelationResult result;

protected DocumentFactory documentFactory =
new DocumentFactoryImpl(InMemoryDocumentStore.INSTANCE);
protected ObjectMapper objectMapper =
ConnectorsObjectMapperSupplier.getCopy()
.registerModule(
new JacksonModuleDocument(
this.documentFactory,
null,
JacksonModuleDocument.DocumentModuleSettings.create()));

public static InboundConnectorContextBuilder create() {
return new InboundConnectorContextBuilder();
Expand Down Expand Up @@ -167,6 +171,13 @@ public InboundConnectorContextBuilder validation(ValidationProvider validationPr
return this;
}

public InboundConnectorContextBuilder documentFactory(DocumentFactory documentFactory) {
this.objectMapper =
ConnectorsObjectMapperSupplier.getCopy(
documentFactory, JacksonModuleDocument.DocumentModuleSettings.create());
return this;
}

/**
* Sets a custom {@link ObjectMapper} that is used to serialize and deserialize the properties. If
* not provided, default mapper will be used.
Expand Down

0 comments on commit 1a49d08

Please sign in to comment.