airbytehq / airbytehq/airbyte-api-java-sdk

getting exception "JsonMappingException: json matched more than one of the possible type references" while creating source and destination.

Ouverte
#111 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Java
Étoiles
24
Forks
12
Métriques de merge des PR
Métriques de PR en attente

Description

i am using airbyte oss api java sdk version 1.5.10 to create postgresql as source and the method i have create is:
public String createSource(String workspaceId) throws Exception {
logger.info("Creating source in workspace: {}", workspaceId);
SourceCreateRequest request = SourceCreateRequest.builder()
.configuration(SourceConfiguration.of(SourcePostgres.builder()
.host("172.29.160.1")
.port(5432)
.database("my_dbt_project")
.password("1234")
.username("postgres")
.tunnelMethod(SourcePostgresSSHTunnelMethod.of(SourcePostgresNoTunnel.builder().build()))
.sslMode(SSLModes.of(Disable.builder().build()))
.replicationMethod(SourcePostgresUpdateMethod.of(DetectChangesWithXminSystemColumn.builder().build()))
.build()))
.name("PostgresDemo").workspaceId(workspaceId).build();
CreateSourceResponse response = sdk.sources().createSource().request(request).call();
String sourceId = response.sourceResponse().get().sourceId();
logger.info("Source created with ID: {}", sourceId);
return sourceId;
}
now i am getting the exception:
com.fasterxml.jackson.databind.JsonMappingException: json matched more than one of the possible type references, matches are: [com.airbyte.api.models.shared.SourceAirtable, com.airbyte.api.models.shared.SourceAppfollow, com.airbyte.api.models.shared.SourceAsana, com.airbyte.api.models.shared.SourceClickhouse, com.airbyte.api.models.shared.SourceConfigcat, com.airbyte.api.models.shared.SourceDynamodb, com.airbyte.api.models.shared.SourceFaker, com.airbyte.api.models.shared.SourceGoogleDirectory, com.airbyte.api.models.shared.SourceHardcodedRecords, com.airbyte.api.models.shared.SourceInsightly, com.airbyte.api.models.shared.SourceIp2whois, com.airbyte.api.models.shared.SourceMailchimp, com.airbyte.api.models.shared.SourceMonday, com.airbyte.api.models.shared.SourceNotion, com.airbyte.api.models.shared.SourceOkta, com.airbyte.api.models.shared.SourceOracle, com.airbyte.api.models.shared.SourcePinterest, com.airbyte.api.models.shared.SourceRedshift, com.airbyte.api.models.shared.SourceRetently, com.airbyte.api.models.shared.SourceScryfall, com.airbyte.api.models.shared.SourceSpacexApi, com.airbyte.api.models.shared.SourceSquare, com.airbyte.api.models.shared.SourceTiktokMarketing, com.airbyte.api.models.shared.SourceWhiskyHunter, com.airbyte.api.models.shared.SourceXkcd, com.airbyte.api.models.shared.SourceYoutubeAnalytics] - json=
{"host":"172.29.160.1","port":5432,"database":"my_dbt_project","password":"**********","ssl_mode":{"mode":"disable"},"username":"postgres","tunnel_method":{"tunnel_method":"NO_TUNNEL"},"replication_method":{"method":"Xmin"}}
at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 1, column: 390] (through reference chain: com.airbyte.api.models.shared.SourceResponse["configuration"])
at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:297) ~[jackson-databind-2.17.0.jar:2.17.0]
at com.airbyte.api.utils.OneOfDeserializer.deserializeOneOf(OneOfDeserializer.java:87) ~[api-1.5.10.jar:na]
at com.airbyte.api.utils.OneOfDeserializer.deserializeOneOf(OneOfDeserializer.java:60) ~[api-1.5.10.jar:na]
at com.airbyte.api.utils.OneOfDeserializer.deserialize(OneOfDeserializer.java:51) ~[api-1.5.10.jar:na]
at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:545) ~[jackson-databind-2.17.0.jar:2.17.0]
at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeWithErrorWrapping(BeanDeserializer.java:570) ~[jackson-databind-2.17.0.jar:2.17.0]
at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeUsingPropertyBased(BeanDeserializer.java:440) ~[jackson-databind-2.17.0.jar:2.17.0]
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1493) ~[jackson-databind-2.17.0.jar:2.17.0]
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:348) ~[jackson-databind-2.17.0.jar:2.17.0]
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:185) ~[jackson-databind-2.17.0.jar:2.17.0]
at com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.readRootValue(DefaultDeserializationContext.java:342) ~[jackson-databind-2.17.0.jar:2.17.0]
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4905) ~[jackson-databind-2.17.0.jar:2.17.0]
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3848) ~[jackson-databind-2.17.0.jar:2.17.0]
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3831) ~[jackson-databind-2.17.0.jar:2.17.0]
at com.airbyte.api.Sources.createSource(Sources.java:133) ~[api-1.5.10.jar:na]
at com.airbyte.api.models.operations.CreateSourceRequestBuilder.call(CreateSourceRequestBuilder.java:43) ~[api-1.5.10.jar:na]
at com.example.demo.services.SourceService.createSource(SourceService.java:42) ~[classes/:na]
at com.example.demo.MainApplication.run(MainApplication.java:36) ~[classes/:na]
at org.springframework.boot.SpringApplication.lambda$callRunner$5(SpringApplication.java:790) ~[spring-boot-3.3.4.jar:3.3.4]
at org.springframework.util.function.ThrowingConsumer$1.acceptWithException(ThrowingConsumer.java:83) ~[spring-core-6.1.13.jar:6.1.13]
at org.springframework.util.function.ThrowingConsumer.accept(ThrowingConsumer.java:60) ~[spring-core-6.1.13.jar:6.1.13]
at org.springframework.util.function.ThrowingConsumer$1.accept(ThrowingConsumer.java:88) ~[spring-core-6.1.13.jar:6.1.13]
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:798) ~[spring-boot-3.3.4.jar:3.3.4]
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:789) ~[spring-boot-3.3.4.jar:3.3.4]
at org.springframework.boot.SpringApplication.lambda$callRunners$3(SpringApplication.java:774) ~[spring-boot-3.3.4.jar:3.3.4]
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184) ~[na:na]
at java.base/java.util.stream.SortedOps$SizedRefSortingSink.end(SortedOps.java:357) ~[na:na]
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:557) ~[na:na]
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:546) ~[na:na]
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) ~[na:na]
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) ~[na:na]
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:265) ~[na:na]
at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:611) ~[na:na]
at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:774) ~[spring-boot-3.3.4.jar:3.3.4]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:342) ~[spring-boot-3.3.4.jar:3.3.4]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1363) ~[spring-boot-3.3.4.jar:3.3.4]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1352) ~[spring-boot-3.3.4.jar:3.3.4]
at com.example.demo.MainApplication.main(MainApplication.java:47) ~[classes/:na]
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:580) ~[na:na]
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:50) ~[spring-boot-devtools-3.3.4.jar:3.3.4]

and this issue remains when i try to set any other source or destionation that require sourceType and destinationType respectively. But when i try to use sourceType and destinationType, it through compilation error with message "The method sourceType(SourcePostgresPostgres) is undefined for the type SourcePostgres.Builder"
Please help me resolve this issue.

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.