SDK deserialization: project.delete (and siblings) returns bool, SDK expects String #29

Open
opened 2026-04-20 14:04:48 +00:00 by zaelgohary · 0 comments
Member

hero_osis_sdk::projects::ProjectsClient::project_delete deserializes the RPC response as String:

pub async fn project_delete(&self, sid: &str) -> Result<(), ClientError> {
    self.client.rpc_call::<String>(
        "project.delete",
        json!({"sid": sid}),
    ).await?;
    Ok(())
}

But the server returns a boolean:

{"jsonrpc":"2.0","result":true,"id":1}

Result: every delete fails client-side with invalid type: boolean \true`, expected a string— even though the server successfully deleted the record. UIs that rely on the returnedResult` branch to trigger a list refetch / navigation get stuck.

Same pattern likely affects every domain's *_delete method in the generated SDK (and any other method whose server return type is bool while the SDK expects String). Worth a sweep.

Fix

Regenerate the SDK client to use rpc_call::<bool> (or a more permissive serde_json::Value) for methods whose server signature returns bool. Alternatively, align the server to stringify its delete return, though that's more intrusive.

`hero_osis_sdk::projects::ProjectsClient::project_delete` deserializes the RPC response as `String`: ```rust pub async fn project_delete(&self, sid: &str) -> Result<(), ClientError> { self.client.rpc_call::<String>( "project.delete", json!({"sid": sid}), ).await?; Ok(()) } ``` But the server returns a boolean: ``` {"jsonrpc":"2.0","result":true,"id":1} ``` Result: every delete fails client-side with `invalid type: boolean \`true\`, expected a string` — even though the server successfully deleted the record. UIs that rely on the returned `Result` branch to trigger a list refetch / navigation get stuck. Same pattern likely affects **every domain's `*_delete` method** in the generated SDK (and any other method whose server return type is `bool` while the SDK expects `String`). Worth a sweep. ## Fix Regenerate the SDK client to use `rpc_call::<bool>` (or a more permissive `serde_json::Value`) for methods whose server signature returns `bool`. Alternatively, align the server to stringify its `delete` return, though that's more intrusive.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_osis#29
No description provided.