Re: [Asdf] enum abuse in OneDM playground

Carsten Bormann <cabo@tzi.org> Tue, 30 March 2021 20:19 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 A81233A0839 for <asdf@ietfa.amsl.com>; Tue, 30 Mar 2021 13:19:32 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.219
X-Spam-Level:
X-Spam-Status: No, score=-4.219 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=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 u_Lbwk5hZOhm for <asdf@ietfa.amsl.com>; Tue, 30 Mar 2021 13:19:27 -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 5D7103A0813 for <asdf@ietf.org>; Tue, 30 Mar 2021 13:19:14 -0700 (PDT)
Received: from [192.168.217.152] (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 4F914c4S62zyST; Tue, 30 Mar 2021 22:19:12 +0200 (CEST)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\))
From: Carsten Bormann <cabo@tzi.org>
In-Reply-To: <FA554309-75F2-4ECA-8A11-CD32054E48EB@gmail.com>
Date: Tue, 30 Mar 2021 22:19:12 +0200
Cc: asdf@ietf.org
Content-Transfer-Encoding: quoted-printable
Message-Id: <2D7C6229-9126-4A8B-889F-4916AFC79322@tzi.org>
References: <447CBFA7-7ACB-48FB-837E-71500843768D@tzi.org> <FA554309-75F2-4ECA-8A11-CD32054E48EB@gmail.com>
To: Michael Koster <michaeljohnkoster@gmail.com>
X-Mailer: Apple Mail (2.3654.60.0.2.21)
Archived-At: <https://mailarchive.ietf.org/arch/msg/asdf/4aDt8gY8Le__V6hn8RXpvHFatLg>
Subject: Re: [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 20:19:33 -0000

Indeed!

It seems to me that this was stuck on the scaleM..imum issue, which is now resolved in SDF 1.1.
So maybe we can move this forward with a few changes; I put in a quick review.

Grüße, Carsten


> On 30. Mar 2021, at 20:44, Michael Koster <michaeljohnkoster@gmail.com> wrote:
> 
> There ia a PR that isn't yet merged:
> https://github.com/one-data-model/playground/pull/48
> 
> Updates all of these models to SDF 1.1 syntax.
> 
> Best regards,
> 
> Michael
> 
> 
>> On Mar 30, 2021, at 6:09 AM, Carsten Bormann <cabo@tzi.org> wrote:
>> 
>> 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
>> 
>> -- 
>> ASDF mailing list
>> ASDF@ietf.org
>> https://www.ietf.org/mailman/listinfo/asdf
> 
> -- 
> ASDF mailing list
> ASDF@ietf.org
> https://www.ietf.org/mailman/listinfo/asdf