[httpapi] New standards for OAS, vocabularies and enumerations

Roberto Polli <robipolli@gmail.com> Thu, 16 December 2021 15:52 UTC

Return-Path: <robipolli@gmail.com>
X-Original-To: httpapi@ietfa.amsl.com
Delivered-To: httpapi@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 72F003A100D for <httpapi@ietfa.amsl.com>; Thu, 16 Dec 2021 07:52:48 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.098
X-Spam-Level:
X-Spam-Status: No, score=-2.098 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kZURvMpMztcW for <httpapi@ietfa.amsl.com>; Thu, 16 Dec 2021 07:52:45 -0800 (PST)
Received: from mail-io1-xd2a.google.com (mail-io1-xd2a.google.com [IPv6:2607:f8b0:4864:20::d2a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 3F3BC3A1033 for <httpapi@ietf.org>; Thu, 16 Dec 2021 07:52:45 -0800 (PST)
Received: by mail-io1-xd2a.google.com with SMTP id k21so35707587ioh.4 for <httpapi@ietf.org>; Thu, 16 Dec 2021 07:52:45 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=LuREcbrGmaovP7IqyI2gM2/MuzXxzZEt+oyNa7WR/GU=; b=R+xWA5ji9L5+8dAtOYFihIZwi3uQ2SNrn1CKjlcy0NYneSXr8pFIkkIrfjcXVCSKOe JRd2iFa23cDZczPQDNRjHcraa3AWq2lANGceUA8ya/xvWRh1s6LsKIQEoePNCrZ1hHiP 6kJsS3DYlI/11EdbZkzrE295DVqFD5gKIhQKTd1LdyDbYpSNptxJmLvChZ6yeQXJMIF/ hyzWoUt6jkJPvtxgSaGLiZ2xHP53eczWsbLiX6+M83XmHQEK2Zb124WKMrm2JT3YeQCm WGD3QBKxwSZhkQZ1AlyCGeHjweDvxJOtdbqxZXwc7U28dC+q7rFjb/jRXCfpOHVD/MKj G2Kw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=LuREcbrGmaovP7IqyI2gM2/MuzXxzZEt+oyNa7WR/GU=; b=uMR7DTM513DJhPbUZDFg0TocRzqOzmfBMtTIdQ3oSibPjjk5lK5+/w+y8uVjhtvviH YrRQFvs8AVU4qNrkzuUl03ir5YKk+ayt/T98+DroiLA4JLhBr40MBFVDr+7EHAIcc0T6 sM9nIzW1vBfib0TVuNr2ZDNYB8c7uZzHsfIONXt+hzGo5Ky7lT8tfbZkHrLG/01VwQY/ oRUx91es3D9IWqCnj9OYSpaN+kcInLRbeLorA6+rNZTjQDImzoUDHLzPr9AakU0cuIC/ C5f+vL4PK/OAkONrzVGNFKagSakjUi6zeGyfNbPukYh+HQcCC/iLozMy3kB12AzDPors VGRw==
X-Gm-Message-State: AOAM531ZJ8tI5kkV5s+IOlVloCNVH7nrV4lozMDNLumdPA2M3gQ9EYLV mE5ZRcCOGDyT+W/NzF3/wf1k2JfKiUKRVglitBxCemfd7a4=
X-Google-Smtp-Source: ABdhPJwje866ght97u1XxuaAoOPlFr3GYhkGFDMtN62Kj3Co3/HqUSfQF9TqenEA6lDqXQPTumdoHJtvuIk6PXYsv8U=
X-Received: by 2002:a05:6638:150e:: with SMTP id b14mr9859932jat.246.1639669959971; Thu, 16 Dec 2021 07:52:39 -0800 (PST)
MIME-Version: 1.0
From: Roberto Polli <robipolli@gmail.com>
Date: Thu, 16 Dec 2021 16:52:29 +0100
Message-ID: <CAP9qbHVgFH7U7M_hSGdM=cAzLqhhCgw65so5ug_14Q-KNtbgyw@mail.gmail.com>
To: "httpapi@ietf.org" <httpapi@ietf.org>
Content-Type: text/plain; charset="UTF-8"
Archived-At: <https://mailarchive.ietf.org/arch/msg/httpapi/iu9rdeM1owo9Rud2opZk7bQBZlI>
Subject: [httpapi] New standards for OAS, vocabularies and enumerations
X-BeenThere: httpapi@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Building Blocks for HTTP APIs <httpapi.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/httpapi>, <mailto:httpapi-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/httpapi/>
List-Post: <mailto:httpapi@ietf.org>
List-Help: <mailto:httpapi-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/httpapi>, <mailto:httpapi-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 16 Dec 2021 15:52:49 -0000

Dear all,

I'm trying to ease the usability of vocabularies/schemas via OAS/JsonSchema
in a standard way.

Imagine the following schema

```
Country:
  type: string
  description: |-
    An alpha-3 country code between the ones available at
    https://countries.example/codes/{country_id}.
    Available codes can be retrieved from
    https://countries.example/code-ids
  enum:
    $ref: https://countries.example/code-ids


```

Currently:

- enum in OAS do not support $ref's
- it could be useful to support some kind of transformations
  such as jsonpath expressions

```
...
   enum:
     $ref: https://countries.example/codes#$.items[*].key
```

This could require some spec tweak, including:

- https://tools.ietf.org/id/draft-goessner-dispatch-jsonpath-00.html

Is anyone interested in the thread?
How do you integrate registries/vocabularies with json-schemas?

Have a nice day,
R.