servicecomb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "bismy" <bi...@qq.com>
Subject 回复: [Discuss] Do we need to add some reminder logs onSwaggerGeneratorContext selection?
Date Thu, 25 Oct 2018 03:16:52 GMT
I am curious about why run in windows "the output jar file lacked swagger-generator-springmvc
dependency jar" ?
How this happen? If the maven dependency do not define this GAV?


If maven works correctly, this should not happen. And it's seems awkward to check exceptions
due to lack of components. 




------------------ 原始邮件 ------------------
发件人: "willem.jiang"<willem.jiang@gmail.com>;
发送时间: 2018年10月25日(星期四) 上午10:05
收件人: "dev"<dev@servicecomb.apache.org>;

主题: Re: [Discuss] Do we need to add some reminder logs onSwaggerGeneratorContext selection?



+1, we need to let user know how the framework exactly works.

Willem Jiang

Twitter: willemjiang
Weibo: 姜宁willem

On Thu, Oct 25, 2018 at 9:36 AM yhs0092 <yhs0092@163.com> wrote:
>
> OK, JIRA issue has been created, https://issues.apache.org/jira/browse/SCB-979
> As for pojo mode, I think maybe we can check the annotations on the REST interface class.
If the PojoSwaggerGeneratorContext is selected and @RequestMapping or @Path is found, we can
print some extra reminder log. The log level is INFO, so we don't mean that it must be a problem.
>
>
> Yours sincerely
>
>
> Yao Haishi
> yhs0092@163.com
>
>
> On 10/24/2018 21:46,wjm wjm<zzzwjm@gmail.com> wrote:
> log the selected mode is necessary
> but pojo mode not know what's other mode......
>
> Willem Jiang <willem.jiang@gmail.com> 于2018年10月24日周三 下午8:30写道:
>
> Hi Haishi
>
> It's important to let the user know about if there is some fallback
> mechanism is used. In this way we could save user lot of time for the
> trouble shooting. We also need to inform the user from log if there
> are some important configuration information is loaded.
>
> BTW, Please fill a JIRA to track this issue.
>
> Willem Jiang
>
> Twitter: willemjiang
> Weibo: 姜宁willem
>
> On Wed, Oct 24, 2018 at 4:14 PM yhs0092 <yhs0092@163.com> wrote:
>
> Hi guys.
> Yesterday, a user asked me about a 404 error. He packed his JavaChassis
> project into a jar file and ran it on his laptop. But when he invoked the
> rest interface by Postman, a 404 error was returned, while if he ran the
> project in Eclipse, this problem did not occur.
>
>
> Finally we found out there was something wrong with maven. On his
> laptop, if maven packaging command was run in Windows CMD, the output jar
> file lacked swagger-generator-springmvc dependency jar.
> As the implementations of SwaggerGeneratorContext are loaded by SPI
> mechanism, there is no error when some classes are abscent. When the
> expected SpringmvcSwaggerGeneratorContext is abscent, the
> PojoSwaggerGeneratorContext will be used as default. As a result, the
> @RequestMapping tagged on REST interface class is ignored, and the name of
> the class is used as basePath instead of the value specified in
> @RequestMapping.
>
>
> After cleaning local maven repo, the problem disappeared. But in this
> case, there is almost no log for helping locate the problem cause.
>
>
> So do we need to add some log to indicate the potential problem?
> Currently I think we can add log to show which SwaggerGeneratorContext
> is selected to generate swagger schema. And if PojoSwaggerGeneratorContext
> is selected, we can add some extra logic to check whether there is @Path or
> @RequestMapping and remind developer to be aware of the dependency jar
> files.
> Any ideas?
>
>
>
>
> Yours sincerely
>
>
> Yao Haishi
> yhs0092@163.com
>
>
Mime
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message