reta commented on a change in pull request #507: CXF-7957: Swagger2Feature 
Doesn't Work With Swagger Versions Above 1.…
URL: https://github.com/apache/cxf/pull/507#discussion_r252450505
 
 

 ##########
 File path: 
rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/parse/SwaggerParseUtils.java
 ##########
 @@ -131,41 +131,41 @@ public static UserApplication 
getUserApplicationFromJson(String json,
                 userOp.setVerb(operEntry.getKey().toUpperCase());
 
                 Map<String, Object> oper = CastUtils.cast((Map<?, 
?>)operEntry.getValue());
-                
-                userOp.setPath(operPath);
-
-                userOp.setName((String)oper.get("operationId"));
-                List<String> opProduces = 
CastUtils.cast((List<?>)oper.get("produces"));
-                userOp.setProduces(listToString(opProduces));
-
-                List<String> opConsumes = 
CastUtils.cast((List<?>)oper.get("consumes"));
-                userOp.setConsumes(listToString(opConsumes));
-
-                List<Parameter> userOpParams = new LinkedList<>();
-                List<Map<String, Object>> params = 
CastUtils.cast((List<?>)oper.get("parameters"));
-                for (Map<String, Object> param : params) {
-                    String name = (String)param.get("name");
-                    //"query", "header", "path", "formData" or "body"
-                    String paramType = (String)param.get("in");
-                    ParameterType pType = "body".equals(paramType) ? 
ParameterType.REQUEST_BODY
-                        : "formData".equals(paramType)
-                        ? ParameterType.FORM : 
ParameterType.valueOf(paramType.toUpperCase());
-                    Parameter userParam = new Parameter(pType, name);
-
-                    setJavaType(userParam, (String)param.get("type"));
-                    userOpParams.add(userParam);
+                if (oper != null) {
 
 Review comment:
   :+1: 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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