You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2019/07/01 01:57:26 UTC

[GitHub] [servicecomb-java-chassis] wujimin commented on a change in pull request #1250: [SCB-1336][WIP][WEAK] should not lost @ApiParam description when wrap parameter to body at swagger generator pojo mode

wujimin commented on a change in pull request #1250: [SCB-1336][WIP][WEAK] should not lost @ApiParam description when wrap parameter to body at swagger generator pojo mode
URL: https://github.com/apache/servicecomb-java-chassis/pull/1250#discussion_r298862566
 
 

 ##########
 File path: swagger/swagger-generator/generator-core/src/main/java/org/apache/servicecomb/swagger/SwaggerUtils.java
 ##########
 @@ -115,18 +115,21 @@ public static Swagger parseAndValidateSwagger(String swaggerContent) {
    */
   public static void validateSwagger(Swagger swagger) {
     Map<String, Path> paths = swagger.getPaths();
-    if (paths != null) {
-      for (Path path : paths.values()) {
-        Operation operation = path.getPost();
-        if (operation != null) {
-          List<Parameter> parameters = operation.getParameters();
-          for (Parameter parameter : parameters) {
-            if (BodyParameter.class.isInstance(parameter)) {
-              if (((BodyParameter) parameter).getSchema() == null) {
-                throw new ServiceCombException("swagger validator: body parameter schema is empty.");
-              }
-            }
-          }
+    if (paths == null) {
+      return;
+    }
+
+    for (Path path : paths.values()) {
+      Operation operation = path.getPost();
+      if (operation == null) {
+        continue;
+      }
+
+      for (Parameter parameter : operation.getParameters()) {
+        if (BodyParameter.class.isInstance(parameter) &&
+            !isRawJsonType(parameter) &&
 
 Review comment:
   oh, belongs to another PR actually, :)
   i will add test case for it.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services