Hi, I would like to clarify "maps" behaviour when fetching properties/yaml configuration from spring-cloud-configuration-service.

Lets say I have two configuration files: application-dev.yml

service:
  configuration:
    1:
      topic: "topic 1"

application-prod.yml

service:
  configuration:
    2:
      topic: "topic 2"

I use endpoint /{label}/{service-name}-{profiles}.properties (from EnvironmentController), profiles=dev,prod. Maps are overridden (logic of overrides EnvironmentController#convertToProperties). But when I use spring-cloud-config-client to load configuration maps are merged.
So my question, is it expected behaviour for properties/yml endpoint? If yes why it's different from client property resolving?

Comment From: ryanjbaxter

What is your intent in these yaml files?

If service.configuration supposed to be an array, ie service.configuration[1].topic = topic1 and service.configuration[2].topic = topic2, or are 1 and 2 supposed to be keys, ie service.configuration.1.topic=topic1 and service.configuration.2.topic=topic2?

Comment From: Ferioney

I that case I expect these as array:

service. configuration[1].topic="topic 1"
service. configuration[2].topic="topic 2"

Actually, configuration-service handles that as array. In my example configuration-service endpoint /{label}/{service-name}-{profiles}.properties returns:

service. configuration[2].topic="topic 2"

oh, I found my issue. The reason is that I use key as integer. In that case it represented as list (prop[X].prop=value) But when I use as string - it looks file (prop.X.prop=value)

Comment From: ryanjbaxter

Right, since it is an integer it gets interpreted as an array and so we override the property because the property name is the same. I am not sure that is right though. Since its an array we should be overriding the individual items in the array not the entire array itself.

This behavior was changed here https://github.com/spring-cloud/spring-cloud-config/pull/2247. It was a performance enhancement when the array was quite large. I can see that being an issue for some people.

I am not sure what the right answer is here.

Comment From: spring-cloud-issues

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

Comment From: spring-cloud-issues

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.