fix(brp): allow params and id to be undefined when deserializing#23661
Open
kfc35 wants to merge 1 commit intobevyengine:mainfrom
Open
fix(brp): allow params and id to be undefined when deserializing#23661kfc35 wants to merge 1 commit intobevyengine:mainfrom
params and id to be undefined when deserializing#23661kfc35 wants to merge 1 commit intobevyengine:mainfrom
Conversation
7478bd4 to
626f51e
Compare
params and id to be undefinedparams and id to be undefined when deserializing
Zeophlite
approved these changes
Apr 4, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Objective
paramsas anOption.iditself also seems to be anOption. If these are not provided in the request object, it should not panic on the deserialization level. Individual methods should handle it, and they do already when its necesssary.Solution
paramsandidshould just flatten the nestedOptioninstead ofunwrapand assuming something is thereTesting
serverexample without params, and it workscurl -d'{"jsonrpc":"2.0","method":"world.list_components","id":1}' -X POST -H "Accept: applcation/json" -H "Content-Type: application/json" http://127.0.0.1:15702schedule.graphto ensure that it panics without params provided on its own (it does) and that params are still read correctly when provided (it does)