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

remove json camelCasing with .net core 3.0 #12

Open
graphicsxp opened this issue Apr 7, 2020 · 1 comment
Open

remove json camelCasing with .net core 3.0 #12

graphicsxp opened this issue Apr 7, 2020 · 1 comment

Comments

@graphicsxp
Copy link

graphicsxp commented Apr 7, 2020

Returning camelCasing JSON is now the default in net core 3.0. However, as shown in the sample app, the formatter is modified to return pascal casing as the casing is changed on the client side.

The thing is that everything still work fine if I remove that code

.AddNewtonsoftJson(opt => {
      // Set Breeze defaults for entity serialization
      var ss = JsonSerializationFns.UpdateWithDefaults(opt.SerializerSettings);
      if (ss.ContractResolver is DefaultContractResolver resolver)
      {
          resolver.NamingStrategy = null;  // remove json camelCasing; names are converted on the client.
      }
      ss.Formatting = Newtonsoft.Json.Formatting.Indented; // format JSON for debugging
  });

So is it needed ?

I'd like to return camelCase Json because I'm mixing up breeze and non-breeze controllers.

@steveschmitt
Copy link
Member

That should be fine, as long as your client uses the same NamingConvention.

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