[pbs-devel] applied: [PATCH proxmox-backup] api2/config/tape_backup_job: fix duplicate id parameter
Wolfgang Bumiller
w.bumiller at proxmox.com
Wed Feb 24 10:02:07 CET 2021
> On 02/24/2021 9:42 AM Dietmar Maurer <dietmar at proxmox.com> wrote:
>
>
> > > Please can we:
> > >
> > > - support kebab-case
> >
> > ^ that's a quick one, fix for this is in git, will bump & upload in a
> > bit
>
> Ok, thanks!
>
> >
> > > - raise error with unknown property names
> >
> > ^ this is a bit more involved due to flattening
> >
> > One option would be to generate an enum schema for deletable fields,
> > though this requires a change to how we represent enums, so I can nest
> > the flattened objects in there.
> >
> > Another would be to just generate a "string" schema with a verify
> > function which uses the existing property iterators to look for invalid
> > names. (This could probably even generate a lazy_static HashSet for
> > faster checks).
>
> Sound too complex for now ...
> I guess this is not really important - just thought it would be nice to have.
>
> > On Tue, Feb 23, 2021 at 06:00:33PM +0100, Thomas Lamprecht wrote:
> > > On 23.02.21 17:26, Dietmar Maurer wrote:
> > > > applied
> > >
> > > did you read that part:
> > >
> > > On 23.02.21 15:54, Dominik Csapak wrote:
> > > > i am *really* not sure if this is the correct way @Wolfgang, is
> > > > there another wayt to selectively use the struct members for the
> > > > Updater?
> > >
> > >
> > > This makes the ID optional in the schema, which is weird for an API call
> > > with {id} in its url (which means that without ID this can never be reached).
> >
> > Now it's getting tough. Somehow I did not think about that :-)
>
> Cant we simple omit fixed properties from the Updater?
I could try. I'd have to split out the Builder functionality of the Updatable
trait, which is currently what allows `Option<T: Updatable>` to be generically
implemented without specialization, but I could in theory generate implementations
for Option types on the fly as well...
(Currently there's a generic `impl Updatable for Option<T>` going like this:
if the option is Some() already, then update_from(), otherwise try_build_from().)
More information about the pbs-devel
mailing list