Merge pull request #113 from iisimpler/fix_issue_20210429
fix issue with inlineEnum & url not splice '?' when param is null'
This commit is contained in:
commit
768d522a5a
|
@ -489,7 +489,7 @@ public class ParamsBuildHelper {
|
|||
}
|
||||
String enumComments = javaClass.getComment();
|
||||
if (projectBuilder.getApiConfig().getInlineEnum()) {
|
||||
ApiDataDictionary dataDictionary = projectBuilder.getApiConfig().getDataDictionary(javaClass.getSimpleName());
|
||||
ApiDataDictionary dataDictionary = projectBuilder.getApiConfig().getDataDictionary(javaClass.getCanonicalName());
|
||||
if (Objects.isNull(dataDictionary)) {
|
||||
comment = comment + "<br/>" + JavaClassUtil.getEnumParams(javaClass);
|
||||
} else {
|
||||
|
|
|
@ -527,12 +527,12 @@ public class ApiConfig {
|
|||
this.dataDictionaries = CollectionUtil.asList(dataDictConfigs);
|
||||
}
|
||||
|
||||
public ApiDataDictionary getDataDictionary(String enumClassSimpleName) {
|
||||
public ApiDataDictionary getDataDictionary(String enumClassName) {
|
||||
if (Objects.isNull(this.dataDictionaries)) {
|
||||
return null;
|
||||
}
|
||||
return this.dataDictionaries.stream().filter((apiDataDictionary ->
|
||||
enumClassSimpleName.equalsIgnoreCase(apiDataDictionary.getEnumClassName())))
|
||||
enumClassName.equalsIgnoreCase(apiDataDictionary.getEnumClassName())))
|
||||
.findFirst().orElse(new ApiDataDictionary());
|
||||
}
|
||||
|
||||
|
|
|
@ -466,7 +466,7 @@ public class SpringBootDocBuildTemplate implements IDocBuildTemplate<ApiDoc> {
|
|||
url = UrlUtil.simplifyUrl(url);
|
||||
|
||||
if (requestExample.isJson()) {
|
||||
if (StringUtil.isNotEmpty(requestExample.getJsonBody())) {
|
||||
if (StringUtil.isNotEmpty(body)) {
|
||||
url = url + "?" + body;
|
||||
}
|
||||
CurlRequest curlRequest = CurlRequest.builder()
|
||||
|
|
Loading…
Reference in New Issue