Subject: [Captive-portals] YANG schemas (was Re: [adoption call] draft-donnelly-capport-detection)

From: Martin Thomson <[email-masked]>
Date: Thu, 31 Aug 2017 11:53:38 +1000

On Thu, Aug 31, 2017 at 11:29 AM, Michael Richardson
<[email-masked]> wrote:
> After adoption, I think the WG should consider if describing the JSON in YANG
> would make sense. I've been through this in netconf/anima/6tisch now, and
> while it seems like a silly annoyance at first, it seems to have some
> advantages in the long run.

Hi Michael,

I've been YANG-averse for too long.  I just looked and it seems like a
pretty sensible design overall.  Much more readable than the JSON
content rules.

Do you know if the outer object can be stripped off?  Context is
usually sufficient to avoid that extra layer (and HTTP provides
content-type to provide that context).

Reading https://datatracker.ietf.org/doc/html/rfc7951#section-4 it
appears as though the obvious schema for capport [1] would end up with
instance documents looking like this:

   { "capport:capport" { "captive": false, "end": "2017-01-01T12:22Z" } }

That extra wrapping is a little annoying.  Not fatal, of course.

[1]
module capport {
  yang-version 1.1;
  namespace "urn:...:ietf:...:capport";
  prefix "capport";
  import ietf-yang-types {
    prefix yang;
  }
  // ... metadata stuff
  container top {
    leaf captive {
      type boolean;
    }
    leaf end {
      type yang:date-and-time;
    }
  }
}

---

From: Michael Richardson <[email-masked]>
Date: Thu, 31 Aug 2017 09:57:45 -0400

> content-type to provide that context).

I don't know; it does have the advantage of making the JSON self-identifying,
and also providing built-in versioning. So while annoying to strip off a
layer, it isn't hard. It's just esthetically displeasing.

    > namespace "urn:...:ietf:...:capport";

See, and we are done :-)

--
Michael Richardson <[email-masked]>, Sandelman Software Works
 -= IPv6 IoT consulting =-