Some gRPC calls would benefit from the oneof clause, particularly all the streaming responses.
For example the PlatformInstallResponse, is currently defined as:
message PlatformInstallResponse {
// Progress of the downloads of the platform and tool files.
DownloadProgress progress = 1;
// Description of the current stage of the installation.
TaskProgress task_progress = 2;
}
could be rewritten as:
message PlatformInstallResponse {
oneof message {
// Progress of the downloads of the platform and tool files.
DownloadProgress progress = 1;
// Description of the current stage of the installation.
TaskProgress task_progress = 2;
// The install result.
PlatformInstallResult result = 3;
}
}
message PlatformInstallResult {}
making explicit the exclusive nature of the fields and reserving space for an explicit call result that could be expanded in the future.
Describe the current behavior
N/A
Arduino CLI version
nightly
Operating system
N/A
Operating system version
N/A
Additional context
Some of the gRPC calls have already been changed in a similar way, this request is to propagate the same change in all the API.
Describe the request
Some gRPC calls would benefit from the
oneof
clause, particularly all the streaming responses.For example the
PlatformInstallResponse
, is currently defined as:could be rewritten as:
making explicit the exclusive nature of the fields and reserving space for an explicit call result that could be expanded in the future.
Describe the current behavior
N/A
Arduino CLI version
nightly
Operating system
N/A
Operating system version
N/A
Additional context
Some of the gRPC calls have already been changed in a similar way, this request is to propagate the same change in all the API.
Issue checklist