[Asdf] enum abuse in OneDM playground

Carsten Bormann <cabo@tzi.org> Tue, 30 March 2021 13:09 UTC

Return-Path: <cabo@tzi.org>
X-Original-To: asdf@ietfa.amsl.com
Delivered-To: asdf@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id BC9D73A1195 for <asdf@ietfa.amsl.com>; Tue, 30 Mar 2021 06:09:33 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.92
X-Spam-Level:
X-Spam-Status: No, score=-1.92 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
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 A0rqANcnbiUT for <asdf@ietfa.amsl.com>; Tue, 30 Mar 2021 06:09:31 -0700 (PDT)
Received: from gabriel-vm-2.zfn.uni-bremen.de (gabriel-vm-2.zfn.uni-bremen.de [134.102.50.17]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 1A5BD3A1196 for <asdf@ietf.org>; Tue, 30 Mar 2021 06:09:30 -0700 (PDT)
Received: from [192.168.217.118] (p548dc178.dip0.t-ipconnect.de [84.141.193.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gabriel-vm-2.zfn.uni-bremen.de (Postfix) with ESMTPSA id 4F8qXn12pRzyhZ; Tue, 30 Mar 2021 15:09:29 +0200 (CEST)
From: Carsten Bormann <cabo@tzi.org>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
X-Mao-Original-Outgoing-Id: 638802568.405084-d386c3670af64703780d3b941818aa73
Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\))
Date: Tue, 30 Mar 2021 15:09:28 +0200
Message-Id: <447CBFA7-7ACB-48FB-837E-71500843768D@tzi.org>
To: asdf@ietf.org
X-Mailer: Apple Mail (2.3608.120.23.2.4)
Archived-At: <https://mailarchive.ietf.org/arch/msg/asdf/f9AivAE-5hb-7LqCW3e31zB8Qe0>
Subject: [Asdf] enum abuse in OneDM playground
X-BeenThere: asdf@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "A Semantic Description Format \(SDF\) for Things and their Interactions and Data" <asdf.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/asdf>, <mailto:asdf-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/asdf/>
List-Post: <mailto:asdf@ietf.org>
List-Help: <mailto:asdf-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/asdf>, <mailto:asdf-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 30 Mar 2021 13:09:34 -0000

The sdf linter didn’t catch this yet:

(1) enum definitions without the redundant “type”: “string”:

** sdfobject-genericdefaulttransitiontime.sdf.json: type nil in {"enum"=>["100 Milliseconds", "1 Second", "10 Seconds", "10 Minutes"]}
** sdfobject-genericlevel.sdf.json: type nil in {"enum"=>["100 Milliseconds", "1 Second", "10 Seconds", "10 Minutes"]}
** sdfobject-genericonoff.sdf.json: type nil in {"enum"=>["Off", "On"]}
** sdfobject-genericonoff.sdf.json: type nil in {"enum"=>["100 Milliseconds", "1 Second", "10 Seconds", "10 Minutes”]}

(2) enum definitions with (correct) string values but the conflicting “type”: “number”:

** sdfobject-level.sdf.json: type "number" in {"enum"=>["Up", "Down"]}
** sdfobject-level.sdf.json: type "number" in {"enum"=>["MinimumDeviceValuePermitted", "SetToPreviousValue"]}
** sdfobject-onoff.sdf.json: type "number" in {"enum"=>["SetOnOffTo0", "SetOnOffTo1", "TogglePreviousOnOff", "SetPreviousOnOff"]}

Wondering whether this is a bug in the models or something that we should address (allow?) in the 1.next spec.

Grüße, Carsten