A new issue[1] is created. I'll analyse the root cause later.

[1] https://issues.apache.org/jira/browse/SCB-1133


Yours sincerely


Yao Haishi
yhs0...@163.com


On 1/25/2019 10:46,wjm wjm<zzz...@gmail.com> wrote:
+1

but if too complex, can IMPL it in weak type engine.

yhs0092 <yhs0...@163.com> 于2019年1月25日周五 上午9:55写道:

Hello, I find out that currently it's not supported to define a inner
class type in the REST service class as parameter. Should we allow such use
case?


For example, a REST service like below will cause
javassist.NotFoundException:
training.demo.provider.service.TestRestService.TestBodyParam
@RestSchema(schemaId = "testSchema")
@RequestMapping(path = "test")
public class TestRestService {
@PostMapping(path = "post")
public String post(@RequestBody TestBodyParam body) {
return null == body ? "null" : body.toString();
}

public static class TestBodyParam {
// fields omitted
}
}


But inner class field in an independent param class is OK:
@RestSchema(schemaId = "testSchema")
@RequestMapping(path = "test")
public class TestRestService {
@PostMapping(path = "post")
public String post(@RequestBody TestBodyParam body) {
return null == body ? "null" : body.toString();
}
}
// define param type in an independent class
public class TestBodyParam {
private InnerBody innerBody;
public static class InnerBody {

// fields omitted
}
// fields omitted
}


As described above, in some case, the inner class param type works well.
If you think this feature should be provided, I'll create a JIRA issue to
track it.


Yours sincerely


Yao Haishi
yhs0...@163.com


Reply via email to