简体   繁体   English

昂首阔步:API的多个位置未被选择

[英]Swagger : Multiple locations for API not being picked up

In my project there are different packages containing Rest APIs 在我的项目中,有不同的包含Rest API

e.g.
com.mypackage.rest
com.mypackage2.rest
com.mypackage3.rest

I want to document all those. 我想记录所有这些。

I have a maven project having swagger plugin where in locations I am trying to specify multiple locations for Rest API as following 我有一个具有swagger插件的maven项目,在我想要为Rest API指定多个位置的位置如下

<locations>
  com.mypackage.rest;
  com.mypackage2.rest;
  com.mypackage3.rest
</locations>

But when I do mvn clean install, it is not generating swagger json file. 但是当我做mvn clean install时,它不会生成swagger json文件。

PS. PS。 If I am using only one location, json file is being generated properly. 如果我仅使用一个位置,则表示正在正确生成json文件。 Also if I try to put it as following, only last package json file is getting generated. 另外,如果我尝试将其放置如下,则仅生成最后一个包json文件。

<locations>com</locations>

Need help! 需要帮忙!

<locations>com.mypackage.rest;com.mypackage2.rest;com.mypackage3.rest</locations> should do the trick, at least it works for me (version 3.1.x) <locations>com.mypackage.rest;com.mypackage2.rest;com.mypackage3.rest</locations>应该可以解决问题,至少对我有用(版本3.1.x)

In the future (not yet released) the syntax will be: 将来(尚未发布)的语法将是:

<locations> <位置>
<location>com.mypackage.rest</location> <位置> com.mypackage.rest </位置>
<location>com.mypackage2.rest</location> <位置> com.mypackage2.rest </位置>
<location>com.mypackage3.rest</location> <位置> com.mypackage3.rest </位置>
</locations> </地点>

See https://github.com/kongchen/swagger-maven-plugin/issues/328 参见https://github.com/kongchen/swagger-maven-plugin/issues/328

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM