ConfigurationProperties initial values not restored on DELETE /actuator/env (original) (raw)

Describe the bug

We are setting a configuration value via POST /actuator/env and later attempt to restore the original value by running DELETE /actuator/env.
However, this does not work — Spring does not restore the values defined in the field declaration.

Sample

@ConfigurationProperties("my-properties") class MyProperties { private String name = "initial"; }

Change the value via actuator and delete the change:

curl -H 'Content-Type: application/json' --data '{"name": "my-properties.name", "value": "from-actuator"}' -X POST http://localhost:8080/actuator/env

curl -X DELETE http://localhost:8080/actuator/env

After this, the value is still from-env although I would have expected initial again.

It seems likeJavaBeanBinder is not able to do that. (This is even tested here)