benjamin-allion / json-node-normalizer

'json-node-normalizer' - NodeJS module that normalize json data types from json schema specifications.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

feat(normalize): add normalization format support (string 'lowercase')

benjamin-allion opened this issue · comments

Details

Be able to normalize specific Json string fields to lowercase.
See #14

Example

const jsonData = { "lastname": "JOHNSON" }
const jsonSchema = { "fields": {
      "type":"object",
      "properties":{
         "lastname":{
              "type": "string",
              "format": "lowercase"
         }
      }
};
const result = await JsonNodeNormalizer.normalize(jsonData, jsonSchema);

Result

{
    "lastname": "johnson"
}

Acceptance Criterias

  • See example
  • Must be able to do the same thing on specific JsonPath

Done v.1.0.4.