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

JsonSerializer encode/decode issue #93

Open
hantsy opened this issue Jul 13, 2020 · 0 comments
Open

JsonSerializer encode/decode issue #93

hantsy opened this issue Jul 13, 2020 · 0 comments
Labels
needs triage Issue/PR needs triage by a project maintainer

Comments

@hantsy
Copy link

hantsy commented Jul 13, 2020

When decoding a json to object, it added escape to string based value.

Expected Behavior

{"id":"5f0bcaa46e0ba209eb68f47b","body":"test","sentAt":"2020-07-13T02:44:52.628Z"}

Actual Behavior

{"id":"5f0bcaa46e0ba209eb68f47b","body":"\"test\"","sentAt":"2020-07-13T02:44:52.628Z"}

Steps to Reproduce

I have written a sample which is help for reproducing this issue.

  • Client is Angular 10/NodeJS 14
  • Backend is Java 14/Spring Boot 2.4.0.M1, Kotlin, using RSocket WebSocket transport protocol.

https://github.com/hantsy/angular-spring-rsocket-sample

Update: when I perform a query on the Mongo server, it shows.

> db.messages.find();
{ "_id" : ObjectId("5f1564db0a7da37b085e8bd7"), "body" : "test", "sentAt" : ISODate("2020-07-20T09:33:15.527Z"), "_class" : "com.example.demo.Message" }
{ "_id" : ObjectId("5f15650a0a7da37b085e8bd8"), "body" : "\"hello rsocket\"", "sentAt" : ISODate("2020-07-20T09:34:02.042Z"), "_class" : "com.example.demo.Message" }
{ "_id" : ObjectId("5f1565140a7da37b085e8bd9"), "body" : "\"yeah, finally works\"", "sentAt" : ISODate("2020-07-20T09:34:12.453Z"), "_class" : "com.example.demo.Message" }

Does this mean when the server received the message from the client, the JSON serializer added a slash to escape the string?

@hantsy hantsy changed the title JsonSerializer decode issue JsonSerializer encode/decode issue Jul 20, 2020
@viglucci viglucci added the needs triage Issue/PR needs triage by a project maintainer label Mar 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Issue/PR needs triage by a project maintainer
Projects
None yet
Development

No branches or pull requests

2 participants