Repository: swagger-api/swagger-parser
Pull request #900 (2018-11-01 06:44:13)

Code roll-in for issue 898
Hi team,

This PR is to solve the issue #898 (Swagger parser failed to parse the input swagger url with space) in open api parser.

Please review the PR and merge the same.

Thanks,
Mohammed Rizwan


Patch:
diff --git a/README.md b/README.md
index b9649cf2..e8bc01f5 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,6 @@
 # Swagger Parser
 
-**NOTE:** If you're looking for `swagger-parser` 1.X and OpenApi 2.0, please refer to [v1 branch](https://github.com/swagger-api/swagger-parser/tree/v1)
-
-[![Build Status](https://img.shields.io/jenkins/s/https/jenkins.swagger.io/view/OSS%20-%20Java/job/oss-swagger-parser-v2.svg)](https://jenkins.swagger.io/view/OSS%20-%20Java/job/oss-swagger-parser-v2)
+[![Build Status](https://img.shields.io/jenkins/s/https/jenkins.swagger.io/view/OSS%20-%20Java/job/oss-swagger-parser-2.0.svg)](https://jenkins.swagger.io/view/OSS%20-%20Java/job/oss-swagger-parser-2.0)
 
 ## Overview 
 This is the swagger parser project, which reads OpenAPI Specifications into current Java POJOs.  It also provides a simple framework to add additional converters from different formats into the Swagger objects, making the entire toolchain available.
@@ -99,7 +97,7 @@ You can include this library from Sonatype OSS for SNAPSHOTS, or Maven central f
 <dependency>
   <groupId>io.swagger.parser.v3</groupId>
   <artifactId>swagger-parser</artifactId>
-  <version>2.0.6-SNAPSHOT</version>
+  <version>2.0.5</version>
 </dependency>
 
 ```
@@ -110,7 +108,7 @@ or
 <dependency>
   <groupId>io.swagger.parser.v3</groupId>
   <artifactId>swagger-parser</artifactId>
-  <version>2.0.6-SNAPSHOT</version>
+  <version>2.0.5</version>
 </dependency>
 
 ```
diff --git a/modules/swagger-parser-core/pom.xml b/modules/swagger-parser-core/pom.xml
index 2076a651..1be34981 100644
--- a/modules/swagger-parser-core/pom.xml
+++ b/modules/swagger-parser-core/pom.xml
@@ -3,7 +3,7 @@
     <parent>
         <groupId>io.swagger.parser.v3</groupId>
         <artifactId>swagger-parser-project</artifactId>
-        <version>2.0.6-SNAPSHOT</version>
+        <version>2.0.5</version>
         <relativePath>../..</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>
diff --git a/modules/swagger-parser-v2-converter/pom.xml b/modules/swagger-parser-v2-converter/pom.xml
index 5fe0918d..53c0a8ca 100644
--- a/modules/swagger-parser-v2-converter/pom.xml
+++ b/modules/swagger-parser-v2-converter/pom.xml
@@ -3,7 +3,7 @@
     <parent>
         <groupId>io.swagger.parser.v3</groupId>
         <artifactId>swagger-parser-project</artifactId>
-        <version>2.0.6-SNAPSHOT</version>
+        <version>2.0.5</version>
         <relativePath>../..</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>
diff --git a/modules/swagger-parser-v3/pom.xml b/modules/swagger-parser-v3/pom.xml
index aef571d0..abcbccb8 100644
--- a/modules/swagger-parser-v3/pom.xml
+++ b/modules/swagger-parser-v3/pom.xml
@@ -3,7 +3,7 @@
     <parent>
         <groupId>io.swagger.parser.v3</groupId>
         <artifactId>swagger-parser-project</artifactId>
-        <version>2.0.6-SNAPSHOT</version>
+        <version>2.0.5</version>
         <relativePath>../..</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>
diff --git a/modules/swagger-parser-v3/src/main/java/io/swagger/v3/parser/processors/ExternalRefProcessor.java b/modules/swagger-parser-v3/src/main/java/io/swagger/v3/parser/processors/ExternalRefProcessor.java
index 7c1f057c..101b068f 100644
--- a/modules/swagger-parser-v3/src/main/java/io/swagger/v3/parser/processors/ExternalRefProcessor.java
+++ b/modules/swagger-parser-v3/src/main/java/io/swagger/v3/parser/processors/ExternalRefProcessor.java
@@ -674,7 +674,7 @@ public final class ExternalRefProcessor {
         RefFormat format = computeRefFormat(subRef.get$ref());
 
         if (!isAnExternalRefFormat(format)) {
-            subRef.set$ref(processRefToExternalSchema(externalFile + subRef.get$ref(), RefFormat.RELATIVE));
+            processRefToExternalSchema(externalFile + subRef.get$ref(), RefFormat.RELATIVE);
             return;
         }
         String $ref = subRef.get$ref();
@@ -723,4 +723,4 @@ public final class ExternalRefProcessor {
     }
 
 
-}
+}
\ No newline at end of file
diff --git a/modules/swagger-parser-v3/src/main/java/io/swagger/v3/parser/util/OpenAPIDeserializer.java b/modules/swagger-parser-v3/src/main/java/io/swagger/v3/parser/util/OpenAPIDeserializer.java
index d2660408..a7dcca31 100644
--- a/modules/swagger-parser-v3/src/main/java/io/swagger/v3/parser/util/OpenAPIDeserializer.java
+++ b/modules/swagger-parser-v3/src/main/java/io/swagger/v3/parser/util/OpenAPIDeserializer.java
@@ -52,7 +52,15 @@ import java.math.BigDecimal;
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.net.URL;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
@@ -90,7 +98,6 @@ public class OpenAPIDeserializer {
     private static final String PATH_PARAMETER = "path";
     private static final String HEADER_PARAMETER = "header";
 
-    private final Set<String> operationIDs = new HashSet<>();
 
     public SwaggerParseResult deserialize(JsonNode rootNode) {
     	return deserialize(rootNode, null);
@@ -293,18 +300,11 @@ public class OpenAPIDeserializer {
             return null;
         }
         List<Tag> tags = new ArrayList<>();
-        Set<String> tagsTracker = new HashSet<>();
         for (JsonNode item : obj) {
             if (item.getNodeType().equals(JsonNodeType.OBJECT)) {
                 Tag tag = getTag((ObjectNode) item, location, result);
                 if (tag != null) {
                     tags.add(tag);
-
-                    if(tagsTracker.contains((String)tag.getName())) {
-                        result.uniqueTags(location,tag.getName());
-                    }
-
-                    tagsTracker.add(tag.getName());
                 }
             }
         }
@@ -524,9 +524,6 @@ public class OpenAPIDeserializer {
                 if (!pathValue.getNodeType().equals(JsonNodeType.OBJECT)) {
                     result.invalidType(location, pathName, "object", pathValue);
                 } else {
-                    if(!pathName.startsWith("/")){
-                        result.warning(location," Resource "+pathName+ " should start with /");
-                    }
                     ObjectNode path = (ObjectNode) pathValue;
                     PathItem pathObj = getPathItem(path,String.format("%s.'%s'", location,pathName), result);
                     paths.put(pathName, pathObj);
@@ -690,7 +687,7 @@ public class OpenAPIDeserializer {
     }
 
 
-    public String getString(String key, ObjectNode node, boolean required, String location, ParseResult result, Set<String> uniqueValues) {
+    public String getString(String key, ObjectNode node, boolean required, String location, ParseResult result) {
         String value = null;
         JsonNode v = node.get(key);
         if (node == null || v == null) {
@@ -702,18 +699,10 @@ public class OpenAPIDeserializer {
             result.invalidType(location, key, "string", node);
         } else {
             value = v.asText();
-            if (uniqueValues != null && !uniqueValues.add(value)) {
-                result.unique(location, "operationId");
-                result.invalid();
-            }
         }
         return value;
     }
 
-    public String getString(String key, ObjectNode node, boolean required, String location, ParseResult result) {
-        return getString(key, node, required, location, result, null);
-    }
-
     public Set<String> getKeys(ObjectNode node) {
         Set<String> keys = new LinkedHashSet<>();
         if (node == null) {
@@ -813,12 +802,6 @@ public class OpenAPIDeserializer {
 
         value = getString("url", node, false, location, result);
         if(StringUtils.isNotBlank(value)) {
-            try {
-               new URL(value);
-            }
-            catch (Exception e) {
-                result.warning(location,value);
-            }
             license.setUrl(value);
         }
 
@@ -850,12 +833,6 @@ public class OpenAPIDeserializer {
 
         value = getString("url", node, false, location, result);
         if(StringUtils.isNotBlank(value)) {
-            try {
-                new URL(value);
-            }
-            catch (Exception e) {
-                result.warning(location,value);
-            }
             contact.setUrl(value);
         }
 
@@ -1073,11 +1050,6 @@ public class OpenAPIDeserializer {
             link.setParameters(getLinkParameters(parametersObject, location, result));
         }
 
-        String requestBody = getString("requestBody",linkNode,false,location,result);
-        if (requestBody!= null) {
-            link.setRequestBody(requestBody);
-        }
-
         ObjectNode headerObject = getObject("headers",linkNode,false,location,result);
         if (headerObject!= null) {
             link.setHeaders(getHeaders(headerObject, location, result));
@@ -1150,13 +1122,14 @@ public class OpenAPIDeserializer {
                 JsonNode ref = node.get("$ref");
                 if (ref != null) {
                     if (ref.getNodeType().equals(JsonNodeType.STRING)) {
+                        PathItem pathItem = new PathItem();
                         String mungedRef = mungedRef(ref.textValue());
                         if (mungedRef != null) {
-                            callback.set$ref(mungedRef);
+                            pathItem.set$ref(mungedRef);
                         }else{
-                            callback.set$ref(ref.textValue());
+                            pathItem.set$ref(ref.textValue());
                         }
-                        return callback;
+                        return callback.addPathItem(name,pathItem);
                     } else {
                         result.invalidType(location, "$ref", "string", node);
                         return null;
@@ -2482,7 +2455,7 @@ public class OpenAPIDeserializer {
         if(docs != null) {
             operation.setExternalDocs(docs);
         }
-        value = getString("operationId", obj, false, location, result, operationIDs);
+        value = getString("operationId", obj, false, location, result);
         if (StringUtils.isNotBlank(value)) {
             operation.operationId(value);
         }
@@ -2697,9 +2670,6 @@ public class OpenAPIDeserializer {
         private Map<Location, JsonNode> unsupported = new LinkedHashMap<>();
         private Map<Location, String> invalidType = new LinkedHashMap<>();
         private List<Location> missing = new ArrayList<>();
-        private List<Location> warnings = new ArrayList<>();
-        private List<Location> unique = new ArrayList<>();
-        private List<Location> uniqueTags = new ArrayList<>();
 
         public ParseResult() {
         }
@@ -2715,17 +2685,6 @@ public class OpenAPIDeserializer {
         public void missing(String location, String key) {
             missing.add(new Location(location, key));
         }
-      
-        public void warning(String location, String key) {
-            warnings.add(new Location(location, key));
-        }
-      
-        public void unique(String location, String key) {
-            unique.add(new Location(location, key));
-
-        }
-
-        public void uniqueTags(String location, String key) {uniqueTags.add(new Location(location,key));}
 
         public void invalidType(String location, String key, String expectedType, JsonNode value) {
             invalidType.put(new Location(location, key), expectedType);
@@ -2756,26 +2715,11 @@ public class OpenAPIDeserializer {
                 String message = "attribute " + location + l.key + " is missing";
                 messages.add(message);
             }
-            for (Location l : warnings) {
-                String location = l.location.equals("") ? "" : l.location + ".";
-                String message = "attribute " + location +l.key;
-                messages.add(message);
-            }
             for (Location l : unsupported.keySet()) {
                 String location = l.location.equals("") ? "" : l.location + ".";
                 String message = "attribute " + location + l.key + " is unsupported";
                 messages.add(message);
             }
-            for (Location l : unique) {
-                String location = l.location.equals("") ? "" : l.location + ".";
-                String message = "attribute " + location + l.key + " is repeated";
-                messages.add(message);
-            }
-            for (Location l : uniqueTags) {
-                String location = l.location.equals("") ? "" : l.location + ".";
-                String message = "attribute " + location + l.key + " is repeated";
-                messages.add(message);
-            }
             return messages;
         }
     }
diff --git a/modules/swagger-parser-v3/src/main/java/io/swagger/v3/parser/util/RemoteUrl.java b/modules/swagger-parser-v3/src/main/java/io/swagger/v3/parser/util/RemoteUrl.java
index a2f5b5a1..f6be2681 100644
--- a/modules/swagger-parser-v3/src/main/java/io/swagger/v3/parser/util/RemoteUrl.java
+++ b/modules/swagger-parser-v3/src/main/java/io/swagger/v3/parser/util/RemoteUrl.java
@@ -94,7 +94,9 @@ public class RemoteUrl {
     public static String cleanUrl(String url) {
         String result = null;
         try {
-             result =url.replaceAll("\\{", "%7B").replaceAll("\\}", "%7D");
+             result =url.replaceAll("\\{", "%7B").
+                     replaceAll("\\}", "%7D").
+                     replaceAll(" ", "%20");
         }catch (Exception t){
             t.printStackTrace();
         }
diff --git a/modules/swagger-parser-v3/src/main/java/io/swagger/v3/parser/util/ResolverFully.java b/modules/swagger-parser-v3/src/main/java/io/swagger/v3/parser/util/ResolverFully.java
index 17523795..4f477814 100644
--- a/modules/swagger-parser-v3/src/main/java/io/swagger/v3/parser/util/ResolverFully.java
+++ b/modules/swagger-parser-v3/src/main/java/io/swagger/v3/parser/util/ResolverFully.java
@@ -5,7 +5,6 @@ import io.swagger.v3.oas.models.Operation;
 import io.swagger.v3.oas.models.PathItem;
 import io.swagger.v3.oas.models.callbacks.Callback;
 import io.swagger.v3.oas.models.examples.Example;
-import io.swagger.v3.oas.models.links.Link;
 import io.swagger.v3.oas.models.media.ArraySchema;
 import io.swagger.v3.oas.models.media.ComposedSchema;
 import io.swagger.v3.oas.models.media.MediaType;
@@ -14,12 +13,12 @@ import io.swagger.v3.oas.models.media.Schema;
 import io.swagger.v3.oas.models.parameters.Parameter;
 import io.swagger.v3.oas.models.parameters.RequestBody;
 import io.swagger.v3.oas.models.responses.ApiResponse;
-import io.swagger.v3.oas.models.responses.ApiResponses;
 import io.swagger.v3.parser.models.RefFormat;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.LinkedHashMap;
@@ -48,9 +47,8 @@ public class ResolverFully {
     private Map<String, Schema> schemas;
     private Map<String, Schema> resolvedModels = new HashMap<>();
     private Map<String, Example> examples;
-    private Map<String, Parameter> parameters;
     private Map<String, RequestBody> requestBodies;
-    private Map<String, Link> links;
+
 
     public void resolveFully(OpenAPI openAPI) {
         if (openAPI.getComponents() != null && openAPI.getComponents().getRequestBodies() != null) {
@@ -74,21 +72,6 @@ public class ResolverFully {
             }
         }
 
-
-        if (openAPI.getComponents() != null && openAPI.getComponents().getParameters() != null) {
-            parameters = openAPI.getComponents().getParameters();
-            if (parameters == null) {
-                parameters = new HashMap<>();
-            }
-        }
-        if (openAPI.getComponents() != null && openAPI.getComponents().getLinks() != null) {
-            links = openAPI.getComponents().getLinks();
-            if (links == null) {
-                links = new HashMap<>();
-
-            }
-        }
-
         if(openAPI.getPaths() != null) {
             for (String pathname : openAPI.getPaths().keySet()) {
                 PathItem pathItem = openAPI.getPaths().get(pathname);
@@ -102,7 +85,6 @@ public class ResolverFully {
             // inputs
             if (op.getParameters() != null) {
                 for (Parameter parameter : op.getParameters()) {
-                    parameter = parameter.get$ref() != null ? resolveParameter(parameter) : parameter;
                     if (parameter.getSchema() != null) {
                         Schema resolved = resolveSchema(parameter.getSchema());
                         if (resolved != null) {
@@ -156,10 +138,9 @@ public class ResolverFully {
                 }
             }
             // responses
-            ApiResponses responses = op.getResponses();
-            if(responses != null) {
-                for(String code : responses.keySet()) {
-                    ApiResponse response = responses.get(code);
+            if(op.getResponses() != null) {
+                for(String code : op.getResponses().keySet()) {
+                    ApiResponse response = op.getResponses().get(code);
                     if (response.getContent() != null) {
                         Map<String, MediaType> content = response.getContent();
                         for(String mediaType: content.keySet()){
@@ -174,31 +155,11 @@ public class ResolverFully {
                             }
                         }
                     }
-                    Map<String, Link> links = response.getLinks();
-                    if (links != null) {
-                        for (Map.Entry<String, Link> link : links.entrySet()) {
-                            Link value = link.getValue();
-                            Link resolvedValue = value.get$ref() != null ? resolveLink(value) : value;
-                            link.setValue(resolvedValue);
-                        }
-                    }
                 }
             }
         }
     }
 
-    public Link resolveLink(Link link){
-        RefFormat refFormat = computeRefFormat(link.get$ref());
-        String $ref = link.get$ref();
-        if (!isAnExternalRefFormat(refFormat)){
-            if (links != null && !links.isEmpty()) {
-                String referenceKey = computeDefinitionName($ref);
-                return links.getOrDefault(referenceKey, link);
-            }
-        }
-        return link;
-    }
-
     public RequestBody resolveRequestBody(RequestBody requestBody){
         RefFormat refFormat = computeRefFormat(requestBody.get$ref());
         String $ref = requestBody.get$ref();
@@ -211,18 +172,6 @@ public class ResolverFully {
         return requestBody;
     }
 
-    public Parameter resolveParameter(Parameter parameter){
-        String $ref = parameter.get$ref();
-        RefFormat refFormat = computeRefFormat($ref);
-        if (!isAnExternalRefFormat(refFormat)){
-            if (parameters != null && !parameters.isEmpty()) {
-                String referenceKey = computeDefinitionName($ref);
-                return parameters.getOrDefault(referenceKey, parameter);
-            }
-        }
-        return parameter;
-    }
-
     public Schema resolveSchema(Schema schema) {
         if(schema.get$ref() != null) {
             String ref= schema.get$ref();
@@ -405,11 +354,7 @@ public class ResolverFully {
                         }
                     }
                 }
-                if (schema.getExample() != null) {
-                    model.setExample(schema.getExample());
-                } else if (!examples.isEmpty()) {
-                    model.setExample(examples);
-                }
+                model.setExample(examples);
                 return model;
             } else {
                 // User don't want to aggregate composed schema, we only solve refs
diff --git a/modules/swagger-parser/pom.xml b/modules/swagger-parser/pom.xml
index 8acd8c28..6c73e870 100644
--- a/modules/swagger-parser/pom.xml
+++ b/modules/swagger-parser/pom.xml
@@ -3,7 +3,7 @@
     <parent>
         <groupId>io.swagger.parser.v3</groupId>
         <artifactId>swagger-parser-project</artifactId>
-        <version>2.0.6-SNAPSHOT</version>
+        <version>2.0.5</version>
         <relativePath>../..</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>
diff --git a/pom.xml b/pom.xml
index 1d5a3c21..85c87b5a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -8,7 +8,7 @@
     <modelVersion>4.0.0</modelVersion>
     <groupId>io.swagger.parser.v3</groupId>
     <artifactId>swagger-parser-project</artifactId>
-    <version>2.0.6-SNAPSHOT</version>
+    <version>2.0.5</version>
     <packaging>pom</packaging>
     <name>swagger-parser-project</name>
     <developers>
@@ -263,7 +263,7 @@
         </repository>
     </repositories>
     <properties>
-        <swagger-parser-v2-version>1.0.40-SNAPSHOT</swagger-parser-v2-version>
+        <swagger-parser-v2-version>1.0.39</swagger-parser-v2-version>
         <commons-io-version>2.4</commons-io-version>
         <slf4j-version>1.6.3</slf4j-version>
         <swagger-core-version>2.0.4</swagger-core-version>


Test patch:
diff --git a/modules/swagger-parser-v3/src/test/java/io/swagger/v3/parser/test/OpenAPIResolverTest.java b/modules/swagger-parser-v3/src/test/java/io/swagger/v3/parser/test/OpenAPIResolverTest.java
index 649f0b3f..1d42b0d0 100644
--- a/modules/swagger-parser-v3/src/test/java/io/swagger/v3/parser/test/OpenAPIResolverTest.java
+++ b/modules/swagger-parser-v3/src/test/java/io/swagger/v3/parser/test/OpenAPIResolverTest.java
@@ -1,13 +1,11 @@
 package io.swagger.v3.parser.test;
 
-import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
 import com.github.tomakehurst.wiremock.WireMockServer;
 import com.github.tomakehurst.wiremock.client.WireMock;
 import com.github.tomakehurst.wiremock.core.WireMockConfiguration;
-import io.swagger.v3.core.util.Json;
 import io.swagger.v3.oas.models.Components;
 import io.swagger.v3.oas.models.OpenAPI;
 import io.swagger.v3.oas.models.Operation;
@@ -341,11 +339,11 @@ public class OpenAPIResolverTest {
 
         Map<String, Callback> callbacks = openAPI.getComponents().getCallbacks();
         // internal callback reference
-        assertEquals(callbacks.get("referenced").get$ref(),"#/components/callbacks/failed");
+        assertEquals(callbacks.get("referenced").get("$ref").get$ref(),"#/components/callbacks/failed");
         //callback pathItem -> operation ->requestBody
         assertEquals(callbacks.get("heartbeat").get("$request.query.heartbeat-url").getPost().getRequestBody().get$ref(),"#/components/requestBodies/requestBody3");
         //remote callback ref
-        assertEquals(callbacks.get("remoteCallback").get$ref(),"http://localhost:" + serverPort + "/remote/callback");
+        assertEquals(callbacks.get("remoteCallback").get("$ref").get$ref(),"#/components/callbacks/callback");
 
     }
 
@@ -742,20 +740,6 @@ public class OpenAPIResolverTest {
         Assert.assertTrue(examples.size() == 2);
     }
 
-    @Test
-    public void allOfExampleGeneration(@Injectable final List<AuthorizationValue> auths) throws JsonProcessingException {
-        ParseOptions options = new ParseOptions();
-        options.setResolve(true);
-        options.setResolveFully(true);
-        OpenAPI openAPI = new OpenAPIV3Parser().read("src/test/resources/simpleAllOf.yaml", null, options);
-
-        Assert.assertNotNull(openAPI);
-        Object withoutExample = openAPI.getPaths().get("/foo").getGet().getResponses().get("200").getContent().get("application/json").getSchema().getExample();
-        Assert.assertNull(withoutExample);
-
-        Object withExample = openAPI.getPaths().get("/bar").getGet().getResponses().get("200").getContent().get("application/json").getSchema().getExample();
-        Assert.assertEquals("{\"someProperty\":\"ABC\",\"someOtherProperty\":42}", Json.mapper().writeValueAsString(withExample));
-    }
 
     @Test
     public void testSwaggerResolver(@Injectable final OpenAPI swagger,
@@ -1118,21 +1102,6 @@ public class OpenAPIResolverTest {
         assertEquals(qp.getName(), "page");
     }
 
-    @Test(description = "update internal references of external files")
-    public void testUpdateInternalReferencesOfExternalFiles() {
-        ParseOptions options = new ParseOptions();
-        options.setResolve(true);
-
-        OpenAPI openAPI = new OpenAPIV3Parser().read("internal-references-in-external-files/main.yaml", null, options);
-
-        ComposedSchema commonSchema = (ComposedSchema) openAPI.getComponents().getSchemas().get("common");
-
-        assertEquals(commonSchema.getAllOf().get(0).get$ref(), "#/components/schemas/core");
-        assertEquals(((Schema) commonSchema.getAllOf().get(1).getProperties().get("direct")).get$ref(), "#/components/schemas/core");
-        assertEquals(((ArraySchema) commonSchema.getAllOf().get(1).getProperties().get("referenced")).getItems().get$ref(), "#/components/schemas/core");
-        Schema coreSchema = openAPI.getComponents().getSchemas().get("core");
-        assertEquals(((Schema) coreSchema.getProperties().get("inner")).get$ref(), "#/components/schemas/innerCore");
-    }
 
     public String replacePort(String url){
         String pathFile = url.replace("${dynamicPort}", String.valueOf(this.serverPort));
@@ -1143,4 +1112,4 @@ public class OpenAPIResolverTest {
         return new Random().ints(50000, 60000).findFirst().getAsInt();
     }
 
-}
+}
\ No newline at end of file
diff --git a/modules/swagger-parser-v3/src/test/java/io/swagger/v3/parser/test/OpenAPIV3ParserTest.java b/modules/swagger-parser-v3/src/test/java/io/swagger/v3/parser/test/OpenAPIV3ParserTest.java
index 8e3e2804..bd308ce6 100644
--- a/modules/swagger-parser-v3/src/test/java/io/swagger/v3/parser/test/OpenAPIV3ParserTest.java
+++ b/modules/swagger-parser-v3/src/test/java/io/swagger/v3/parser/test/OpenAPIV3ParserTest.java
@@ -12,7 +12,6 @@ import io.swagger.v3.oas.models.Components;
 import io.swagger.v3.oas.models.OpenAPI;
 import io.swagger.v3.oas.models.Operation;
 import io.swagger.v3.oas.models.PathItem;
-import io.swagger.v3.oas.models.links.Link;
 import io.swagger.v3.oas.models.media.*;
 import io.swagger.v3.oas.models.examples.Example;
 import io.swagger.v3.oas.models.media.ArraySchema;
@@ -1538,36 +1537,6 @@ public class OpenAPIV3ParserTest {
         assertEquals(actualPathContent, actualComponentContent);
     }
 
-    @Test
-    public void shouldParseParameters() {
-        ParseOptions parseOptions = new ParseOptions();
-        parseOptions.setResolveFully(true);
-        OpenAPI openAPI = new OpenAPIV3Parser().read("src/test/resources/issue_877.yaml", null, parseOptions);
-        Parameter parameter = openAPI.getPaths().get("/adopt").getGet().getParameters().get(0);
-        assertNotNull(parameter);
-        assertEquals(parameter.getIn(), "path");
-        assertEquals(parameter.getName(), "playerId");
-    }
-  
-    @Test
-    public void testIssue884() {
-        ParseOptions parseOptions = new ParseOptions();
-        parseOptions.setResolveFully(true);
-        OpenAPI openAPI = new OpenAPIV3Parser().read("src/test/resources/issue_884.yaml", null, parseOptions);
-        Map<String, Link> links = openAPI.getPaths().get("/2.0/repositories/{username}").getGet().getResponses().get("200").getLinks();
-        String operationId = links.get("userRepository").getOperationId();
-        assertEquals(operationId, "getRepository");
-    }
-  
-    @Test
-    public void testLinkIssue() {
-        ParseOptions parseOptions = new ParseOptions();
-        parseOptions.setResolveFully(true);
-        OpenAPI openAPI = new OpenAPIV3Parser().read("src/test/resources/linkIssue.yaml", null, parseOptions);
-        Map<String, Link> links = openAPI.getPaths().get("/2.0/repositories/{username}").getGet().getResponses().get("200").getLinks();
-        Object requestBody = links.get("userRepository").getRequestBody();
-        assertEquals(requestBody, "$response.body#/slug");
-    }
 
     private static int getDynamicPort() {
         return new Random().ints(10000, 20000).findFirst().getAsInt();
diff --git a/modules/swagger-parser-v3/src/test/java/io/swagger/v3/parser/util/RemoteUrlTest.java b/modules/swagger-parser-v3/src/test/java/io/swagger/v3/parser/util/RemoteUrlTest.java
index 3cd0576d..15e7ab4d 100644
--- a/modules/swagger-parser-v3/src/test/java/io/swagger/v3/parser/util/RemoteUrlTest.java
+++ b/modules/swagger-parser-v3/src/test/java/io/swagger/v3/parser/util/RemoteUrlTest.java
@@ -43,6 +43,9 @@ public class RemoteUrlTest {
     public void testCleanUrl() {
         String cleaned = RemoteUrl.cleanUrl("http://foo/bar/com/{v2}/fun");
         assertEquals(cleaned, "http://foo/bar/com/%7Bv2%7D/fun");
+
+        cleaned = RemoteUrl.cleanUrl("http://westus.dev.cognitive.microsoft.com/docs/services/563879b61984550e40cbbe8d/export?DocumentFormat=Swagger&ApiName=Face API - V1.0");
+        assertEquals(cleaned, "http://westus.dev.cognitive.microsoft.com/docs/services/563879b61984550e40cbbe8d/export?DocumentFormat=Swagger&ApiName=Face%20API%20-%20V1.0");
     }
 
     @Test
diff --git a/modules/swagger-parser-v3/src/test/resources/internal-references-in-external-files/external.yaml b/modules/swagger-parser-v3/src/test/resources/internal-references-in-external-files/external.yaml
deleted file mode 100644
index 361c56ff..00000000
--- a/modules/swagger-parser-v3/src/test/resources/internal-references-in-external-files/external.yaml
+++ /dev/null
@@ -1,27 +0,0 @@
-common:
-  allOf:
-  - $ref: "#/core"
-  - type: object
-    properties:
-      attribute:
-        type: string
-      direct:
-        $ref: "#/core"
-      referenced:
-        type: array
-        items:
-          $ref: "#/core"
-
-core:
-  type: object
-  properties:
-    coreAttribute:
-      type: string
-    inner:
-      $ref: "#/innerCore"
-
-innerCore:
-  type: object
-  properties:
-    innerCoreAttribute:
-      type: string
diff --git a/modules/swagger-parser-v3/src/test/resources/internal-references-in-external-files/main.yaml b/modules/swagger-parser-v3/src/test/resources/internal-references-in-external-files/main.yaml
deleted file mode 100644
index 95e501c6..00000000
--- a/modules/swagger-parser-v3/src/test/resources/internal-references-in-external-files/main.yaml
+++ /dev/null
@@ -1,29 +0,0 @@
-openapi: 3.0.0
-info:
-  version: 0.0.1
-  title: API
-paths:
-  /:
-    post:
-      summary: Create
-      requestBody:
-        content:
-          application/json:
-            schema:
-              $ref: '#/components/schemas/create'
-      responses:
-        '200':
-          description: Successful response
-components:
-  schemas:
-    create:
-      type: object
-      properties:
-        attribute:
-          type: string
-        direct:
-          $ref: "./external.yaml#/common"
-        referenced:
-          type: array
-          items:
-            $ref: "./external.yaml#/common"
diff --git a/modules/swagger-parser-v3/src/test/resources/issue_877.yaml b/modules/swagger-parser-v3/src/test/resources/issue_877.yaml
deleted file mode 100644
index 4c026cc6..00000000
--- a/modules/swagger-parser-v3/src/test/resources/issue_877.yaml
+++ /dev/null
@@ -1,27 +0,0 @@
-openapi: 3.0.0
-servers:
-- url: 'http://localhost:8000/v2/api'
-info:
-  version: 1.0.0
-  title: Swagger Petstore
-paths:
-  /adopt:
-    get:
-      tags:
-      - pet
-      summary: Find pet by ID
-      description: It gets pets
-      operationId: getPetById
-      parameters:
-        - $ref: '#/components/parameters/limit'
-      responses:
-        '200':
-          description: successful operation
-components:
-  parameters:
-    limit:
-      name: playerId
-      in: path
-      required: true
-      schema:
-        type: string
\ No newline at end of file
diff --git a/modules/swagger-parser-v3/src/test/resources/issue_884.yaml b/modules/swagger-parser-v3/src/test/resources/issue_884.yaml
deleted file mode 100644
index fc72545d..00000000
--- a/modules/swagger-parser-v3/src/test/resources/issue_884.yaml
+++ /dev/null
@@ -1,78 +0,0 @@
-openapi: 3.0.0
-info:
-  title: Link Example
-  version: 1.0.0
-paths:
-  /2.0/repositories/{username}:
-    get:
-      operationId: getRepositoriesByOwner
-      parameters:
-      - name: username
-        in: path
-        required: true
-        schema:
-          type: string
-      responses:
-        '200':
-          description: repositories owned by the supplied user
-          content:
-            application/json:
-              schema:
-                type: array
-                items:
-                  $ref: '#/components/schemas/repository'
-          links:
-            userRepository:
-              $ref: '#/components/links/userRepository'
-  /2.0/repositories/{username}/{slug}:
-    get:
-      operationId: getRepository
-      parameters:
-      - name: username
-        in: path
-        required: true
-        schema:
-          type: string
-      - name: slug
-        in: path
-        required: true
-        schema:
-          type: string
-      responses:
-        '200':
-          description: The repository
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/repository'
-components:
-  links:
-    userRepository:
-      operationId: getRepository
-      requestBody: '$response.body#/slug'
-  schemas:
-    user:
-      type: object
-      properties:
-        username:
-          type: string
-        uuid:
-          type: string
-    repository:
-      type: object
-      properties:
-        slug:
-          type: string
-        owner:
-          $ref: '#/components/schemas/user'
-    pullrequest:
-      type: object
-      properties:
-        id:
-          type: integer
-        title:
-          type: string
-        repository:
-          $ref: '#/components/schemas/repository'
-        author:
-          $ref: '#/components/schemas/user'
\ No newline at end of file
diff --git a/modules/swagger-parser-v3/src/test/resources/linkIssue.yaml b/modules/swagger-parser-v3/src/test/resources/linkIssue.yaml
deleted file mode 100644
index fa575fff..00000000
--- a/modules/swagger-parser-v3/src/test/resources/linkIssue.yaml
+++ /dev/null
@@ -1,75 +0,0 @@
-openapi: 3.0.0
-info:
-  title: Link Example
-  version: 1.0.0
-paths:
-  /2.0/repositories/{username}:
-    get:
-      operationId: getRepositoriesByOwner
-      parameters:
-      - name: username
-        in: path
-        required: true
-        schema:
-          type: string
-      responses:
-        '200':
-          description: repositories owned by the supplied user
-          content:
-            application/json:
-              schema:
-                type: array
-                items:
-                  $ref: '#/components/schemas/repository'
-          links:
-            userRepository:
-              operationId: getRepository
-              requestBody: '$response.body#/slug'
-  /2.0/repositories/{username}/{slug}:
-    get:
-      operationId: getRepository
-      parameters:
-      - name: username
-        in: path
-        required: true
-        schema:
-          type: string
-      - name: slug
-        in: path
-        required: true
-        schema:
-          type: string
-      responses:
-        '200':
-          description: The repository
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/repository'
-components:
-  schemas:
-    user:
-      type: object
-      properties:
-        username:
-          type: string
-        uuid:
-          type: string
-    repository:
-      type: object
-      properties:
-        slug:
-          type: string
-        owner:
-          $ref: '#/components/schemas/user'
-    pullrequest:
-      type: object
-      properties:
-        id:
-          type: integer
-        title:
-          type: string
-        repository:
-          $ref: '#/components/schemas/repository'
-        author:
-          $ref: '#/components/schemas/user'
\ No newline at end of file
diff --git a/modules/swagger-parser-v3/src/test/resources/simpleAllOf.yaml b/modules/swagger-parser-v3/src/test/resources/simpleAllOf.yaml
deleted file mode 100644
index 19fb7650..00000000
--- a/modules/swagger-parser-v3/src/test/resources/simpleAllOf.yaml
+++ /dev/null
@@ -1,41 +0,0 @@
-openapi: 3.0.0
-info:
-  version: "1.0.0"
-paths:
-  /foo:
-    get:
-      responses:
-        '200':
-          content:
-            application/json:
-              schema:
-                allOf:
-                - $ref: '#/components/schemas/FirstType'
-                - $ref: '#/components/schemas/SecondType'
-  /bar:
-    get:
-      responses:
-        '200':
-          content:
-            application/json:
-              schema:
-                allOf:
-                - $ref: '#/components/schemas/FirstType'
-                - $ref: '#/components/schemas/SecondType'
-                example:
-                  someProperty: ABC
-                  someOtherProperty: 42
-components:
-  schemas:
-    FirstType:
-      type: object
-      properties:
-        someProperty:
-          type: string
-          example: abc
-    SecondType:
-      type: object
-      properties:
-        someOtherProperty:
-          type: integer
-          example: 10
\ No newline at end of file
diff --git a/modules/swagger-parser/src/test/java/io/swagger/parser/OpenAPIParserTest.java b/modules/swagger-parser/src/test/java/io/swagger/parser/OpenAPIParserTest.java
index d280a916..34c60ece 100644
--- a/modules/swagger-parser/src/test/java/io/swagger/parser/OpenAPIParserTest.java
+++ b/modules/swagger-parser/src/test/java/io/swagger/parser/OpenAPIParserTest.java
@@ -64,36 +64,6 @@ public class OpenAPIParserTest {
         assertEquals(result.getOpenAPI().getOpenapi(), "3.0.1");
     }
 
-
-    @Test
-    public void testIssue887() {
-        ParseOptions options = new ParseOptions();
-        SwaggerParseResult result = new OpenAPIParser().readLocation("apiWithMultipleTags.json", null, null);
-        System.out.println(result.getMessages());
-        assertNotNull(result);
-        assertNotNull(result.getOpenAPI());
-        assertEquals(result.getMessages().get(0), "attribute tags.sample is repeated");
-    }
-
-    @Test
-    public void testIssue895() {
-        SwaggerParseResult result = new OpenAPIParser().readLocation("issue895.yaml", null, null);
-        assertNotNull(result);
-        assertNotNull(result.getOpenAPI());
-        assertEquals(result.getMessages().get(0),"attribute info.contact.test");
-        assertEquals(result.getMessages().get(1),"attribute info.license.test1");
-
-    }
-
-    @Test
-    public void testIssue892() {
-        SwaggerParseResult result = new OpenAPIParser().readLocation("issue892-main.yaml", null, null);
-
-        assertEquals(result.getMessages().size(),1);
-        assertNotNull(result.getOpenAPI());
-        assertEquals(result.getOpenAPI().getOpenapi(), "3.0.1");
-    }
-
     @Test
     public void testIssue768() {
         ParseOptions options = new ParseOptions();
@@ -395,19 +365,6 @@ public class OpenAPIParserTest {
         assertNotNull(openAPI);
         assertEquals(openAPI.getPaths().get("/pets/{id}").getGet().getParameters().get(0).getIn(), "header");
     }
-
-    @Test
-    public void testIssue258() {
-        ParseOptions options = new ParseOptions();
-        options.setResolve(true);
-        SwaggerParseResult result = new OpenAPIParser().readLocation("duplicateOperationId.json", null, options);
-
-        System.out.println(result.getMessages());
-        assertNotNull(result);
-        assertNotNull(result.getOpenAPI());
-        assertEquals(result.getMessages().get(0), "attribute paths.'/pets/{id}'(post).operationId is repeated");
-   }
-
     @Test
     public void testIssueRelativeRefs2(){
         String location = "exampleSpecs/specs/my-domain/test-api/v1/test-api-swagger_v1.json";
@@ -444,20 +401,6 @@ public class OpenAPIParserTest {
         Schema prop = (Schema) arraySchema.getItems().getProperties().get("itemID");
 
         assertEquals(prop.get$ref(),"#/components/schemas/simpleIDType_v01");
-    }
 
-    @Test
-    public void testIssue879() {
-        OpenAPIParser openApiParser = new OpenAPIParser();
-        ParseOptions options = new ParseOptions();
-        OpenAPI openAPI = openApiParser.readLocation("issue_879.yaml", null, options).getOpenAPI();
-
-        String ref = openAPI.getPaths()
-                .get("/register")
-                .getPost()
-                .getCallbacks()
-                .get("myEvent")
-                .get$ref();
-        assertEquals(ref, "#/components/callbacks/callbackEvent");
     }
 }
diff --git a/modules/swagger-parser/src/test/resources/apiWithMultipleTags.json b/modules/swagger-parser/src/test/resources/apiWithMultipleTags.json
deleted file mode 100644
index b0d1e676..00000000
--- a/modules/swagger-parser/src/test/resources/apiWithMultipleTags.json
+++ /dev/null
@@ -1,142 +0,0 @@
-{
-    "openapi": "3.0.0",
-    "info": {
-      "title": "Sample API",
-      "description": "Optional multiline or single-line description in [CommonMark](http://commonmark.org/help/) or HTML.",
-      "version": "0.1.9"
-    },
-    "servers": [
-      {
-        "url": "http://localhost:5555/rest/RestNativeService",
-        "description": "a service that accepts anything"
-      }
-    ],
-    "tags":[
-        {"name":"sample"},
-        {"name":"sample"}
-        ],
-    "paths": {
-      "/getTimeAfterJson/{time}": {
-        "post": {
-          
-          "security" : [{"OpenID":["read"]}],
-          "parameters": [
-            {
-              "in": "path",
-              "name": "time",
-              "content": {
-                "application/json": {
-                  "schema": {
-                    "type": "integer"
-                    
-                  }
-                }
-              }
-            },
-            
-            {
-              "in": "cookie",
-              "name": "debug",
-              "schema": {
-                "type": "integer",
-                "enum": [
-                  0,
-                  1
-                ],
-                "default": 0
-              },
-              "required":true
-            },
-            {
-              "in": "cookie",
-              "name": "csrftoken",
-              "schema": {
-                "type": "string"
-              },
-              "required":true
-            }            
-          ],
-          "requestBody": {
-            "content": {
-              "application/json": {
-                "schema": {
-                  "allOf": [
-                    {
-                      "$ref": "#/components/schemas/temp"
-                    },
-                    {
-                      "$ref": "#/components/schemas/temp1"
-                    }
-                  ]
-                }
-              }
-            }
-          },
-          "responses": {
-            "200": {
-              "description": "Updated"
-            }
-          }
-        }
-      }
-    },
-    "components": {
-      "securitySchemes":{
-        "BasicAuth": {
-        "type": "http",
-        "scheme": "basic"
-      },
-      "BearerAuth": {
-        "type": "http",
-        "scheme": "bearer"
-      },
-      "ApiKeyAuth": {
-        "type": "apiKey",
-        "in": "header",
-        "name": "X-API-Key"
-      },
-      "OAuth2": {
-        "type": "oauth2",
-        "flows": {
-          "authorizationCode": {
-            "refreshUrl":"http://localhost:555",
-            "authorizationUrl": "https://example.com/oauth/authorize",
-            "tokenUrl": "https://example.com/oauth/token",
-            "scopes": {
-              "read": "Grants read access",
-              "write": "Grants write access",
-              "admin": "Grants access to admin operations"
-            }
-          }
-        }
-      }
-      },
-      "schemas": {
-        "temp": {
-          "type": "object",
-          "properties": {
-            "bool1": {
-              "type": "boolean"
-            },
-            "timetype": {
-              "type": "string",
-              "enum": [
-                "nanoseconds",
-                "milliseconds"
-              ]
-            }
-          },
-          "required":["bool1","timetype"]
-        },
-        "temp1": {
-          "properties":{
-              "int":{
-                "type": "integer"
-              }
-          }
-          
-        }
-      }
-    
-    }
-  }
\ No newline at end of file
diff --git a/modules/swagger-parser/src/test/resources/duplicateOperationId.json b/modules/swagger-parser/src/test/resources/duplicateOperationId.json
deleted file mode 100644
index 69152c53..00000000
--- a/modules/swagger-parser/src/test/resources/duplicateOperationId.json
+++ /dev/null
@@ -1,27 +0,0 @@
-{
-  "openapi": "3.0.1",
-  "info": {
-    "version": "1.0.9-abcd",
-    "title": "Duplicate operationID"
-  },
-  "paths": {
-    "/pets/{id}": {
-      "get": {
-        "operationId": "getPetsById",
-        "responses": {
-          "default": {
-            "description": "error payload"
-          }
-        }
-      },
-      "post": {
-        "operationId": "getPetsById",
-        "responses": {
-          "default": {
-            "description": "error payload"
-          }
-        }
-      }
-    }
-  }
-}
\ No newline at end of file
diff --git a/modules/swagger-parser/src/test/resources/issue892-main.yaml b/modules/swagger-parser/src/test/resources/issue892-main.yaml
deleted file mode 100644
index 6c847ff7..00000000
--- a/modules/swagger-parser/src/test/resources/issue892-main.yaml
+++ /dev/null
@@ -1,22 +0,0 @@
-openapi: 3.0.1
-info:
-  title: ping test
-  version: '1.0'
-servers:
-  - url: 'http://localhost:8000/'
-paths:
-  some/ping:
-    get:
-      operationId: pingGet
-      parameters:
-        - name: i
-          in: query
-          description: Test
-          required: true
-          schema:
-            $ref: './issue749-reference.yaml#/SomeId'
-      responses:
-        '201':
-          description: OK
-components:
-  schemas: {}
\ No newline at end of file
diff --git a/modules/swagger-parser/src/test/resources/issue895.yaml b/modules/swagger-parser/src/test/resources/issue895.yaml
deleted file mode 100644
index aa1f875a..00000000
--- a/modules/swagger-parser/src/test/resources/issue895.yaml
+++ /dev/null
@@ -1,186 +0,0 @@
-{
-	"openapi": "3.0.0",
-	"info": {
-		"version": "1.0.0",
-		"title": "Swagger Petstore",
-		"contact": {
-            "name": "API Support",
-            "url": "test",
-            "email": "support@example.com"
-          },
-		"license": {
-            "name": "Apache 2.0",
-            "url": "test1"
-            }
-	},
-	"servers": [
-		{
-			"url": "http://petstore.swagger.io/v1"
-		}
-	],
-	"tags" : [
-	  {"name":"pet" ,
-	    "description":"+ data"
-	  }
-	],
-	"paths": {
-		"/pets": {
-			"get": {
-				"summary": "List all pets",
-				"operationId": "listPets",
-				"tags": [
-					"pets"
-				],
-				"parameters": [
-					{
-						"name": "limit",
-						"in": "query",
-						"description": "How many items to return at one time (max 100)",
-						"required": false,
-						"schema": {
-							"type": "integer",
-							"format": "int32"
-						}
-					}
-				],
-				"responses": {
-					"200": {
-						"description": "A paged array of pets",
-						"headers": {
-							"x-next": {
-								"description": "A link to the next page of responses",
-								"schema": {
-									"type": "string"
-								}
-							}
-						},
-						"content": {
-							"application/json": {
-								"schema": {
-									"$ref": "#/components/schemas/Pets"
-								}
-							}
-						}
-					},
-					"default": {
-						"description": "unexpected error",
-						"content": {
-							"application/json": {
-								"schema": {
-									"$ref": "#/components/schemas/Error"
-								}
-							}
-						}
-					}
-				}
-			},
-			"post": {
-				"summary": "Create a pet",
-				"operationId": "createPets",
-				"tags": [
-					"pets"
-				],
-				"responses": {
-					"201": {
-						"description": "Null response"
-					},
-					"default": {
-						"description": "unexpected error",
-						"content": {
-							"application/json": {
-								"schema": {
-									"$ref": "#/components/schemas/Error"
-								}
-							}
-						}
-					}
-				}
-			}
-		},
-		"/pets/{petId}": {
-			"get": {
-				"summary": "Info for a specific pet",
-				"operationId": "showPetById",
-				"tags": [
-					"pets"
-				],
-				"parameters": [
-					{
-						"name": "petId",
-						"in": "path",
-						"required": true,
-						"description": "The id of the pet to retrieve",
-						"schema": {
-							"type": "string"
-						}
-					}
-				],
-				"responses": {
-					"200": {
-						"description": "Expected response to a valid request",
-						"content": {
-							"application/json": {
-								"schema": {
-									"$ref": "#/components/schemas/Pets"
-								}
-							}
-						}
-					},
-					"default": {
-						"description": "unexpected error",
-						"content": {
-							"application/json": {
-								"schema": {
-									"$ref": "#/components/schemas/Error"
-								}
-							}
-						}
-					}
-				}
-			}
-		}
-	},
-	"components": {
-		"schemas": {
-			"Pet": {
-				"required": [
-					"id",
-					"name"
-				],
-				"properties": {
-					"id": {
-						"type": "integer",
-						"format": "int64"
-					},
-					"name": {
-						"type": "string"
-					},
-					"tag": {
-						"type": "string"
-					}
-				}
-			},
-			"Pets": {
-				"type": "array",
-				"items": {
-					"$ref": "#/components/schemas/Pet"
-				}
-			},
-			"Error": {
-				"required": [
-					"code",
-					"message"
-				],
-				"properties": {
-					"code": {
-						"type": "integer",
-						"format": "int32"
-					},
-					"message": {
-						"type": "string"
-					}
-				}
-			}
-		}
-	}
-}
\ No newline at end of file
diff --git a/modules/swagger-parser/src/test/resources/issue_879.yaml b/modules/swagger-parser/src/test/resources/issue_879.yaml
deleted file mode 100644
index 103c9a18..00000000
--- a/modules/swagger-parser/src/test/resources/issue_879.yaml
+++ /dev/null
@@ -1,59 +0,0 @@
-openapi: 3.0.0
-info:
-  title: Callback with ref Example
-  version: 1.0.0
-paths:
-  /register:
-    post:
-      summary: Subscribe to a webhook
-      requestBody:
-        required: true
-        content:
-          application/json:
-            schema:
-              type: object
-              properties:
-                callbackUrl: # Callback URL
-                  type: string
-                  format: uri
-                  example: https://myserver.com/send/callback/here
-              required:
-              - callbackUrl
-      responses:
-        '200':
-          description: subscription successfully created
-          content:
-            application/json:
-              schema:
-                type: object
-                description: subscription information
-                required:
-                - subscriptionId
-                properties:
-                  subscriptionId:
-                    description: unique identifier
-                    type: string
-                    example: 2531329f-fb09-4ef7-887e-84e648214436
-      callbacks:
-        myEvent:
-          $ref: '#/components/callbacks/callbackEvent'
-components:
-  callbacks:
-    callbackEvent:
-      '{$request.body#/callbackUrl}':
-        post:
-          requestBody: # Contents of the callback message
-            required: true
-            content:
-              application/json:
-                schema:
-                  type: object
-                  properties:
-                    message:
-                      type: string
-                      example: Some event happened
-                  required:
-                  - message
-          responses:
-            '200':
-              description: ok
\ No newline at end of file
diff --git a/modules/swagger-parser/src/test/resources/petstore.yaml b/modules/swagger-parser/src/test/resources/petstore.yaml
index f09056f6..78c445cc 100644
--- a/modules/swagger-parser/src/test/resources/petstore.yaml
+++ b/modules/swagger-parser/src/test/resources/petstore.yaml
@@ -1,180 +1,703 @@
-{
-	"openapi": "3.0.1",
-	"info": {
-		"version": "1.0.0",
-		"title": "Swagger Petstore",
-		"license": {
-			"name": "MIT"
-		}
-	},
-	"servers": [
-		{
-			"url": "http://petstore.swagger.io/v1"
-		}
-	],
-	"tags" : [
-	  {"name":"pet" ,
-	    "description":"+ data"
-	  }
-	],
-	"paths": {
-		"/pets": {
-			"get": {
-				"summary": "List all pets",
-				"operationId": "listPets",
-				"tags": [
-					"pets"
-				],
-				"parameters": [
-					{
-						"name": "limit",
-						"in": "query",
-						"description": "How many items to return at one time (max 100)",
-						"required": false,
-						"schema": {
-							"type": "integer",
-							"format": "int32"
-						}
-					}
-				],
-				"responses": {
-					"200": {
-						"description": "A paged array of pets",
-						"headers": {
-							"x-next": {
-								"description": "A link to the next page of responses",
-								"schema": {
-									"type": "string"
-								}
-							}
-						},
-						"content": {
-							"application/json": {
-								"schema": {
-									"$ref": "#/components/schemas/Pets"
-								}
-							}
-						}
-					},
-					"default": {
-						"description": "unexpected error",
-						"content": {
-							"application/json": {
-								"schema": {
-									"$ref": "#/components/schemas/Error"
-								}
-							}
-						}
-					}
-				}
-			},
-			"post": {
-				"summary": "Create a pet",
-				"operationId": "createPets",
-				"tags": [
-					"pets"
-				],
-				"responses": {
-					"201": {
-						"description": "Null response"
-					},
-					"default": {
-						"description": "unexpected error",
-						"content": {
-							"application/json": {
-								"schema": {
-									"$ref": "#/components/schemas/Error"
-								}
-							}
-						}
-					}
-				}
-			}
-		},
-		"/pets/{petId}": {
-			"get": {
-				"summary": "Info for a specific pet",
-				"operationId": "showPetById",
-				"tags": [
-					"pets"
-				],
-				"parameters": [
-					{
-						"name": "petId",
-						"in": "path",
-						"required": true,
-						"description": "The id of the pet to retrieve",
-						"schema": {
-							"type": "string"
-						}
-					}
-				],
-				"responses": {
-					"200": {
-						"description": "Expected response to a valid request",
-						"content": {
-							"application/json": {
-								"schema": {
-									"$ref": "#/components/schemas/Pets"
-								}
-							}
-						}
-					},
-					"default": {
-						"description": "unexpected error",
-						"content": {
-							"application/json": {
-								"schema": {
-									"$ref": "#/components/schemas/Error"
-								}
-							}
-						}
-					}
-				}
-			}
-		}
-	},
-	"components": {
-		"schemas": {
-			"Pet": {
-				"required": [
-					"id",
-					"name"
-				],
-				"properties": {
-					"id": {
-						"type": "integer",
-						"format": "int64"
-					},
-					"name": {
-						"type": "string"
-					},
-					"tag": {
-						"type": "string"
-					}
-				}
-			},
-			"Pets": {
-				"type": "array",
-				"items": {
-					"$ref": "#/components/schemas/Pet"
-				}
-			},
-			"Error": {
-				"required": [
-					"code",
-					"message"
-				],
-				"properties": {
-					"code": {
-						"type": "integer",
-						"format": "int32"
-					},
-					"message": {
-						"type": "string"
-					}
-				}
-			}
-		}
-	}
-}
\ No newline at end of file
+swagger: "2.0"
+info:
+  description: "This is a sample server Petstore server.  You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger.  For this sample, you can use the api key \"special-key\" to test the authorization filters"
+  version: 1.0.0
+  title: Swagger Petstore YAML
+  termsOfService: "http://swagger.io/terms/"
+  contact:
+    email: "apiteam@swagger.io"
+  license:
+    name: Apache 2.0
+    url: "http://www.apache.org/licenses/LICENSE-2.0.html"
+host: petstore.swagger.io
+basePath: /v2
+tags:
+  - name: pet
+    description: Everything about your Pets
+    externalDocs:
+      description: Find out more
+      url: "http://swagger.io"
+  - name: store
+    description: Operations about user
+  - name: user
+    description: Access to Petstore orders
+    externalDocs:
+      description: Find out more about our store
+      url: "http://swagger.io"
+schemes:
+  - http
+paths:
+  /pet:
+    post:
+      tags:
+        - pet
+      summary: Add a new pet to the store
+      description: ""
+      operationId: addPet
+      consumes:
+        - application/json
+        - application/xml
+      produces:
+        - application/xml
+        - application/json
+      parameters:
+        - in: body
+          name: body
+          description: Pet object that needs to be added to the store
+          required: false
+          schema:
+            $ref: "#/definitions/Pet"
+      responses:
+        "405":
+          description: Invalid input
+      security:
+        - petstore_auth:
+            - "write:pets"
+            - "read:pets"
+    put:
+      tags:
+        - pet
+      summary: Update an existing pet
+      description: ""
+      operationId: updatePet
+      consumes:
+        - application/json
+        - application/xml
+      produces:
+        - application/xml
+        - application/json
+      parameters:
+        - in: body
+          name: body
+          description: Pet object that needs to be added to the store
+          required: false
+          schema:
+            $ref: "#/definitions/Pet"
+      responses:
+        "400":
+          description: Invalid ID supplied
+        "404":
+          description: Pet not found
+        "405":
+          description: Validation exception
+      security:
+        - petstore_auth:
+            - "write:pets"
+            - "read:pets"
+  /pet/findByStatus:
+    get:
+      tags:
+        - pet
+      summary: Finds Pets by status
+      description: Multiple status values can be provided with comma seperated strings
+      operationId: findPetsByStatus
+      consumes:
+        - application/xml
+        - application/json
+        - multipart/form-data
+        - application/x-www-form-urlencoded
+      produces:
+        - application/xml
+        - application/json
+      parameters:
+        - name: status
+          in: query
+          description: Status values that need to be considered for filter
+          required: false
+          type: array
+          items:
+            type: string
+          collectionFormat: multi
+          default: available
+          enum:
+            - available
+            - pending
+            - sold
+      responses:
+        "200":
+          description: successful operation
+          schema:
+            type: array
+            items:
+              $ref: "#/definitions/Pet"
+        "400":
+          description: Invalid status value
+      security:
+        - petstore_auth:
+            - "write:pets"
+            - "read:pets"
+  /pet/findByTags:
+    get:
+      tags:
+        - pet
+      summary: Finds Pets by tags
+      description: "Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing."
+      operationId: findPetsByTags
+      produces:
+        - application/xml
+        - application/json
+      parameters:
+        - name: tags
+          in: query
+          description: Tags to filter by
+          required: false
+          type: array
+          items:
+            type: string
+          collectionFormat: multi
+      responses:
+        "200":
+          description: successful operation
+          schema:
+            type: array
+            items:
+              $ref: "#/definitions/Pet"
+        "400":
+          description: Invalid tag value
+      security:
+        - api_key: []
+        - basic_auth: []
+  "/pet/{petId}":
+    get:
+      tags:
+        - pet
+      summary: Find pet by ID
+      description: Returns a single pet
+      operationId: getPetById
+      consumes:
+        - application/x-www-form-urlencoded
+      produces:
+        - application/xml
+        - application/json
+      parameters:
+        - name: petId
+          in: path
+          description: ID of pet to return
+          required: true
+          type: integer
+          format: int64
+      responses:
+        "200":
+          description: successful operation
+          schema:
+            $ref: "#/definitions/Pet"
+        "400":
+          description: Invalid ID supplied
+        "404":
+          description: Pet not found
+      security:
+        - api_key: []
+        - petstore_auth:
+            - "write:pets"
+            - "read:pets"
+    post:
+      tags:
+        - pet
+      summary: Updates a pet in the store with form data
+      description: ""
+      operationId: updatePetWithForm
+      consumes:
+        - application/x-www-form-urlencoded
+      produces:
+        - application/xml
+        - application/json
+      parameters:
+        - name: petId
+          in: path
+          description: ID of pet that needs to be updated
+          required: true
+          type: string
+        - name: name
+          in: formData
+          description: Updated name of the pet
+          required: false
+          type: string
+        - name: status
+          in: formData
+          description: Updated status of the pet
+          required: false
+          type: string
+      responses:
+        "405":
+          description: Invalid input
+      security:
+        - petstore_auth:
+            - "write:pets"
+            - "read:pets"
+    delete:
+      tags:
+        - pet
+      summary: Deletes a pet
+      description: ""
+      operationId: deletePet
+      consumes:
+        - multipart/form-data
+        - application/x-www-form-urlencoded
+      produces:
+        - application/xml
+        - application/json
+      parameters:
+        - name: api_key
+          in: header
+          description: ""
+          required: false
+          type: string
+        - name: petId
+          in: path
+          description: Pet id to delete
+          required: true
+          type: integer
+          format: int64
+      responses:
+        "400":
+          description: Invalid pet value
+      security:
+        - petstore_auth:
+            - "write:pets"
+            - "read:pets"
+  "/pet/{petId}/uploadImage":
+    post:
+      tags:
+        - pet
+      summary: uploads an image
+      description: ""
+      operationId: uploadFile
+      consumes:
+        - multipart/form-data
+      produces:
+        - application/json
+      parameters:
+        - name: petId
+          in: path
+          description: ID of pet to update
+          required: true
+          type: integer
+          format: int64
+        - name: additionalMetadata
+          in: formData
+          description: Additional data to pass to server
+          required: false
+          type: string
+        - name: file
+          in: formData
+          description: file to upload
+          required: false
+          type: file
+      responses:
+        "200":
+          description: successful operation
+          schema:
+            $ref: "#/definitions/ApiResponse"
+      security:
+        - petstore_auth:
+            - "write:pets"
+            - "read:pets"
+  /store/inventory:
+    get:
+      tags:
+        - store
+      summary: Returns pet inventories by status
+      description: Returns a map of status codes to quantities
+      operationId: getInventory
+      produces:
+        - application/json
+      parameters: []
+      responses:
+        "200":
+          description: successful operation
+          schema:
+            type: object
+            additionalProperties:
+              type: integer
+              format: int32
+      security:
+        - api_key: []
+  /store/order:
+    post:
+      tags:
+        - store
+      summary: Place an order for a pet
+      description: ""
+      operationId: placeOrder
+      produces:
+        - application/xml
+        - application/json
+      parameters:
+        - in: body
+          name: body
+          description: order placed for purchasing the pet
+          required: false
+          schema:
+            $ref: "#/definitions/Order"
+      responses:
+        "200":
+          description: successful operation
+          schema:
+            $ref: "#/definitions/Order"
+        "400":
+          description: Invalid Order
+  "/store/order/{orderId}":
+    get:
+      tags:
+        - store
+      summary: Find purchase order by ID
+      description: "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions"
+      operationId: getOrderById
+      produces:
+        - application/xml
+        - application/json
+      parameters:
+        - name: orderId
+          in: path
+          description: ID of pet that needs to be fetched
+          required: true
+          type: string
+      responses:
+        "200":
+          description: successful operation
+          schema:
+            $ref: "#/definitions/Order"
+        "400":
+          description: Invalid ID supplied
+        "404":
+          description: Order not found
+    delete:
+      tags:
+        - store
+      summary: Delete purchase order by ID
+      description: For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
+      operationId: deleteOrder
+      produces:
+        - application/xml
+        - application/json
+      parameters:
+        - name: orderId
+          in: path
+          description: ID of the order that needs to be deleted
+          required: true
+          type: string
+      responses:
+        "400":
+          description: Invalid ID supplied
+        "404":
+          description: Order not found
+  /user:
+    post:
+      tags:
+        - user
+      summary: Create user
+      description: This can only be done by the logged in user.
+      operationId: createUser
+      produces:
+        - application/xml
+        - application/json
+      parameters:
+        - in: body
+          name: body
+          description: Created user object
+          required: false
+          schema:
+            $ref: "#/definitions/User"
+      responses:
+        default:
+          description: successful operation
+  /user/createWithArray:
+    post:
+      tags:
+        - user
+      summary: Creates list of users with given input array
+      description: ""
+      operationId: createUsersWithArrayInput
+      produces:
+        - application/xml
+        - application/json
+      parameters:
+        - in: body
+          name: body
+          description: List of user object
+          required: false
+          schema:
+            type: array
+            items:
+              $ref: "#/definitions/User"
+      responses:
+        default:
+          description: successful operation
+  /user/createWithList:
+    post:
+      tags:
+        - user
+      summary: Creates list of users with given input array
+      description: ""
+      operationId: createUsersWithListInput
+      produces:
+        - application/xml
+        - application/json
+      parameters:
+        - in: body
+          name: body
+          description: List of user object
+          required: false
+          schema:
+            type: array
+            items:
+              $ref: "#/definitions/User"
+      responses:
+        default:
+          description: successful operation
+  /user/login:
+    get:
+      tags:
+        - user
+      summary: Logs user into the system
+      description: ""
+      operationId: loginUser
+      produces:
+        - application/xml
+        - application/json
+      parameters:
+        - name: username
+          in: query
+          description: The user name for login
+          required: false
+          type: string
+        - name: password
+          in: query
+          description: The password for login in clear text
+          required: false
+          type: string
+      responses:
+        "200":
+          description: successful operation
+          schema:
+            type: string
+          headers:
+            X-Rate-Limit:
+              type: integer
+              format: int32
+              description: calls per hour allowed by the user
+            X-Expires-After:
+              type: string
+              format: date-time
+              description: date in UTC when toekn expires
+        "400":
+          description: Invalid username/password supplied
+          schema:
+            $ref: '#/definitions/ApiResponse'
+  /user/logout:
+    get:
+      tags:
+        - user
+      summary: Logs out current logged in user session
+      description: ""
+      operationId: logoutUser
+      produces:
+        - application/xml
+        - application/json
+      parameters: []
+      responses:
+        default:
+          description: successful operation
+  "/user/{username}":
+    get:
+      tags:
+        - user
+      summary: Get user by user name
+      description: ""
+      operationId: getUserByName
+      produces:
+        - application/xml
+        - application/json
+      parameters:
+        - name: username
+          in: path
+          description: "The name that needs to be fetched. Use user1 for testing. "
+          required: true
+          type: string
+      responses:
+        "200":
+          description: successful operation
+          schema:
+            $ref: "#/definitions/User"
+        "400":
+          description: Invalid username supplied
+        "404":
+          description: User not found
+    put:
+      tags:
+        - user
+      summary: Updated user
+      description: This can only be done by the logged in user.
+      operationId: updateUser
+      produces:
+        - application/xml
+        - application/json
+      parameters:
+        - name: username
+          in: path
+          description: name that need to be deleted
+          required: true
+          type: string
+        - in: body
+          name: body
+          description: Updated user object
+          required: false
+          schema:
+            $ref: "#/definitions/User"
+      responses:
+        "400":
+          description: Invalid user supplied
+        "404":
+          description: User not found
+    delete:
+      tags:
+        - user
+      summary: Delete user
+      description: This can only be done by the logged in user.
+      operationId: deleteUser
+      produces:
+        - application/xml
+        - application/json
+      parameters:
+        - name: username
+          in: path
+          description: The name that needs to be deleted
+          required: true
+          type: string
+      responses:
+        "400":
+          description: Invalid username supplied
+        "404":
+          description: User not found
+securityDefinitions:
+  petstore_auth:
+    type: oauth2
+    authorizationUrl: "http://petstore.swagger.io/api/oauth/dialog"
+    flow: implicit
+    scopes:
+      "write:pets": modify pets in your account
+      "read:pets": read your pets
+  api_key:
+    type: apiKey
+    name: api_key
+    in: header
+  basic_auth:
+    type: basic
+definitions:
+  Order:
+    properties:
+      id:
+        type: integer
+        format: int64
+      petId:
+        type: integer
+        format: int64
+      quantity:
+        type: integer
+        format: int32
+      shipDate:
+        type: string
+        format: date-time
+      status:
+        type: string
+        description: Order Status
+        enum:
+          - placed
+          - approved
+          - delivered
+      complete:
+        type: boolean
+    xml:
+      name: Order
+  Category:
+    properties:
+      id:
+        type: integer
+        format: int64
+      name:
+        type: string
+    xml:
+      name: Category
+  User:
+    properties:
+      id:
+        type: integer
+        format: int64
+      username:
+        type: string
+      firstName:
+        type: string
+      lastName:
+        type: string
+      email:
+        type: string
+      password:
+        type: string
+      phone:
+        type: string
+      userStatus:
+        type: integer
+        format: int32
+        description: User Status
+    xml:
+      name: User
+  Tag:
+    properties:
+      id:
+        type: integer
+        format: int64
+      name:
+        type: string
+    xml:
+      name: Tag
+  Pet:
+    title: an ugly duckling
+    required:
+      - name
+      - photoUrls
+    properties:
+      id:
+        type: integer
+        format: int64
+      category:
+        $ref: "#/definitions/Category"
+      name:
+        type: string
+        example: doggie
+      photoUrls:
+        type: array
+        xml:
+          name: photoUrl
+          wrapped: true
+        items:
+          type: string
+      tags:
+        type: array
+        xml:
+          name: tag
+          wrapped: true
+        items:
+          $ref: "#/definitions/Tag"
+      status:
+        type: string
+        description: pet status in the store
+        enum:
+          - available
+          - pending
+          - sold
+    xml:
+      name: Pet
+  ApiResponse:
+    properties:
+      code:
+        type: integer
+        format: int32
+      type:
+        type: string
+      message:
+        type: string
+    xml:
+      name: "##default"
+externalDocs:
+  description: Find out more about Swagger
+  url: "http://swagger.io"