liubao68 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_r298862123
 
 

 ##########
 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:
   add a test case for raw java type is preferred.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to