Skip to content

Commit

Permalink
Update spec group
Browse files Browse the repository at this point in the history
  • Loading branch information
djkonro committed Aug 17, 2017
1 parent dc472ca commit 04904b1
Showing 1 changed file with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -364,17 +364,18 @@ public void preprocessSwagger(Swagger swagger) {
}

operation.setOperationId(toOperationId(operationId));
Object v1 = operation.getVendorExtensions().get("x-kubernetes-action");
Object v2 = operation.getVendorExtensions().get("x-kubernetes-group-version-kind");

if(v1 != null || v2 != null) {
Map<String, Object> map = new HashMap<String, Object>();
if(v1 != null)
map.put("x-kubernetes-action", v1);
if(v2 != null)
map.put("x-kubernetes-group-version-kind", v2);

vendorExtensions.put(operationId, map);
Object val = operation.getVendorExtensions().get("x-kubernetes-group-version-kind");
Map<String, Object> map = new HashMap<String, Object>();
Map<String, Object> gvc = new HashMap<String, Object>();

if(val != null ) {
if(((Map<String, Object>)operation.getVendorExtensions().get("x-kubernetes-group-version-kind")).get("group").equals("")){
gvc.put("group", "core");
gvc.put("version", ((Map<String, Object>)operation.getVendorExtensions().get("x-kubernetes-group-version-kind")).get("version"));
gvc.put("kind", ((Map<String, Object>)operation.getVendorExtensions().get("x-kubernetes-group-version-kind")).get("kind"));
map.put("x-kubernetes-group-version-kind", gvc);
operation.setVendorExtensions(map);
}
}
}
}
Expand Down

0 comments on commit 04904b1

Please sign in to comment.