From: Gabriel Goller <g.goller@proxmox.com>
To: Wolfgang Bumiller <w.bumiller@proxmox.com>
Cc: pbs-devel@lists.proxmox.com
Subject: Re: [pbs-devel] [RFC PATCH] schema: allow serializing rust Schema to perl JsonSchema
Date: Thu, 8 May 2025 11:52:27 +0200 [thread overview]
Message-ID: <qtifqo37bg47fb3uqsn452tgdnehqnnmp47kowqcx776nl75ap@tjgoaf5ucbhn> (raw)
In-Reply-To: <t26nlnfp2kclqkotha76a5vz23kjkl6as4aawkj2fw2rkkesox@mpbsb24dhxst>
On 08.05.2025 10:24, Wolfgang Bumiller wrote:
>On Wed, May 07, 2025 at 06:31:14PM +0200, Gabriel Goller wrote:
>> Implement serde::Serialize on the rust Schema, so that we can serialize
>> it and use it as a JsonSchema in perl. This allows us to write a single
>> Schema in rust and reuse it in perl for the api properties.
>>
>> The interesting bits (custom impls) are:
>> * Recursive oneOf type-property resolver
>> * oneOf and allOf implementation
>> * ApiStringFormat skip of ApiStringVerifyFn (which won't work obviously)
>
>I'd like the commit to explain where we actually want to use/need this.
>Long ago (before we had the `OneOf` schema I already started this, but
>figured we didn't really need it anyway at the time.
We would primarily use this for the fabrics feature where SectionConfig
types are defined in rust using the api macro. In pve-network, we
retrieve these rust structs and expose them through the api. The current
issue is that we have to manually write the schema twice – once in rust
and again in the perl api properties. We could eliminate this
duplication by getting the api schema generated in rust and use it in
the perl api properties.
Thanks for the thorough review!
I'll go through all the other stuff now!
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
prev parent reply other threads:[~2025-05-08 9:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-07 16:31 Gabriel Goller
2025-05-08 8:24 ` Wolfgang Bumiller
2025-05-08 9:52 ` Gabriel Goller [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=qtifqo37bg47fb3uqsn452tgdnehqnnmp47kowqcx776nl75ap@tjgoaf5ucbhn \
--to=g.goller@proxmox.com \
--cc=pbs-devel@lists.proxmox.com \
--cc=w.bumiller@proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal