mirror of
https://git.proxmox.com/git/proxmox-backup
synced 2025-08-16 10:49:23 +00:00
api: serde-rename deleteable properties to kebab-case
In former commit, the enum members were renamed to be CamelCase, in
accordance with the usual Rust style guide. However, this broke the
GUI in some places due to failing JSON property deserialization.
To fix this, some serde(rename = "kebab-case") directives were added.
Some properties were also serde-renamed to snake_case, otherwise
it would have been necessary to also modify proxmox-widget-toolkit
as well as PVE source code. This can follow in a later commit if so
desired.
Fixes: a2055c38
fix non-camel-case enums
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
This commit is contained in:
parent
1f84ac052b
commit
9936c03a52
@ -103,6 +103,7 @@ pub fn get_config(name: String) -> Result<MediaPoolConfig, Error> {
|
||||
|
||||
#[api()]
|
||||
#[derive(Serialize, Deserialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
/// Deletable property name
|
||||
pub enum DeletableProperty {
|
||||
/// Delete media set allocation policy.
|
||||
|
@ -133,6 +133,7 @@ pub fn read_remote(
|
||||
|
||||
#[api()]
|
||||
#[derive(Serialize, Deserialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
/// Deletable property name
|
||||
pub enum DeletableProperty {
|
||||
/// Delete the comment property.
|
||||
|
@ -22,6 +22,7 @@ static RESOLV_CONF_FN: &str = "/etc/resolv.conf";
|
||||
|
||||
#[api()]
|
||||
#[derive(Serialize, Deserialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
/// Deletable property name
|
||||
pub enum DeletableProperty {
|
||||
/// Delete first nameserver entry
|
||||
|
@ -400,6 +400,7 @@ pub fn create_interface(
|
||||
|
||||
#[api()]
|
||||
#[derive(Serialize, Deserialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
/// Deletable property name
|
||||
pub enum DeletableProperty {
|
||||
/// Delete the IPv4 address property.
|
||||
@ -423,15 +424,17 @@ pub enum DeletableProperty {
|
||||
/// Delete autostart flag
|
||||
Autostart,
|
||||
/// Delete bridge ports (set to 'none')
|
||||
#[serde(rename = "bridge_ports")]
|
||||
BridgePorts,
|
||||
/// Delete bridge-vlan-aware flag
|
||||
#[serde(rename = "bridge_vlan_aware")]
|
||||
BridgeVlanAware,
|
||||
/// Delete bond-slaves (set to 'none')
|
||||
Slaves,
|
||||
/// Delete bond-primary
|
||||
#[serde(rename = "bond-primary")]
|
||||
BondPrimary,
|
||||
/// Delete bond transmit hash policy
|
||||
#[serde(rename = "bond_xmit_hash_policy")]
|
||||
BondXmitHashPolicy,
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user