Uh oh!
There was an error while loading. Please reload this page.
Enable property visibility tests in source-gen mode - #54526
Conversation
ghost
commented
Jun 21, 2021
Tagging subscribers to this area: @eiriktsarpalis, @layomia Issue Details
|
ghost
commented
Jun 21, 2021
Note regarding the This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change. |
42feb2b to
9305808Compare2077e0c to
347577cCompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
This is now at 14 parameters. I wonder if we should just create the JsonPropertyInfo in one call (with minimal parameters) and then set the individual values.
Another option is to pass a struct by ref. This could be made binary forward-compatible (e.g. we only add fields) but would need to be discussed\designed.
There was a problem hiding this comment.
Agree with the feedback that this is getting too long. I like the struct-by-ref idea and will bring it up in design review.
There was a problem hiding this comment.
Could this be detected during source generation instead of at runtime? (and avoid passing this info over). Perhaps a compile error would result (trying to access to private member)?
There was a problem hiding this comment.
Yes this a good idea, but makes testing a bit too difficult to tackle in this PR at this point. Switching from runtime exceptions to compile-time warnings means that test projects won't compile & we'd have to test using a different approach. Will tackle in a follow-up.
There was a problem hiding this comment.
Hm I think we might have to keep this functionality as-is, given that some of the things that cause property-name conflicts (e.g. naming policy) are specified at runtime only. I'll make sure.
8f5785b to
91c74f0Compare91c74f0 to
7712b6dCompare
steveharter
left a comment
There was a problem hiding this comment.
LGTM with later feedback after this PR to review the public API for source gen for alternate strategies.
ghost
commented
Jul 12, 2021
Hello @layomia! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me ( |
layomia
commented
Jul 13, 2021
FYI @romfir, thanks for logging #54385. It has been fixed in this PR, and you can try the fix using the latest build of |
romfir
commented
Jul 13, 2021
@layomia thanks for the info, in the console app it now works, but json serializer stopped working at all with Blazor |
layomia
commented
Jul 13, 2021
@romfir thanks for the update. Can you please file a new issue for this? Any repro information, e.g. a simplified |
romfir
commented
Jul 13, 2021
I've created #55568 |
JsonSerializerfunctionality and theJsonSerializer+ source gen programming model, to ensure functional parity between the two. This PR starts with thePropertyVisibilityTests, but ultimately all the serializer tests will be shared.Currently contains changes from #54527, but will be cleaned up after that PR goes in.