Skip to content

JSON config flatter is a tool to transform JSON configuration files with nested keys into a key-value json compatible with Azure App Configuration

License

Notifications You must be signed in to change notification settings

modesto/JsonConfigFlatter

Repository files navigation

JsonConfigFlatter

JSON config flatter is a tool to transform JSON configuration files with nested keys into a key-value JSON file compatible with Azure App Configuration CLI.

As an example, a JSON file like this:

{
  "sampleKey": "sampleValue",
  "sampleObject": {
    "sampleObjectKey": "sampleObject value",
    "sampleObjectInsideObject": {
      "nestedKeyInsideNestedObject":  "renested value"
    }
  },
  "sampleArray": [
    "arrayItem1",
    "arrayItem2",
    "arrayItem3"
  ]
}

Will be converted into this:

{
    "sampleKey": "sampleValue",
    "sampleObject:sampleObjectKey": "sampleObject value",
    "sampleObject:sampleObjectInsideObject:nestedKeyInsideNestedObject":  "renested value",
    "sampleArray:0" : "arrayItem1",
    "sampleArray:1" : "arrayItem2",
    "sampleArray:2" : "arrayItem3",
}

Installation

dotnet tool install --global JsonConfigFlatter

Usage

dotnet flattenconfig --input anyinputfile.json --output anyoutputfile.json

About

JSON config flatter is a tool to transform JSON configuration files with nested keys into a key-value json compatible with Azure App Configuration

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages