spring-cloud-config
spring-cloud-config copied to clipboard
Multi level arrays bug, cast array to map
Describe the bug When I use a multilevel arrays structure in yaml config and call a json rest I've got a casting bug, it's map instead of array.
Sample I've got a next yml config:
some-info:
description: Example of bug
supported-clients: client1, client2
clients:
client1:
some-number: 0.123
some-string: TEXT
some-custom-format:
client1-params:
operation-params:
- codes: c1, c2, c3, c4
responses:
- type: typeA
response: "response A"
- type: typeB
response: "response B"
- type: typeC
response: "response C"
default-response: "response D"
- codes: c5
response: "response E"
So here we got a map config with a list in section operation-params
and in it's first element, in section responses
. But in fact we got a map in responses
, I think it makes in EnvironmentController
I waiting in json result a response with array like:
...
"responses": [
{...},
{...},
{...}
]
...
but got a:
...
"responses": {
"0": {
"response": "response A",
"type": "typeA"
},
"1": {
"response": "response B",
"type": "typeB"
},
"2": {
"response": "response C",
"type": "typeC"
}
}
...
I am not able to reproduce the issue.
Looks good as expected...