proxmox/proxmox-api-macro/tests
Wolfgang Bumiller cb9d57b453 put API_SCHEMA variable into ApiType trait
This way we can assign `API_SCHEMA` constants to `Option`
types.

Here's why:

The api-macro generated code usese `T::API_SCHEMA` when
building ObjectSchemas.

For Updaters we replace `T` with
  `<T as Updatable>::Updater`

This means for "simple" wrappers like our `Authid` or
`Userid`, the ObjectSchema will try to refer to
  `<Authid as Updatable>::Updater::API_SCHEMA`
which resolves to:
  `Option<Authid>::API_SCHEMA`
which does not exist, for which we cannot add a normal
`impl` block to add the schema variable, since `Option` is
not "ours".

But we now have a blanket implementation of `ApiType` for
`Option<T> where T: ApiType` which just points to the
original `T::API_SCHEMA`.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-08-12 10:15:13 +02:00
..
allof.rs move ParameterSchema from router to schema 2021-01-13 13:40:04 +01:00
api1.rs api-macro: support optional return values 2020-12-22 07:02:47 +01:00
api2.rs formatting fixup 2020-11-16 14:21:45 +01:00
ext-schema.rs api-macro: support optional return values 2020-12-22 07:02:47 +01:00
int-limits.rs api-macro: formatting fixups 2020-07-16 14:13:14 +02:00
options.rs test fixups 2020-10-29 14:51:22 +01:00
types.rs api-macro: support optional return values 2020-12-22 07:02:47 +01:00
updater.rs put API_SCHEMA variable into ApiType trait 2021-08-12 10:15:13 +02:00