mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-14 04:42:15 +00:00
Fix prop parsing in PROPPATCH
This commit is contained in:
@@ -93,7 +93,14 @@ pub async fn route_proppatch<R: ResourceService>(
|
|||||||
prop: PropertyElement { prop },
|
prop: PropertyElement { prop },
|
||||||
}) => {
|
}) => {
|
||||||
if prop.invalid_property() {
|
if prop.invalid_property() {
|
||||||
|
if <R::Resource as Resource>::list_all_props().contains(&propname.as_str()) {
|
||||||
|
// This happens in following cases:
|
||||||
|
// - read-only properties with #[serde(skip_deserializing)]
|
||||||
|
// - for read-only properties from extensions
|
||||||
|
props_conflict.push(propname)
|
||||||
|
} else {
|
||||||
props_not_found.push(propname);
|
props_not_found.push(propname);
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
match resource.set_prop(prop) {
|
match resource.set_prop(prop) {
|
||||||
|
|||||||
@@ -43,6 +43,17 @@ pub trait Resource: Clone + 'static {
|
|||||||
Self::PropName::VARIANTS
|
Self::PropName::VARIANTS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn list_all_props() -> Vec<&'static str> {
|
||||||
|
let mut props = Self::list_props().to_vec();
|
||||||
|
props.extend(
|
||||||
|
Self::list_extensions()
|
||||||
|
.into_iter()
|
||||||
|
.map(|ext| ext.list_props().to_vec())
|
||||||
|
.concat(),
|
||||||
|
);
|
||||||
|
props
|
||||||
|
}
|
||||||
|
|
||||||
fn get_prop(
|
fn get_prop(
|
||||||
&self,
|
&self,
|
||||||
rmap: &ResourceMap,
|
rmap: &ResourceMap,
|
||||||
|
|||||||
Reference in New Issue
Block a user