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

SignalR automatically Serializes payload that is already serialized correctly #5

Open
jafossum opened this issue Oct 5, 2022 · 0 comments
Assignees

Comments

@jafossum
Copy link
Contributor

jafossum commented Oct 5, 2022

SignalR automatically can receive objects, and serialize these the JSON or MessagePack.

It is currently not possible to avoid / override this step.

This functionality causes an already JSON serialized string to be serialized again.
This step turns the payload into a JSON String, and not the JSON representation of the object we want to send.

Example ref: Is it possible to return a pre-encoded JSON string in a SignalR hub method?
(Yes it is old, but still valid)

Because this whole server is built around the concept of serving any provided json structure, we have no Object representation of the data.

Example:
The current correctly formatted text is passed to the SignalR client

{ "key": "value" }

In the payload body it has been serialized again and now looks like this

"{ \"key\":\"value\" }"

This is now a single string, and this causes trouble

@jafossum jafossum self-assigned this Oct 5, 2022
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

1 participant