spring-cloud / spring-cloud/spring-cloud-config
Multi level arrays bug, cast array to map
Open
@ryanjbaxter is already working on this.
Since Nov 30, 2020.
bug
- Dominant language
- Java
- Stars
- 2k
- Forks
- 1.3k
- Avg merge
- 2d 59m
- Merged PRs (30d)
- 16
Description
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"
}
}
...
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.