telefonicaid / telefonicaid/iotagent-node-lib

Attribute Default Value on Northbound side

Open
#675 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
62
Forks
90
Avg merge
2h 35m
Merged PRs (30d)
1

Description

During initialization of OCB entities, the library set some default attribute values based on type field. Here a snippet from deviceService.js file:

function getInitialValueForType(type) {
    switch (type) {
        case constants.LOCATION_TYPE:
            return constants.LOCATION_DEFAULT;
        case constants.DATETIME_TYPE:
            return constants.DATETIME_DEFAULT;
        default:
            return constants.ATTRIBUTE_DEFAULT;
    }
}

The value of constants.ATTRIBUTE_DEFAULT now is an empty string, what do you think about null value? In my opinion, semantically null is better: we are sensing something, so an empty string could be confused as real measure...

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in deviceService.js at getInitialValueForType and inspect how constants.ATTRIBUTE_DEFAULT is used during OCB entity initialization. Determine whether the default should change from an empty string to null, then verify that initialized non-location and non-datetime attributes receive the intended value.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
backend
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.