A deserializer which takes an `&mut Value` and an object
schema reference and deserializes by extracting (removing)
the values from the references serde Value.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
They don't appear in the json data structure and therefore
should not be named separately in the schema. Structs with
flattened fields will become an `AllOf` schema instead.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
it seems that sometimes, the child process signal gets handled
before the parent process signal. Systemd then ignores the
childs signal (finished reloading) and only after going into
reloading state because of the parent. this will never finish.
Instead, wait for the state to change to 'reloading' after sending
that signal in the parent, an only fork afterwards. This way
we ensure that systemd knows about the reloading before actually trying
to do it.
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-By: Fabian Ebner <f.ebner@proxmox.com>
to be non fatal for better error messages, this way the user
will see the compile error, but we still generate all the
code & schema variables so that one error isn't accompanied
by all the ones resulting from not having the generated code
there at all.
Eg.
error: description not allowed on external type
--> src/api2/access/user.rs:472:22
|
472 | description: "Get API token metadata (with config digest).",
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Was previously also accompanied by
error[E0425]: cannot find value `API_METHOD_READ_TOKEN` in this scope
--> src/api2/access/user.rs:774:11
|
699 | pub fn delete_token(
| ------ similarly named constant `API_METHOD_DELETE_TOKEN` defined here
...
774 | .get(&API_METHOD_READ_TOKEN)
| ^^^^^^^^^^^^^^^^^^^^^ help: a constant with a similar name exists: `API_METHOD_DELETE_TOKEN`
The second error was "wrong" and came much later, needlessly
filling the screen if this happened on multiple functions.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
References to external schemas (or types) already include
the description in the external schema and therefore are
illegal.
The implementation consists of multiple parts:
* Introduce a `Maybe` type which can be `Explicit`,
`Derived` or `None`.
* Forbid `Explicit` descriptions on references.
* Instead of bailing out on such errors which causes all of
the generated code to vanish and create heaps of
additional nonsensical errors, add a way to *add* errors
without bailing out immediately via the `error!()` macro.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
when authenticating a token, and not just when authenticating a
user/ticket.
Reported-By: Dominik Jäger <d.jaeger@proxmox.com>
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>