Skip to content

ConfigurationProperties initial values not restored on DELETE /actuator/env #1616

@david0

Description

@david0

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)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions