I'm getting an error
2020-01-28 18:19:21,311 DEBUG [http-nio-8069-exec-8] ServletInvocableHandlerMethod : Could not resolve parameter [0] in public org.springframework.http.ResponseEntity<org.test.dtos.TestResponse> org.test.controllers.TestController.testRoute(org.test.dtos.TestRequest): JSON parse error: Cannot construct instance of `org.test.dtos.TestChild` (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value ('0'); nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot construct instance of `org.test.dtos.TestChild` (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value ('0')
at [Source: (PushbackInputStream); line: 5, column: 18] (through reference chain: org.test.dtos.TestRequest["children"]->org.test.dtos.TestChildWrapper["child"]->java.util.HashSet[0])
2020-01-28 18:19:21,314 WARN [http-nio-8069-exec-8] DefaultHandlerExceptionResolver : Resolved [org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Cannot construct instance of `org.test.dtos.TestChild` (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value ('0'); nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot construct instance of `org.test.dtos.TestChild` (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value ('0')
at [Source: (PushbackInputStream); line: 5, column: 18] (through reference chain: org.test.dtos.TestRequest["children"]->org.test.dtos.TestChildWrapper["child"]->java.util.HashSet[0])]
when sending:
<?xml version="1.0" encoding="UTF-8"?>
<TestRequest>
<children>
<child>
<childStuffA>0</childStuffA>
<childStuffB>0</childStuffB>
<childStuffC>string</childStuffC>
</child>
</children>
<doubleProperty>0</doubleProperty>
<id>0</id>
<longProperty>0</longProperty>
<stringProperty>string</stringProperty>
</TestRequest>
to the route /test/api/apply
I wrote a sample code on GitHub with the particular issue.
I am using Spring boot 2.2.4-RELEASE and Spring Cloud Hoxton.SR1, you get the pom over there. https://github.com/cmeon/spring-issue-test/tree/master