Skip to content

Unexpected behavior when updating existing value in structure data #16

@ngoan1608

Description

@ngoan1608

Hi,

I found an issue this package when writing selftest for variant switch feature.
I tried to update and define new key for existing structure data, but it seems that existing data is overwritten by the new definition instead of updating.

Please refer my situation as below:

  • My config json file:
{
  "[import]": "./common/test_config_common.json",
  "params": {
    // Global parameters
    "global": {
      "[import]": "./common/params_global_common.json",
      "[import]": "./common/params_global_variant1.json"
    }
  },
  "preprocessor": {
    "definitions": {
      // FEATURE switches
      "[import]": "./common/preprocessor_definitions_common.json",
      "[import]": "./common/preprocessor_definitions_variant1.json"
    }
  },
  "Project": "variant_1"
}
  • params_global_common.json file:
{
  "gGlobalIntParam" : 1,
  
  "gGlobalFloatParam" : 1.332,
  
  "gGlobalString"   : "This is a string", // just for test
   
  "gGlobalStructure": {
    "general": "general",
    "testing": 16
  }
}
  • params_global_variant1.json file:
{
  "gGlobalVariant1" : "Specific global parameter for variant 1",
  "gGlobalStructure": {
    "general": "variant1"
  }
}

I expect that gGlobalStructure.general is upadated as "variant1" and gGlobalStructure.testing should be remained as 16.
The result I got is gGlobalStructure variable contains only new value of 'general'.

  "gGlobalStructure": {
    "general": "variant1"
  }

Thank you,
Ngoan

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions