Re: [Asdf] enum abuse in OneDM playground

Michael Koster <michaeljohnkoster@gmail.com> Tue, 30 March 2021 18:44 UTC

Return-Path: <michaeljohnkoster@gmail.com>
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 A318E3A1E26 for <asdf@ietfa.amsl.com>; Tue, 30 Mar 2021 11:44:36 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.097
X-Spam-Level:
X-Spam-Status: No, score=-2.097 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, 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 QUP2-ha1EaVn for <asdf@ietfa.amsl.com>; Tue, 30 Mar 2021 11:44:32 -0700 (PDT)
Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) (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 6B7363A1E25 for <asdf@ietf.org>; Tue, 30 Mar 2021 11:44:32 -0700 (PDT)
Received: by mail-pl1-x636.google.com with SMTP id ay2so6621415plb.3 for <asdf@ietf.org>; Tue, 30 Mar 2021 11:44:32 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=GXy64XbHL9dmC/TmcJPBGl4Be0UhlDmTkI0DSXciWqs=; b=lEynUXL+dY0wEzL+vIQLByb/TyYNbeyd1cC7um7we5JERcD1Abs0Gk0ToO9cpCwRo5 ++LOfX6B5aeQ/XmtgFGCrWG+e+6/EFzz6bm/+Na9upBo75gDufDPwQZuvb1zYWOrP7go chZZtn7ljerfA5yTkyna75Mg0kBERP9U4IzQYuu+c2PPFpt+7MzAEgTjckXHWBB7ioVy dPyNNUG9tdhwHGqkqSP8IEOvPAyDMxCzp9bvunW70kT/P695ABpuqlcnPVoeRPwpME8f hlXPrJ+rQXgUt8lsGxIK/RpuzEe0fcrP88rNJfvns7gWtgL0L65ZRQDg8HULLECXH13b 1tiA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=GXy64XbHL9dmC/TmcJPBGl4Be0UhlDmTkI0DSXciWqs=; b=WZlbvrjPCkl5Na2z3o9ydsP6YkhO3K3GY9JnlV0pFTTHe6FQMrHXHmVgE/1RMl8278 apz44dz2FmvXw4GhmJl6CLuBi6IkVZ3AT7kAAGoh6qxn0RS6Ug1TizRcTfIju7JIrzKa qy/uAMbEMepbxeravlg+l5iE5nrjvIyc3YriKuwE0lsdh0w0BgZLZtWMjcwJmyDx/775 MkP0WhW/kCNqUx7IuQOc/7ySeuF7Xt8O6DIzbllXM+h4xjUZXaFD+I0etlezp7qK99kM JAZ0Rg+uDRRT6yG9rAgBmaDh+jikjAnkQpuL5bmt0OdO+lgFL2xNPypL22Lh9fPa8Bw4 IQYg==
X-Gm-Message-State: AOAM532xN4i4x1eyoRbs7WM0bntPEFz4ObUPzWuzfjem2cXyj1VE1rC1 UDs4UW6EbFeRjakEOzD1x8SK0gb8VQ4=
X-Google-Smtp-Source: ABdhPJxVyTUVt7Awj/tZ3eJzeCaq9rPHeML7CP+7g3NlVrox8f9UQBZrWze1eBZ9G9opco4Lo2Urig==
X-Received: by 2002:a17:90a:7344:: with SMTP id j4mr5361796pjs.223.1617129870684; Tue, 30 Mar 2021 11:44:30 -0700 (PDT)
Received: from [172.16.0.10] (c-71-202-145-92.hsd1.ca.comcast.net. [71.202.145.92]) by smtp.gmail.com with ESMTPSA id x186sm21010836pfc.65.2021.03.30.11.44.29 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Mar 2021 11:44:30 -0700 (PDT)
From: Michael Koster <michaeljohnkoster@gmail.com>
Message-Id: <FA554309-75F2-4ECA-8A11-CD32054E48EB@gmail.com>
Content-Type: multipart/alternative; boundary="Apple-Mail=_D32FACBA-DE2F-4AC9-8FDA-B57A14F6FA69"
Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\))
Date: Tue, 30 Mar 2021 11:44:29 -0700
In-Reply-To: <447CBFA7-7ACB-48FB-837E-71500843768D@tzi.org>
Cc: asdf@ietf.org
To: Carsten Bormann <cabo@tzi.org>
References: <447CBFA7-7ACB-48FB-837E-71500843768D@tzi.org>
X-Mailer: Apple Mail (2.3654.60.0.2.21)
Archived-At: <https://mailarchive.ietf.org/arch/msg/asdf/LsP0kSzyV6HuW7DnNIqn91Oj9rw>
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 18:44:37 -0000

There ia a PR that isn't yet merged:
https://github.com/one-data-model/playground/pull/48 <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