From nobody Mon Mar 22 08:13:57 2021
Return-Path: <jingxuan.n.zhang@gmail.com>
X-Original-To: alto@ietfa.amsl.com
Delivered-To: alto@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1])
 by ietfa.amsl.com (Postfix) with ESMTP id 89BC43A03FB
 for <alto@ietfa.amsl.com>; Mon, 22 Mar 2021 08:13:51 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.197
X-Spam-Level: 
X-Spam-Status: No, score=-0.197 tagged_above=-999 required=5
 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
 DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=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 rg-JNyk9Irty for <alto@ietfa.amsl.com>;
 Mon, 22 Mar 2021 08:13:46 -0700 (PDT)
Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com
 [IPv6:2a00:1450:4864:20::42d])
 (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 1D2683A03F6
 for <alto@ietf.org>; Mon, 22 Mar 2021 08:13:38 -0700 (PDT)
Received: by mail-wr1-x42d.google.com with SMTP id e18so17496321wrt.6
 for <alto@ietf.org>; Mon, 22 Mar 2021 08:13:38 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; 
 h=mime-version:from:date:message-id:subject:to;
 bh=z/HYfA3lyWN4IRQTKDkrzEB7TkaFbGTINOaWei+uHD8=;
 b=sbG96BWuiKhXTL+oJ6dlbPagWKinItVtPSqYZQ1UhJu6ETBPRAxptCfU/T4PclY5n0
 qeAI1fNE7RNmp5UwLsQAc4D8RvJc8ds6QoGeRZyiUJfgGjva+TBagqZUgmpxJwicm2YL
 opizmUIgDvDJAH0q5Y5ZMaVmWoUdhdfSn0BXU6AwjflwBYO5vxXpjej3wx6qUFFh/Ww0
 5lJ5gpmfbbF/YAxWZw0Uoxj5157dRhv6/h8HA/lq0Qfqen71S/rxOUUFrN0E9rZkGgTj
 PJJ7/sGS6DeEzAfWa3sE3Cv1+/e5daJB1QfnB6AHSRh/4nHUJcImQQ6jlBHMUJf9qwTl
 X81w==
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=z/HYfA3lyWN4IRQTKDkrzEB7TkaFbGTINOaWei+uHD8=;
 b=e4yPhBdHofslfuQ6yGVOc+B9mQT9UCw7UCGdGRXAgU2LHHMPmshPt3TTZqd51fTiMV
 sIR+c/vzXblODNjnvE+IdqvXqMNvwT7zT1FF68aY10wGjfjTWMBnMGLyLNq//mSgvXgE
 9ZJVcVwde4PC4yYJMgPlsevh5QH85q1W6vEaI0m1db+TxpiinMf7n+AxC5xp3+dF4NaH
 nm8c0PL+N3PsMfIIF1RKfUAcTnLeHPKrbKpRlRAliem96+cPgR5ewnqOkONLKLCH7sKl
 HMmjD/NhGY7E5HnaeFjpEBkK3c+qs4H9QSs9TGmd4g8Ak8fh8yY/+tCNHvYK3GrXEjDa
 TiVw==
X-Gm-Message-State: AOAM5334jBiPqVt09z4W6hptgdXnfXk6PPJHHstJuhqPCYpm+tG5pvi9
 9ZhgK/B0WhIRTmNRmQVSiLZ6lw7POWZHVoRFkFQQKzLfrq7nZA==
X-Google-Smtp-Source: ABdhPJzLEeKcvFBQ12AYfE/sQCZ5yngHNQajVEbYmfuGDg/FIM67hRp4RJL2fOpKFIBEYcm8Y/1cqnuQr7omFohEUno=
X-Received: by 2002:a5d:4fc5:: with SMTP id h5mr20088wrw.33.1616426014950;
 Mon, 22 Mar 2021 08:13:34 -0700 (PDT)
MIME-Version: 1.0
From: Jensen Zhang <jingxuan.n.zhang@gmail.com>
Date: Mon, 22 Mar 2021 23:13:24 +0800
Message-ID: <CAAbpuyqeUPqr+YwNXk820DZmNE0Ljp11=+P9ngRsURuVTMg4AQ@mail.gmail.com>
To: IETF ALTO <alto@ietf.org>
Content-Type: multipart/alternative; boundary="0000000000006d462605be218227"
Archived-At: <https://mailarchive.ietf.org/arch/msg/alto/ParSWWF2IYsj82fnv1X-aUVK5iI>
Subject: [alto] ALTO JSON Schema Collection
X-BeenThere: alto@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "Application-Layer Traffic Optimization \(alto\) WG mailing list"
 <alto.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/alto>,
 <mailto:alto-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/alto/>
List-Post: <mailto:alto@ietf.org>
List-Help: <mailto:alto-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/alto>,
 <mailto:alto-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 22 Mar 2021 15:13:52 -0000

--0000000000006d462605be218227
Content-Type: text/plain; charset="UTF-8"

Hi all,

As multiple ALTO extensions have been or are going to be published and
introduce multiple versions of the ALTO message formats, I just create a
GitHub repo to maintain a collection of JSON schemas that can be used to
validate ALTO protocol messages in different versions:
https://github.com/openalto/alto-jsonschema

All the JSON schemas use version 7 JSON Schema notation. So far, all the
published RFCs (RFC7285, RFC8189, RFC8895, RFC8896) have been included. The
working drafts that are close to being published are on the way.

Note that each ALTO message format may have multiple versions of JSON
schemas, because multiple standards may extend the same message format. For
example,

1. RFC7285 defines ReqFilteredCostMap, and RFC8189 extends it and modifies
the validation condition. The following ReqFilteredCostMap message can only
pass the validation by JSON schemas applying RFC8189. The RFC7285 version
JSON schema will raise an error about "the required field cost-type is
missing".

~~~
{
    "multi-cost-types": [
        {"cost-mode": "numerical", "cost-metric": "routingcost"},
        {"cost-mode": "numerical", "cost-metric": "shoesize"}
    ],
    "pids" : {
        "srcs" : [ ],
        "dsts" : [ ]
    }
}
~~~

2. RFC7285 defines InfoResourceCostMap, and RFC8896 extends it. The RFC7285
version JSON schema will ignore "meta/calendar-response-attributes" and
pass the validation of the following InfoResourceCostMap message, while the
RFC8896 version schema will raise an error about
"meta/calendar-response-attributes should be an array".

~~~
{
    "meta" : {
        "dependent-vtags" : [
            {
                "resource-id": "my-default-network-map",
                "tag": "3ee2cb7e8d63d9fab71b9b34cbf764436315542e"
            }
        ],
        "cost-type" : { "cost-mode" : "numerical", "cost-metric" :
"throughputrating" },
        "calendar-response-attributes" : {}
    },
    "cost-map" : {
        "PID1": {
            "PID1": [ 1, 12, 14, 18, 14, 14, 14, 18, 19, 20, 11, 12],
            "PID2": [13,  4, 15, 16, 17, 18, 19, 20, 11, 12, 13, 14],
            "PID3": [20, 20, 18, 14, 12, 12, 14, 14, 12, 12, 14, 16]
        }
    }
}
~~~

The README file shows the link to each version of the JSON schema file.
Also, the `examples` directory includes all the JSON format ALTO message
examples appearing in RFCs.

There is an online validator demo that you can use to try the schemas:
https://openalto.github.io/alto-jsonschema/

I hope it will be helpful for others. Also, welcome to extend / correct /
improve it.

Best,
Jensen

--0000000000006d462605be218227
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Hi all,</div><div><br></div><div>As multiple ALTO ext=
ensions have been or are going to be published and introduce multiple versi=
ons of the ALTO message formats, I just create a GitHub repo to maintain a =
collection of JSON schemas that can be used to validate ALTO protocol messa=
ges in different versions:=C2=A0<a href=3D"https://github.com/openalto/alto=
-jsonschema">https://github.com/openalto/alto-jsonschema</a></div><div><br>=
</div><div>All the JSON schemas use version 7 JSON Schema notation. So far,=
 all the published RFCs (RFC7285, RFC8189, RFC8895, RFC8896) have been incl=
uded. The working drafts that are close to being published are on the way.<=
/div><div><br></div><div>Note that each ALTO message format may have multip=
le versions of JSON schemas, because multiple standards may extend the same=
 message format. For example,</div><div><br></div><div>1. RFC7285 defines R=
eqFilteredCostMap, and RFC8189 extends it and modifies the validation condi=
tion. The following ReqFilteredCostMap

 message can only pass the validation by JSON schemas applying RFC8189. The=
=C2=A0RFC7285 version JSON schema will raise an error about &quot;the requi=
red field cost-type is missing&quot;.</div><div><br></div><div>~~~</div><di=
v>{<br>=C2=A0 =C2=A0 &quot;multi-cost-types&quot;: [<br>=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 {&quot;cost-mode&quot;: &quot;numerical&quot;, &quot;cost-metric=
&quot;: &quot;routingcost&quot;},<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 {&quot;cos=
t-mode&quot;: &quot;numerical&quot;, &quot;cost-metric&quot;: &quot;shoesiz=
e&quot;}<br>=C2=A0 =C2=A0 ],<br>=C2=A0 =C2=A0 &quot;pids&quot; : {<br>=C2=
=A0 =C2=A0 =C2=A0 =C2=A0 &quot;srcs&quot; : [ ],<br>=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 &quot;dsts&quot; : [ ]<br>=C2=A0 =C2=A0 }<br>}<br></div><div>~~~</di=
v><div><br></div><div>2. RFC7285 defines InfoResourceCostMap, and RFC8896 e=
xtends it. The RFC7285 version JSON schema will ignore &quot;meta/calendar-=
response-attributes&quot; and pass the validation of the following InfoReso=
urceCostMap message, while the RFC8896 version schema will raise an error a=
bout &quot;meta/calendar-response-attributes should be an array&quot;.</div=
><div><br></div><div>~~~</div><div>{<br>=C2=A0 =C2=A0 &quot;meta&quot; : {<=
br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;dependent-vtags&quot; : [<br>=C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 {<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 &quot;resource-id&quot;: &quot;my-default-network-map&=
quot;,<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;tag=
&quot;: &quot;3ee2cb7e8d63d9fab71b9b34cbf764436315542e&quot;<br>=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 ],<br>=C2=
=A0 =C2=A0 =C2=A0 =C2=A0 &quot;cost-type&quot; : { &quot;cost-mode&quot; : =
&quot;numerical&quot;, &quot;cost-metric&quot; : &quot;throughputrating&quo=
t; },<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;calendar-response-attributes&quo=
t; : {}<br>=C2=A0 =C2=A0 },<br>=C2=A0 =C2=A0 &quot;cost-map&quot; : {<br>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;PID1&quot;: {<br>=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 &quot;PID1&quot;: [ 1, 12, 14, 18, 14, 14, 14, 18, 19, 20=
, 11, 12],<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;PID2&quot;: [=
13, =C2=A04, 15, 16, 17, 18, 19, 20, 11, 12, 13, 14],<br>=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 &quot;PID3&quot;: [20, 20, 18, 14, 12, 12, 14, 14,=
 12, 12, 14, 16]<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 }<br>=C2=A0 =C2=A0 }<br>}<b=
r></div><div>~~~</div><div><div><br></div><div>The README file shows the li=
nk to each version of the JSON schema file. Also, the `examples` directory =
includes all the JSON format ALTO message examples appearing in RFCs.</div>=
</div><div><br></div><div>There is an online validator demo that you can us=
e to try the schemas:=C2=A0<a href=3D"https://openalto.github.io/alto-jsons=
chema/">https://openalto.github.io/alto-jsonschema/</a></div><div><br></div=
><div>I hope it will be helpful for others. Also, welcome to extend / corre=
ct / improve it.</div><div><br></div>Best,<br clear=3D"all"><div><div dir=
=3D"ltr" class=3D"gmail_signature" data-smartmail=3D"gmail_signature"><div =
dir=3D"ltr"><div><div dir=3D"ltr"><div><div dir=3D"ltr">Jensen<br></div></d=
iv></div></div></div></div></div></div>

--0000000000006d462605be218227--

