Add a properties setter to ProblemDetail
Mainly to allow Kotlin idiomatic properties assignment. Closes gh-31430
This commit is contained in:
@@ -216,6 +216,18 @@ public class ProblemDetail {
|
||||
this.properties.put(name, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for the {@link #getProperties() properties map}.
|
||||
* <p>By default, this is not set.
|
||||
* <p>When Jackson JSON is present on the classpath, any properties set here
|
||||
* are rendered as top level key-value pairs in the output JSON. Otherwise,
|
||||
* they are rendered as a {@code "properties"} sub-map.
|
||||
* @param properties the properties map
|
||||
*/
|
||||
public void setProperties(@Nullable Map<String, Object> properties) {
|
||||
this.properties = properties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a generic map of properties that are not known ahead of time,
|
||||
* possibly {@code null} if no properties have been added. To add a property,
|
||||
|
||||
Reference in New Issue
Block a user