You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tools/DocGen looked up Newtonsoft's [JsonIgnore]/[JsonProperty], but the RPC layer has serialized with System.Text.Json. Both libraries declare a JsonIgnoreAttribute, so the lookups compiled, always returned null, and silently reported that nothing was ever hidden or renamed. Retargeted to System.Text.Json.Serialization.
Only JsonIgnoreCondition.Always hides a member; Never and the conditional forms still reach the wire and stay documented.
Types of changes
What types of changes does your code introduce?
Bugfix (a non-breaking change that fixes an issue)
New feature (a non-breaking change that adds functionality)
Breaking change (a change that causes existing functionality not to work as expected)
Optimization
Refactoring
Documentation update
Build-related changes
Other: Description
Testing
Requires testing
Yes
No
If yes, did you write tests?
Yes
No
Documentation
Requires documentation update
[] Yes
No
Requires explanation in Release Notes
Yes
No
Remarks
Partially addresses #12836 (fields renamed or omitted on the wire) and #12828 (internal CLR members leaking into the schema): [JsonIgnore]members are no longer published, and [JsonPropertyName] renames are now honoured. Both close once the generator also resolves [JsonConverter]-backed types, in a follow-up PR.
Verdict: looks correct — no Critical/High/Medium findings. The diagnosis in the description checks out and I verified each claim against the tree.
What I verified
Newtonsoft lookups were indeed dead. No Newtonsoft reference remains anywhere in tools/DocGen/, Nethermind.JsonRpc, or Nethermind.Facade, so the old GetCustomAttribute<Newtonsoft.Json.JsonIgnoreAttribute>() / JsonPropertyAttribute calls could only ever return null. Dropping the using is safe — nothing else in the file used it.
JsonIgnoreCondition.Always is the right predicate.JsonIgnoreAttribute.Condition defaults to Always, so a bare [JsonIgnore] (e.g. Error.SuppressWarning, Nethermind.JsonRpc/Error.cs:19) is now correctly dropped from the docs.
Keeping Never / WhenWritingNull / WhenWritingDefault documented is correct and matters in practice — those forms are used widely (ReceiptForRpc, ParityTransaction, FeeHistoryResults, PeerInfo, EthCapabilities, …), and all of them can reach the wire. Never in particular is an opt-in override of the global DefaultIgnoreCondition = WhenWritingNull (EthereumJsonSerializer.cs:96), so hiding it would have been a real regression.
Null-safety of the new expression is fine: with no attribute, ?.Condition is null, and null is not JsonIgnoreCondition.Always → property kept.
[JsonPropertyName] renames now resolve (Error, SignTransactionResult, EthProtocolInfo, JsonRpcSubscriptionResponse, …), and STJ gives [JsonPropertyName] precedence over the naming policy, matching the fallback order here.
Findings
Low — camelCase fallback still diverges from the serializer's policy (JsonRpcGenerator.cs:356). Posted as an inline suggestion: delegate to JsonNamingPolicy.CamelCase.ConvertName(...), the same policy EthereumJsonSerializer uses, instead of the hand-rolled first-char lowercase. No current DTO is affected (YParity converts identically either way), so it's cosmetic today. Fix this →
Low — public fields are still invisible to the generator.EthereumJsonSerializer sets IncludeFields = true (EthereumJsonSerializer.cs:95), but GetSerializableProperties only walks GetProperties(...). No RPC result DTO currently exposes a public field, so there is no doc gap today — worth folding into the follow-up PR alongside the [JsonConverter] work.
Low — OrderBy(p => p.Name) sorts by CLR name, not the serialized name. Now that renames are honoured, a rename can put the docs list out of alphabetical order relative to what a reader sees. No current DTO hits this (e.g. Raw/Transaction → raw/tx stays ordered).
Low — no regression test (repo rule: bug fixes get one). tools/DocGen has no test project, so a test would mean standing one up — reasonable to skip for a tools-only fix, but please eyeball the regenerated docs diff (members disappearing should only be the [JsonIgnore]/Always ones) before merging.
Notes
Nothing consensus-, security-, or hot-path-relevant here — this is a docs generator, not client runtime code. I was not able to run dotnet build tools/DocGen/DocGen.csproj in this environment (command not permitted), so compilation is unverified locally; given System.Text.Json.Serialization is in the BCL and no other Newtonsoft symbol is used in the file, I expect CI to be green.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Partially Fixes #12836 #12828
Changes
tools/DocGenlooked up Newtonsoft's[JsonIgnore]/[JsonProperty], but the RPC layer has serialized withSystem.Text.Json. Both libraries declare aJsonIgnoreAttribute, so the lookups compiled, always returnednull, and silently reported that nothing was ever hidden or renamed. Retargeted toSystem.Text.Json.Serialization.JsonIgnoreCondition.Alwayshides a member;Neverand the conditional forms still reach the wire and stay documented.Types of changes
What types of changes does your code introduce?
Testing
Requires testing
If yes, did you write tests?
Documentation
Requires documentation update
Requires explanation in Release Notes
Remarks
Partially addresses #12836 (fields renamed or omitted on the wire) and #12828 (internal CLR members leaking into the schema):
[JsonIgnore]members are no longer published, and[JsonPropertyName]renames are now honoured. Both close once the generator also resolves[JsonConverter]-backed types, in a follow-up PR.