amenezes / config-client

config-client package for spring cloud config and cloud foundry
https://config-client.amenezes.net/
Apache License 2.0
24 stars 17 forks source link

Improper access to nested list #47

Closed amenezes closed 2 years ago

amenezes commented 2 years ago

Platform

Other

Steps to Reproduce

version: <= 1.0.2

First start local development container with:

docker-compose up -d

Second, access/show the config:

python -m config client simpleweb000 --all

Expected Result

╭────────────────────────── report for filter: 'all' ──────────────────────────╮
│ {                                                                            │
│     "example": [                                                             │
│         1,                                                                   │
│         2                                                                    │
│     ],                                                                       │
│     "examples": {                                                            │
│         "float": [                                                           │
│             1.1,                                                             │
│             2.2,                                                             │
│             3.3,                                                             │
│             4.4                                                              │
│         ],                                                                   │
│         "int": [                                                             │
│             1,                                                               │
│             2                                                                │
│         ],                                                                   │
│         "str": [                                                             │
│             "example 1",                                                     │
│             "example 2",                                                     │
│             "example 3"                                                      │
│         ]                                                                    │
│     },                                                                       │
│     "first": {                                                               │
│         "second_1": [                                                        │
│             1,                                                               │
│             2                                                                │
│         ],                                                                   │
│         "second_2": [                                                        │
│             1                                                                │
│         ],                                                                   │
│         "second_3": {                                                        │
│             "third_1": [                                                     │
│                 1,                                                           │
│                 2                                                            │
│             ],                                                               │
│             "third_2": [                                                     │
│                 1,                                                           │
│                 2,                                                           │
│                 3                                                            │
│             ],                                                               │
│             "third_3": {                                                     │
│                 "fourth_1": [                                                │
│                     1,                                                       │
│                     2                                                        │
│                 ],                                                           │
│                 "fourth_2": [                                                │
│                     1                                                        │
│                 ],                                                           │
│                 "fourth_3": [                                                │
│                     1,                                                       │
│                     2,                                                       │
│                     3                                                        │
│                 ],                                                           │
│                 "fourth_4": {                                                │
│                     "fifth_1": [                                             │
│                         1,                                                   │
│                         2                                                    │
│                     ],                                                       │
│                     "fifth_2": [                                             │
│                         1,                                                   │
│                         2,                                                   │
│                         3                                                    │
│                     ]                                                        │
│                 }                                                            │
│             }                                                                │
│         }                                                                    │
│     },                                                                       │
│     "health": {                                                              │
│         "config": {                                                          │
│             "enabled": false                                                 │
│         }                                                                    │
│     },                                                                       │
│     "info": {                                                                │
│         "app": {                                                             │
│             "description": "pws simpleweb000 - development profile",         │
│             "name": "simpleweb000",                                          │
│             "password": "123"                                                │
│         }                                                                    │
│     },                                                                       │
│     "python": {                                                              │
│         "cache": {                                                           │
│             "timeout": 10,                                                   │
│             "type": "simple"                                                 │
│         }                                                                    │
│     },                                                                       │
│     "server": {                                                              │
│         "port": 8080                                                         │
│     },                                                                       │
│     "spring": {                                                              │
│         "cloud": {                                                           │
│             "consul": {                                                      │
│                 "host": "discovery",                                         │
│                 "port": 8500                                                 │
│             }                                                                │
│         }                                                                    │
│     }                                                                        │
│ }                                                                            │
╰──────────────────────────────────────────────────────────────────────────────╯

Actual Result

python -m config client simpleweb000 --all

╭────────────────────────── report for filter: 'all' ──────────────────────────╮
│ {                                                                            │
│     "example": [                                                             │
│         1,                                                                   │
│         2                                                                    │
│     ],                                                                       │
│     "examples": {                                                            │
│         "float": [                                                           │
│             1.1,                                                             │
│             2.2,                                                             │
│             3.3,                                                             │
│             4.4                                                              │
│         ],                                                                   │
│         "int": [                                                             │
│             2                                                                │
│         ],                                                                   │
│         "int[0]": 1,                                                         │
│         "str": [                                                             │
│             "example 1",                                                     │
│             "example 2",                                                     │
│             "example 3"                                                      │
│         ]                                                                    │
│     },                                                                       │
│     "first": {                                                               │
│         "second_1": [                                                        │
│             2                                                                │
│         ],                                                                   │
│         "second_1[0]": 1,                                                    │
│         "second_2": [                                                        │
│             1                                                                │
│         ],                                                                   │
│         "second_3": {                                                        │
│             "third_1": [                                                     │
│                 2                                                            │
│             ],                                                               │
│             "third_1[0]": 1,                                                 │
│             "third_2": [                                                     │
│                 1,                                                           │
│                 2,                                                           │
│                 3                                                            │
│             ],                                                               │
│             "third_3": {                                                     │
│                 "fourth_1": [                                                │
│                     2                                                        │
│                 ],                                                           │
│                 "fourth_1[0]": 1,                                            │
│                 "fourth_2": [                                                │
│                     1                                                        │
│                 ],                                                           │
│                 "fourth_3": [                                                │
│                     1,                                                       │
│                     2,                                                       │
│                     3                                                        │
│                 ],                                                           │
│                 "fourth_4": {                                                │
│                     "fifth_1": [                                             │
│                         2                                                    │
│                     ],                                                       │
│                     "fifth_1[0]": 1,                                         │
│                     "fifth_2": [                                             │
│                         1,                                                   │
│                         2,                                                   │
│                         3                                                    │
│                     ]                                                        │
│                 }                                                            │
│             }                                                                │
│         }                                                                    │
│     },                                                                       │
│     "health": {                                                              │
│         "config": {                                                          │
│             "enabled": false                                                 │
│         }                                                                    │
│     },                                                                       │
│     "info": {                                                                │
│         "app": {                                                             │
│             "description": "pws simpleweb000 - development profile",         │
│             "name": "simpleweb000",                                          │
│             "password": "123"                                                │
│         }                                                                    │
│     },                                                                       │
│     "python": {                                                              │
│         "cache": {                                                           │
│             "timeout": 10,                                                   │
│             "type": "simple"                                                 │
│         }                                                                    │
│     },                                                                       │
│     "server": {                                                              │
│         "port": 8080                                                         │
│     },                                                                       │
│     "spring": {                                                              │
│         "cloud": {                                                           │
│             "consul": {                                                      │
│                 "host": "discovery",                                         │
│                 "port": 8500                                                 │
│             }                                                                │
│         }                                                                    │
│     }                                                                        │
│ }                                                                            │
╰──────────────────────────────────────────────────────────────────────────────╯
amenezes commented 2 years ago

There's a possible fix available in ther version 1.0.3a0 that is under evaluation.

amenezes commented 2 years ago

Fixed in version 1.0.3