Add serialization hint for ProblemDetail

Prior to this commit, a Spring web application would not be able to
serialize a `ProblemDetail` object instance in a Native Image, as
serialization hints would be missing.

This commit adds a RuntimeHints registrar that processes the
`ProblemDetail` type accordingly during the AOT phase.

Fixes gh-29801
This commit is contained in:
Brian Clozel
2023-01-17 10:59:52 +01:00
parent a12c9a0430
commit ebdc82b86b
3 changed files with 97 additions and 0 deletions

View File

@@ -2,6 +2,7 @@ org.springframework.aot.hint.RuntimeHintsRegistrar= \
org.springframework.http.HttpMimeTypesRuntimeHints,\
org.springframework.http.codec.CodecConfigurerRuntimeHints,\
org.springframework.http.converter.json.JacksonModulesRuntimeHints,\
org.springframework.http.converter.json.ProblemDetailRuntimeHints,\
org.springframework.web.util.WebUtilRuntimeHints
org.springframework.beans.factory.aot.BeanRegistrationAotProcessor=\