-
Notifications
You must be signed in to change notification settings - Fork 7
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 returns PascalCase instead of camelCase #71
Comments
Apparently this is not natively supported in AP.NET Core 2.2 which is the version we currently use. It can be done using this "hack". However, I am not very fond of this solution because of this comment:
Furthermore, it is very high on the general agenda to update to ASP.NET Core 5.0, where this is natively supported. Hopefully, we can make this upgrade within the coming months. |
Hmm... I also returned my own C# POCO's with [JsonProperty("myName")] attribute attached, so I had full control at the other end. Can't this be the approach? |
That is a path that i would not like to follow. Generally, we should have as few tech-specific attributes in the domain model objects as possible. Yes, they are already there, but should be kept at a minimum. This approach would require all properties of all domain model objects to be decorated with an attribute. Formatting of JSON-response is a web-concern rather than a domain model concern. Furthermore, we might switch to System.Text.Json instead of Newtonsoft.Json in future versions of the Web API (making the JsonProperty attribute obsolete) |
I know that this is mostly a "battle" of who should take the pain of temporarily hacking a solution to this problem: frontend or backend. But in my opinion it must take precedence to keep the generic backend components as clean as possible. |
Clean yes. But consistent as well. It will eventually become camecase this would just be a so that we avoid having many places that would suffer from a breaking change later. Because it will come in both json documents, jobs and time series. |
The Web APIs are now updated to ASP.NET 5.0. So the solution is now as described here. Should I add this configuration of SignalR to the VS project templates? |
Hi @larsmichael,
Can we please have the SignalR returning the object in camelCase?
This will make it consistent with the WebAPI format
Thank you.
cc: @FranzThomsen1089
The text was updated successfully, but these errors were encountered: