public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Erik Hollensbe <erik@hollensbe.org>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] OpenAPI converter (similar to JSONSchema generator)
Date: Wed, 16 Dec 2020 20:45:52 -0800	[thread overview]
Message-ID: <CADHGEEKK-nzX6QDmu-4eqTDNhoQd54iLHL7891mJ4Arj6C7OMQ@mail.gmail.com> (raw)

The specification is here and has similar semantics and goals to
jsonschema, just really good codegen support:
https://swagger.io/specification/

What I am proposing is a module that sits alongside the JSONSchema package
and generates an openapi.json/swagger.json on http request, so that the
client can either be dynamically configured or generated from a request to
a server. It could also be served on proxmox's website for simpler
generation.

It looks like this is doable with the separation of concerns in JSONSchema
and RESTHandler, since all the former does is extract data from the latter,
unless I am misreading things. A swagger/openapi generator would do
something similar. Swagger is just JSON as well, so there's no magic
formatting or parsing that needs to take place.

I am comfortable (but rusty) in perl and can read your json schema code
fine, and am willing to make the patches to generate the specification
assuming this is OK and acceptable to the powers that be.

The advantages are a healthy ecosystem of code generators (
https://github.com/OpenAPITools/openapi-generator) and also documentation
tools, like this one: https://redocly.github.io/redoc/.

I think the package could be delivered in a few weeks assuming a
development environment is easy enough to get going.

Thanks for your time,

-Erik


             reply	other threads:[~2020-12-17  4:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-17  4:45 Erik Hollensbe [this message]
2020-12-18 10:02 ` Thomas Lamprecht
2020-12-18 11:27   ` Erik Hollensbe
2020-12-18 13:12     ` Thomas Lamprecht

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=CADHGEEKK-nzX6QDmu-4eqTDNhoQd54iLHL7891mJ4Arj6C7OMQ@mail.gmail.com \
    --to=erik@hollensbe.org \
    --cc=pve-devel@lists.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal