+ for(String key : requestBody.keySet()) {
+ //Filter out all the relationship links that appear in the YAML
+ if(key.equals("description")) {
+ String reqBody=(String)requestBody.get(key);
+ if(reqBody.replaceAll("\\[.*.json\\)", "") != reqBody) {
+ requestBody.put(key, reqBody.replaceAll("\\[.*.json\\)", ""));
+ }
+ }
+ //Filter out all the patchDefinition links that appear in the YAML
+ if(key.equals("schema")) {
+ LinkedHashMap<String,String> reqBody = (LinkedHashMap<String,String>)requestBody.get(key);
+ String schema=reqBody.get("$ref");
+ String schemaNopatch = schema.replace("patchDefinitions", "definitions");
+
+ if(! schema.equals(schemaNopatch)) {
+ reqBody.put("$ref", schemaNopatch);
+ requestBody.put(key, reqBody);
+ }
+ }
+ }