Skip to content

Need declarative way to specify programmatically-generated default property values #27

Open
@ChrisRus

Description

In an onm namespace data model declaration you can currently specify either, a static default value for a property, or programmatically-generate a default value via a callback function. The later case is used in cases like assigning a UUID, or timestamp to a data namespace at construction-time.

It's inconvenient to have to clutter onmd-* modules with additional npm dependencies (e.g. to call node-uuid or onm-bundled util functions). Better to extend the namespace declaration grammar to allow common things like UUID's/timestamps to be declared.

e.g.

    {
        namespaceType: 'component',
        jsontTag: 'example',
       namespaceProperties: {
           userImmutable: {
               componentUuid: {
                   generatedDefault: "uuid"
               }
           }
       }

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions