]> git.proxmox.com Git - proxmox.git/commit
schema: implement oneOf schema support
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 16 Mar 2023 16:11:05 +0000 (17:11 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Fri, 2 Feb 2024 11:06:28 +0000 (12:06 +0100)
commitd48a15083529759b82f6a7fd47eace1b54a48739
treed129ecb6fe503579321c6ba72ba7a5f634c745d0
parent1c0edfb518e0b8e2025f9491ec023d938ea3f511
schema: implement oneOf schema support

A 'oneOf' schema is basically exactly what a rust `enum` is.
Exactly one of the possible values must match the data.

This should ultimately be the base to allow using the
`#[api]` macro on a newtype style enum as well as using this
schema as a configuration for our section config parser.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
proxmox-schema/src/de/extract.rs
proxmox-schema/src/de/mod.rs
proxmox-schema/src/de/verify.rs
proxmox-schema/src/format.rs
proxmox-schema/src/schema.rs