From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 35D526147F for ; Thu, 17 Dec 2020 05:46:11 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 202AF225AD for ; Thu, 17 Dec 2020 05:46:11 +0100 (CET) Received: from mail-ot1-x32b.google.com (mail-ot1-x32b.google.com [IPv6:2607:f8b0:4864:20::32b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 3500F22596 for ; Thu, 17 Dec 2020 05:46:07 +0100 (CET) Received: by mail-ot1-x32b.google.com with SMTP id a109so26037025otc.1 for ; Wed, 16 Dec 2020 20:46:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hollensbe-org.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to; bh=xMNcZj1dIG303Bd2rJhjcKPCGSinFXXYlGjar70IU4s=; b=0k5QzNfkEp2r9zWlbZeBP65PyX399gNRedHVUwAc6a2H6UABjbT3XU6XieYeDIAjb7 fbNwijlvyoQx0J1+59t/wQpO3jGlBHCdeFSiP8f5r3l5uo9QPqIamJUcw1/kWd+AOPNA 2B8vrHRFpLAMZltK0CwmSLLsygK14kZZ9gsKXubJZ06o3dxXyvRXi5ArRt+rqQ4/L6rX ywbu0eQ1xaag4XxoAUGRzR9DBOF/XY5ZK38PnZ5SqgCk3u1Z0oVqivhPjne52IxRB9ur 3TgW7ru3HtjILekucA2YwvzXG6DoMOhzS7lrPrML6GTJor7YKrs1kFasbTwbV56IKXxd 3G2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=xMNcZj1dIG303Bd2rJhjcKPCGSinFXXYlGjar70IU4s=; b=qB3nt9+87IM5/ZRHa7ijc3yjNkbkE7Zv77C4b3MORhA4SC/YkfCSQD28VzQf63+ZP9 azRjcrQmmDJzbZhXgEw85tnIipGX1yXvos+knbG2M0Shpgkl2N/58mIXeE74d4/VS0fP jBj+aPkYmYXvP+/TaSsgJnavocuCcBpeBf6Di2mAtVHxEQ60/u+HjEG/oby+C4wG9rnP oB7VTj1o0zasKAd6i0aCe8F8GxnCvoJO8wOAeAEuEDBb0D+qZWGm6gdd+Rv6Rp8xRbL3 q7vh2OlsGBFdz7KGIH1OsVw9JICyXFATbTb5ubmP7hEvyq+fh/gFoko1T8tssO1G/77+ o3Uw== X-Gm-Message-State: AOAM533MsrhR6ysW4H+22aP8R8Pd9DSlcNqSTGTrdj3pIRU60qXkZ7h2 0W8zgh+3qun2MH+FA6AWdFmIF0ic53qIpxlMs2yW/UPY+Cv1Rg== X-Google-Smtp-Source: ABdhPJxwUe2peIoeszW30r+gO4B00MkZliAeQ8FiWm8CfyeLIcnYV3HoLrgk3YKTDYMCzjulcBCF1fnobsAT3lDZ4Xw= X-Received: by 2002:a9d:2643:: with SMTP id a61mr12371115otb.158.1608180359294; Wed, 16 Dec 2020 20:45:59 -0800 (PST) MIME-Version: 1.0 From: Erik Hollensbe Date: Wed, 16 Dec 2020 20:45:52 -0800 Message-ID: To: pve-devel@lists.proxmox.com X-SPAM-LEVEL: Spam detection results: 0 DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature HTML_MESSAGE 0.001 HTML included in message RCVD_IN_DNSWL_NONE -0.0001 Sender listed at https://www.dnswl.org/, no trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_NONE 0.001 SPF: sender does not publish an SPF Record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [swagger.io, github.io] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: [pve-devel] OpenAPI converter (similar to JSONSchema generator) X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2020 04:46:11 -0000 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