forked from proxmox-mirrors/proxmox
schema: AllOf/OneOf: actually perform additional_properties() check
rather than just always allowing additional properties, only return true if any of the available schemas allows it Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
3f92e6286b
commit
bae2cf75de
@ -917,7 +917,12 @@ impl ObjectSchemaType for AllOfSchema {
|
||||
}
|
||||
|
||||
fn additional_properties(&self) -> bool {
|
||||
true
|
||||
self.list.iter().any(|schema| {
|
||||
schema
|
||||
.any_object()
|
||||
.expect("non-object-schema in `AllOfSchema`")
|
||||
.additional_properties()
|
||||
})
|
||||
}
|
||||
|
||||
fn default_key(&self) -> Option<&'static str> {
|
||||
@ -988,7 +993,12 @@ impl ObjectSchemaType for OneOfSchema {
|
||||
}
|
||||
|
||||
fn additional_properties(&self) -> bool {
|
||||
true
|
||||
self.list.iter().any(|(_, schema)| {
|
||||
schema
|
||||
.any_object()
|
||||
.expect("non-object-schema in `OneOfSchema`")
|
||||
.additional_properties()
|
||||
})
|
||||
}
|
||||
|
||||
fn default_key(&self) -> Option<&'static str> {
|
||||
|
Loading…
Reference in New Issue
Block a user