Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Same query but DIALECT 3 got json Parse error #476

Closed
GohKianSeng opened this issue Jun 22, 2024 · 2 comments
Closed

Same query but DIALECT 3 got json Parse error #476

GohKianSeng opened this issue Jun 22, 2024 · 2 comments

Comments

@GohKianSeng
Copy link

GohKianSeng commented Jun 22, 2024

hello

can share some info why when using DIALECT 3 the response value has Square Bracket []
while DIALECT 1 doesn't have. how to use DIALECT 3 without Square Bracket []

because i got this error using using dialect 3 for this query
image

Uncaught exception Thrown: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 2 path $
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 2 path $
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:397)
at com.google.gson.Gson.fromJson(Gson.java:1227)
at com.google.gson.Gson.fromJson(Gson.java:1137)
at com.google.gson.Gson.fromJson(Gson.java:1047)
at com.google.gson.Gson.fromJson(Gson.java:982)
at com.redis.om.spring.repository.query.RediSearchQuery.parseDocumentResult(RediSearchQuery.java:523)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1708)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575)
at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260)
at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616)
at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:622)
at java.base/java.util.stream.ReferencePipeline.toList(ReferencePipeline.java:627)
at com.redis.om.spring.repository.query.RediSearchQuery.executeQuery(RediSearchQuery.java:509)
at com.redis.om.spring.repository.query.RediSearchQuery.execute(RediSearchQuery.java:384)
at org.springframework.data.repository.core.support.RepositoryMethodInvoker.doInvoke(RepositoryMethodInvoker.java:170)
at org.springframework.data.repository.core.support.RepositoryMethodInvoker.invoke(RepositoryMethodInvoker.java:158)

image image
@GohKianSeng GohKianSeng changed the title Same query Different Response when using different DIALECT Same query but DIALECT 3 got json Parse error Jun 22, 2024
@bsbodden
Copy link
Contributor

Can you post the code, please?

@GohKianSeng
Copy link
Author

hi @bsbodden i created a gradle project with docker file.

  1. u can start the docker-compose file
  2. start springboot project
  3. call testcontroller api
  4. should have the error like my screenshot

debug.zip
image

@GohKianSeng GohKianSeng reopened this Jun 25, 2024
bsbodden added a commit to bsbodden/redis-om-spring that referenced this issue Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants