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

add missing JsonPropertyName to Data property #1000

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

NenadSteric
Copy link

@NenadSteric NenadSteric commented Dec 20, 2022

without it you need to force the JsonSerializer to use camelCase with JsonSerializerOptions

Description

adds JsonPropertyName to make the casing consistent with the other properties.

This also makes it possible to use just Serialize without JsonSerializerOptions
as the pubsub json handling code in Dapr needs this property to be lowercase.

This problem had to be fixed during testing of the new Bulk-publish API
where I needed to serialize the CloudEvent classes manually without the DaprClient.

Issue reference

as discussed in
#976 and #944

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests - no new tests necessary, existing ones are green
  • Extended the documentation - fixes an oversight - wouldnt know where to document this

Please comment if any new tests or documentation needs to be created.

@NenadSteric NenadSteric requested review from a team as code owners December 20, 2022 07:29
@NenadSteric NenadSteric changed the title [WIP] add missing JsonPropertyName to Data property add missing JsonPropertyName to Data property Dec 22, 2022
@codecov
Copy link

codecov bot commented Dec 22, 2022

Codecov Report

Patch and project coverage have no change.

Comparison is base (99d874a) 66.42% compared to head (d698577) 66.42%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1000   +/-   ##
=======================================
  Coverage   66.42%   66.42%           
=======================================
  Files         171      171           
  Lines        5758     5758           
  Branches      626      626           
=======================================
  Hits         3825     3825           
  Misses       1784     1784           
  Partials      149      149           
Flag Coverage Δ
net6 66.42% <ø> (ø)
net7 66.42% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
src/Dapr.Client/CloudEvent.cs 100.00% <ø> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@NenadSteric
Copy link
Author

@approvers-dotnet-sdk: anything else needed ?

@NenadSteric NenadSteric force-pushed the fix_JsonSerialization branch 2 times, most recently from 008e7df to 92ad699 Compare January 30, 2023 20:48
NenadSteric and others added 3 commits January 30, 2023 21:48
…o force the JsonSerializer to use camelCase with JsonSerializerOptions

Signed-off-by: Nenad Steric <nenad.steric@gmail.com>
Signed-off-by: Nenad Steric <nenad.steric@zuehlke.com>
@WhitWaldo
Copy link
Contributor

@philliphoff Should we announce this as an upcoming breaking change in the 1.15 release notes and then release with 1.16? Anyone that has been overriding the JsonSerializationOptions with any rules for the names would have their own values here whereas this change would fix the value to "data" regardless of those rules.

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

Successfully merging this pull request may close these issues.

3 participants