aliasing when changing one field doesnt drop others

This commit is contained in:
Filipriec
2026-09-01 10:50:39 +02:00
parent 7263003684
commit 09dc594afe
7 changed files with 20 additions and 1 deletions

View File

@@ -38,6 +38,10 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
".komp_ac.table_validation.FieldValidation.locked",
"#[serde(default)]",
)
.field_attribute(
".komp_ac.table_validation.UpdateFieldValidationRequest.update_mask",
"#[serde(skip)]",
)
.field_attribute(
".komp_ac.table_definition.ColumnDefinition.boolean_ledger",
"#[serde(default, alias = \"boolean_ledger_operator\")]",

View File

@@ -2,6 +2,8 @@
syntax = "proto3";
package komp_ac.table_validation;
import "google/protobuf/field_mask.proto";
// This proto is the canonical server-side storage and distribution contract for
// client validation configuration.
//
@@ -189,6 +191,11 @@ message UpdateFieldValidationRequest {
string tableName = 2;
string dataKey = 3;
FieldValidation validation = 4;
// Omitted keeps the legacy full-replacement behavior. Otherwise, only the
// selected FieldValidation properties are changed; selecting an absent
// message property deliberately removes it.
google.protobuf.FieldMask update_mask = 5;
}
message UpdateFieldValidationResponse {

Binary file not shown.

View File

@@ -159,6 +159,12 @@ pub struct UpdateFieldValidationRequest {
pub data_key: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub validation: ::core::option::Option<FieldValidation>,
/// Omitted keeps the legacy full-replacement behavior. Otherwise, only the
/// selected FieldValidation properties are changed; selecting an absent
/// message property deliberately removes it.
#[prost(message, optional, tag = "5")]
#[serde(skip)]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]

View File

@@ -257,6 +257,7 @@ impl GrpcClient {
table_name,
data_key,
validation: Some(validation),
update_mask: None,
};
let request = self.authenticated_request(req)?;
let resp = self

2
server

Submodule server updated: 825a5bcf32...7bb3706ec6

View File

@@ -109,6 +109,7 @@ impl ValidationForm {
table_name,
data_key: data_key.clone(),
validation: Some(self.validation(locale, data_key)?),
update_mask: None,
})
}