one-data-model / language

(Old repo:) Simple Definition Format (SDF) for One Data Model definitions
7 stars 4 forks source link

Need ODM SDF Syntax to Cover Enumeration and Property Compatibility Version Information #49

Open gerickson opened 5 years ago

gerickson commented 5 years ago

In Weave Data Language (WDL), enumerations and properties may be decorated with compatibility information to control the visibility of the enumeration or property within the enclosing or referencing trait.

To be expressed in ODM SDF losslessly, a syntax construct for representing compatibility versioning is required.

Relevant Example Schema Input Files

Missing or Unmapped WDL-to-ODM SDF Syntax

Example Input WDL

message BoltLockTrait {
    option (wdl.message_type) = TRAIT;
    option (wdl.trait) = {
        stability: ALPHA,
        id: 0x0E02,
        vendor_id: 0x0000,
        version: 2
    };

    enum BoltState {
        BOLT_STATE_UNSPECIFIED = 0;
        BOLT_STATE_RETRACTED   = 1;
        BOLT_STATE_EXTENDED    = 2;
    }

    enum BoltLockActorMethod {
        BOLT_LOCK_ACTOR_METHOD_UNSPECIFIED          =  0;
        BOLT_LOCK_ACTOR_METHOD_OTHER                =  1;
        BOLT_LOCK_ACTOR_METHOD_PHYSICAL             =  2;
        BOLT_LOCK_ACTOR_METHOD_KEYPAD_PIN           =  3;
        BOLT_LOCK_ACTOR_METHOD_LOCAL_IMPLICIT       =  4;
        BOLT_LOCK_ACTOR_METHOD_REMOTE_USER_EXPLICIT =  5;
        BOLT_LOCK_ACTOR_METHOD_REMOTE_USER_IMPLICIT =  6;
        BOLT_LOCK_ACTOR_METHOD_REMOTE_USER_OTHER    =  7;
        BOLT_LOCK_ACTOR_METHOD_REMOTE_DELEGATE      =  8;
        BOLT_LOCK_ACTOR_METHOD_LOW_POWER_SHUTDOWN   =  9;
        BOLT_LOCK_ACTOR_METHOD_VOICE_ASSISTANT      = 10 [(wdl.enumvalue) = { compatibility: { min_version: 2 }}];
    }
}