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

Honor [JsonConverter] attributes on properties of custom params objects #736

Merged
merged 4 commits into from
Nov 11, 2021

Conversation

AArnott
Copy link
Member

@AArnott AArnott commented Nov 11, 2021

A recent change made in #651 regressed LSP when it changed from asking Newtonsoft.Json to serialize an entire custom params object to serializing each individual property. There are a bunch of considerations for each property that we were no longer taking into account (e.g. JsonConverter, default value skipping properties).

Instead, we go back to letting JsonSerializer take care of the whole object, and simply delete the problematic property when the serializer includes it.

Fixes #735

@rruizGit You may be amused to learn I'm going back to your version of the fix, which gets the job done without breaking stuff as my version of the fix did.

@AArnott AArnott added this to the v2.10 milestone Nov 11, 2021
@codecov-commenter
Copy link

codecov-commenter commented Nov 11, 2021

Codecov Report

Merging #736 (0a22887) into main (ac1f0c5) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #736      +/-   ##
==========================================
- Coverage   91.54%   91.53%   -0.02%     
==========================================
  Files          60       60              
  Lines        5228     5231       +3     
==========================================
+ Hits         4786     4788       +2     
- Misses        442      443       +1     
Impacted Files Coverage Δ
src/StreamJsonRpc/JsonMessageFormatter.cs 91.31% <100.00%> (+0.04%) ⬆️
src/StreamJsonRpc/MessageHandlerBase.cs 93.97% <0.00%> (-2.41%) ⬇️
...pc/Reflection/MessageFormatterDuplexPipeTracker.cs 90.62% <0.00%> (+1.04%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ac1f0c5...0a22887. Read the comment docs.

@AArnott AArnott merged commit 0d27e28 into microsoft:main Nov 11, 2021
@AArnott AArnott deleted the fix735 branch November 11, 2021 18:57
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.

JsonConverter on named params object properties ignored
3 participants