2
class AgentResponse[T] @JsonCreator()(@JsonProperty("result") val result: T, @JsonProperty("status") val status: ResponseStatus)
class ResponseStatus @JsonCreator()(@JsonProperty("succeeded") val succeeded: Boolean, @JsonProperty("message") val message: String, @JsonProperty("timeStamp") val timeStamp: Long)
new ObjectMapper().registerModule(DefaultScalaModule).writer().writeValue(out, new AgentResponse(result, new ResponseStatus(true, "OK", now)))
이 발생 오류 :Jackson을 사용하여 여러 인수 생성자로 스칼라 객체를 직렬화하는 방법은 무엇입니까?
JsonMappingException: No serializer found for class com.fg.mail.smtp.rest.Handler$AgentResponse and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationConfig.SerializationFeature.FAIL_ON_EMPTY_BEANS))
어떻게 스칼라 객체가 예상대로 작동하려면 같이해야합니까?
감사합니다. – lisak
@ 스핀 제대로 작동하는지 알려주세요. 나는 그것을 시험 할 시간이 없었다. –
예, 예상대로 작동합니다. – lisak