Skip to content

Commit e66fda9

Browse files
committed
fix(web): remove deny_unknown_fields from API response models
Server responses may include new fields (e.g. created_at_ms) that the client doesn't need. deny_unknown_fields on API response structs causes deserialization to fail on any server-side addition. Remove it from all server-facing models; keep it on client-local types (WorkspaceDoc, etc.).
1 parent 05f450e commit e66fda9

1 file changed

Lines changed: 0 additions & 12 deletions

File tree

crates/tabula-web/src/models.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,19 @@ impl WorkspaceDoc {
3030
}
3131

3232
#[derive(Debug, Clone, Serialize, Deserialize)]
33-
#[serde(deny_unknown_fields)]
3433
pub struct DaemonErrorEnvelope {
3534
pub ok: bool,
3635
pub error: DaemonErrorPayload,
3736
}
3837

3938
#[derive(Debug, Clone, Serialize, Deserialize)]
40-
#[serde(deny_unknown_fields)]
4139
pub struct DaemonErrorPayload {
4240
pub code: String,
4341
pub message: String,
4442
pub details: Option<Value>,
4543
}
4644

4745
#[derive(Debug, Clone, Serialize, Deserialize)]
48-
#[serde(deny_unknown_fields)]
4946
pub struct HealthResponse {
5047
pub ok: bool,
5148
pub status: String,
@@ -54,7 +51,6 @@ pub struct HealthResponse {
5451
}
5552

5653
#[derive(Debug, Clone, Serialize, Deserialize)]
57-
#[serde(deny_unknown_fields)]
5854
pub struct CapabilitiesResponse {
5955
pub ok: bool,
6056
pub service_role: String,
@@ -71,7 +67,6 @@ pub struct CapabilitiesResponse {
7167
}
7268

7369
#[derive(Debug, Clone, Serialize, Deserialize)]
74-
#[serde(deny_unknown_fields)]
7570
pub struct ProgramRecord {
7671
pub program_id: String,
7772
pub table_count: usize,
@@ -80,14 +75,12 @@ pub struct ProgramRecord {
8075
}
8176

8277
#[derive(Debug, Clone, Serialize, Deserialize)]
83-
#[serde(deny_unknown_fields)]
8478
pub struct RegisterProgramResponse {
8579
pub ok: bool,
8680
pub program: ProgramRecord,
8781
}
8882

8983
#[derive(Debug, Clone, Serialize, Deserialize)]
90-
#[serde(deny_unknown_fields)]
9184
pub struct CreateInstanceRecord {
9285
pub instance_id: String,
9386
pub program_id: String,
@@ -97,14 +90,12 @@ pub struct CreateInstanceRecord {
9790
}
9891

9992
#[derive(Debug, Clone, Serialize, Deserialize)]
100-
#[serde(deny_unknown_fields)]
10193
pub struct CreateInstanceResponse {
10294
pub ok: bool,
10395
pub instance: CreateInstanceRecord,
10496
}
10597

10698
#[derive(Debug, Clone, Serialize, Deserialize)]
107-
#[serde(deny_unknown_fields)]
10899
pub struct ExecutePayload {
109100
pub tx_outcomes: Vec<Value>,
110101
pub read_set: Vec<StateCell>,
@@ -116,7 +107,6 @@ pub struct ExecutePayload {
116107
}
117108

118109
#[derive(Debug, Clone, Serialize, Deserialize)]
119-
#[serde(deny_unknown_fields)]
120110
pub struct RunRecordResponse {
121111
pub run_id: String,
122112
pub status: String,
@@ -127,14 +117,12 @@ pub struct RunRecordResponse {
127117
}
128118

129119
#[derive(Debug, Clone, Serialize, Deserialize)]
130-
#[serde(deny_unknown_fields)]
131120
pub struct SubmitRunResponse {
132121
pub ok: bool,
133122
pub run: RunRecordResponse,
134123
}
135124

136125
#[derive(Debug, Clone, Serialize, Deserialize)]
137-
#[serde(deny_unknown_fields)]
138126
pub struct VerifyRunResponse {
139127
pub ok: bool,
140128
pub run: RunRecordResponse,

0 commit comments

Comments
 (0)