Skip to content

Commit 55392df

Browse files
quaffrstoyanchev
authored andcommitted
Define xml namespace as constant
See gh-29949
1 parent ca94396 commit 55392df

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

spring-web/src/main/java/org/springframework/http/converter/json/ProblemDetailJacksonXmlMixin.java

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,32 +41,35 @@
4141
* <a href="https://github.com/FasterXML/jackson-dataformat-xml/issues/355">FasterXML/jackson-dataformat-xml#355</a>.
4242
*
4343
* @author Rossen Stoyanchev
44+
* @author Yanming Zhou
4445
* @since 6.0.5
4546
*/
4647
@JsonInclude(NON_EMPTY)
47-
@JacksonXmlRootElement(localName = "problem", namespace = "urn:ietf:rfc:7807")
48+
@JacksonXmlRootElement(localName = "problem", namespace = ProblemDetailJacksonXmlMixin.NAMESPACE)
4849
public interface ProblemDetailJacksonXmlMixin {
4950

50-
@JacksonXmlProperty(namespace = "urn:ietf:rfc:7807")
51+
String NAMESPACE = "urn:ietf:rfc:7807";
52+
53+
@JacksonXmlProperty(namespace = NAMESPACE)
5154
URI getType();
5255

53-
@JacksonXmlProperty(namespace = "urn:ietf:rfc:7807")
56+
@JacksonXmlProperty(namespace = NAMESPACE)
5457
String getTitle();
5558

56-
@JacksonXmlProperty(namespace = "urn:ietf:rfc:7807")
59+
@JacksonXmlProperty(namespace = NAMESPACE)
5760
int getStatus();
5861

59-
@JacksonXmlProperty(namespace = "urn:ietf:rfc:7807")
62+
@JacksonXmlProperty(namespace = NAMESPACE)
6063
String getDetail();
6164

62-
@JacksonXmlProperty(namespace = "urn:ietf:rfc:7807")
65+
@JacksonXmlProperty(namespace = NAMESPACE)
6366
URI getInstance();
6467

6568
@JsonAnySetter
6669
void setProperty(String name, @Nullable Object value);
6770

6871
@JsonAnyGetter
69-
@JacksonXmlProperty(namespace = "urn:ietf:rfc:7807")
72+
@JacksonXmlProperty(namespace = NAMESPACE)
7073
Map<String, Object> getProperties();
7174

7275
}

0 commit comments

Comments
 (0)