You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Property sources in the environment are ordered, however the /env endpoint doesn't guarantee that a client will see this ordering. It uses a map for the property sources and, while the entries are ordered on the server side, there's no guarantee that a client will preserve that ordering. For example, the ordering of the keys with curl is:
There's also a secondary problem that profiles isn't a property source (it's actually a list of the environment's active profiles) and if someone adds a property source named profiles the two will clash and the profiles property source will overwrite the list of the environment's active profiles.
To make it clear that the ordering of the property sources is significant I think it would be better if the response used a list rather than a map. This would also separate the property sources from the list of active profiles, avoiding the clash. Something like this:
I have a slight preference for the latter as it reinforces the fact that property names are unique within a given source. Ordering isn't important so there's nothing to be gained by using an array.
Property sources in the environment are ordered, however the
/env
endpoint doesn't guarantee that a client will see this ordering. It uses a map for the property sources and, while the entries are ordered on the server side, there's no guarantee that a client will preserve that ordering. For example, the ordering of the keys withcurl
is:profiles
server.ports
servletContextInitParams
systemProperties
systemEnvironment
applicationConfig: [classpath:/application.properties]
But the ordering of the keys with HTTPie is alphabetical:
applicationConfig: [classpath:/application.properties]
profiles
server.ports
servletContextInitParams
systemEnvironment
systemProperties
There's also a secondary problem that
profiles
isn't a property source (it's actually a list of the environment's active profiles) and if someone adds a property source namedprofiles
the two will clash and theprofiles
property source will overwrite the list of the environment's active profiles.To make it clear that the ordering of the property sources is significant I think it would be better if the response used a list rather than a map. This would also separate the property sources from the list of active profiles, avoiding the clash. Something like this:
The text was updated successfully, but these errors were encountered: