Skip to content

Commit

Permalink
Merge f003684 into c65b72f
Browse files Browse the repository at this point in the history
  • Loading branch information
kakulisen committed Nov 25, 2019
2 parents c65b72f + f003684 commit a63db12
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
Expand Up @@ -19,6 +19,9 @@

public class HttpStatuses {

public static String OK = "200";
/**
* HTTP/1.0 - RFC 1945
*/
public final static String OK = "200";

}
Expand Up @@ -75,7 +75,7 @@ public OpenAPI toOpenAPI() {
pathItem.operation(HttpMethod.valueOf(operationCtx.getHttpMethod()), operationCtx.toOperation());
}

// 如果没有restful资源则返回null
// return null if there is no restful resource
if (openAPI.getPaths() == null || openAPI.getPaths().size() == 0) {
return null;
}
Expand Down
Expand Up @@ -107,7 +107,7 @@ public Operation toOperation() {
Content content = new Content();
MediaType mediaType = new MediaType();

// 处理参数
// process parameter
List<Parameter> parameterList = parameterContexts.stream()
.map(parameterContext ->
{
Expand Down Expand Up @@ -164,8 +164,9 @@ public void correctResponse(ApiResponses apiResponses) {
if (apiResponses == null) {
return;
}
// 处理响应
// 没有注解被处理

// no annotations are processed
// generate a default response based on the method return value
if (apiResponses.get(HttpStatuses.OK) == null) {
ApiResponse apiResponse = new ApiResponse();

Expand Down
Expand Up @@ -36,7 +36,8 @@ public interface OpenApiAnnotationParser {
void parser(Class<?> cls, OasContext context);

/**
* 用于排序, 对于同一个类,同时只能为springmvc或者jaxrs其中一种
* Used for sorting
* For the same parsing class, only the same programming model can be parsed at the same time.
* @return
*/
int getOrder();
Expand Down

0 comments on commit a63db12

Please sign in to comment.