I'd prefer not to support this feature, at least not encourage users to use 
this feature. Because we consider service interfaces and related models as 
public components to other services. The implementation class (that is the REST 
service implementation) is not a public component. 


This feature may not work fine when we distribute services using JAVA API( that 
the client import the exposed JAVA api to call the remote service). 




------------------ ???????? ------------------
??????: "yhs0092"<[email protected]>;
????????: 2019??1??25??(??????) ????12:54
??????: "[email protected]"<[email protected]>;

????: Re:  [Discuss] Should we support inner class param type defined inREST 
service class?



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
[email protected]


On 1/25/2019 10:46??wjm wjm<[email protected]> wrote??
+1

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

yhs0092 <[email protected]> ??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
[email protected]

Reply via email to