From 8e205032ef3caf2aee2d749c6d507d27192d3960 Mon Sep 17 00:00:00 2001 From: russellb337 Date: Thu, 23 Apr 2015 08:44:50 -0700 Subject: [PATCH 01/14] Operations should inherit consumes and produces from ApiDeclaration object during Swagger 1.0 -> 2.0 conversion --- .../parser/SwaggerCompatConverter.java | 18 +++++++++--- .../converter/OperationConverterTest.java | 29 +++++++++++++++++-- 2 files changed, 40 insertions(+), 7 deletions(-) diff --git a/modules/swagger-compat-spec-parser/src/main/java/io/swagger/parser/SwaggerCompatConverter.java b/modules/swagger-compat-spec-parser/src/main/java/io/swagger/parser/SwaggerCompatConverter.java index b40a157e43..fb7af0f937 100644 --- a/modules/swagger-compat-spec-parser/src/main/java/io/swagger/parser/SwaggerCompatConverter.java +++ b/modules/swagger-compat-spec-parser/src/main/java/io/swagger/parser/SwaggerCompatConverter.java @@ -327,7 +327,8 @@ else if(type != null && !type.equals("void")) return output; } - public Operation convertOperation(String tag, io.swagger.models.apideclaration.Operation operation) { + public Operation convertOperation(String tag, io.swagger.models.apideclaration.Operation operation, + ApiDeclaration apiDeclaration) { Operation output = new Operation() .summary(operation.getSummary()) .description(operation.getNotes()) @@ -339,15 +340,23 @@ public Operation convertOperation(String tag, io.swagger.models.apideclaration.O for(io.swagger.models.apideclaration.Parameter parameter : operation.getParameters()) output.parameter(convertParameter(parameter)); - if(operation.getConsumes() != null) { + if(operation.getConsumes() != null && !operation.getConsumes().isEmpty()) { for(String consumes: operation.getConsumes()) { output.consumes(consumes); } + } else if (apiDeclaration.getConsumes() != null) { + for(String consumes: apiDeclaration.getConsumes()) { + output.consumes(consumes); + } } - if(operation.getProduces() != null) { + if(operation.getProduces() != null && !operation.getProduces().isEmpty()) { for(String produces: operation.getProduces()) { output.produces(produces); } + } else if (apiDeclaration.getProduces() != null) { + for(String produces: apiDeclaration.getProduces()) { + output.produces(produces); + } } for(ResponseMessage message: operation.getResponseMessages()) { Response response = new Response().description(message.getMessage()); @@ -477,7 +486,8 @@ else if(resourceListing.getApiVersion() != null) { paths.put(apiPath, path); } for(io.swagger.models.apideclaration.Operation op : ops) { - Operation operation = convertOperation(tag, op); + Operation operation = convertOperation(tag, op, apiDeclaration); + if(op.getMethod() != null) { path.set(op.getMethod().toString().toLowerCase(), operation); } diff --git a/modules/swagger-compat-spec-parser/src/test/java/com/wordnik/swagger/converter/OperationConverterTest.java b/modules/swagger-compat-spec-parser/src/test/java/com/wordnik/swagger/converter/OperationConverterTest.java index e4f213d054..9f96050bbf 100644 --- a/modules/swagger-compat-spec-parser/src/test/java/com/wordnik/swagger/converter/OperationConverterTest.java +++ b/modules/swagger-compat-spec-parser/src/test/java/com/wordnik/swagger/converter/OperationConverterTest.java @@ -1,5 +1,6 @@ package com.wordnik.swagger.converter; +import io.swagger.models.apideclaration.ApiDeclaration; import io.swagger.parser.SwaggerCompatConverter; import io.swagger.models.ParamType; import io.swagger.models.Method; @@ -7,9 +8,7 @@ import com.wordnik.swagger.models.Operation; import com.wordnik.swagger.models.Response; -import com.wordnik.swagger.models.parameters.*; import com.wordnik.swagger.models.properties.*; -import com.wordnik.swagger.util.Json; import java.util.*; @@ -56,7 +55,7 @@ public void convertOperation1() throws Exception { parameters.add(param); operation.setParameters(parameters); - Operation converted = converter.convertOperation("tag", operation); + Operation converted = converter.convertOperation("tag", operation, new ApiDeclaration()); assertTrue(converted.getTags().size() == 1); assertEquals(converted.getTags().get(0), "tag"); @@ -78,4 +77,28 @@ public void convertOperation1() throws Exception { RefProperty ref = (RefProperty) property; assertEquals(ref.getSimpleRef(), "Cat"); } + + @Test + public void testConvertOperation_ConsumesAndProducesInheritedFromApiDeclaration() throws Exception { + Set expectedConsumes = new HashSet<>(Arrays.asList("application/json", "application/xml")); + Set expectedProduces = new HashSet<>(Arrays.asList("text/plain")); + + final ApiDeclaration apiDeclaration = new ApiDeclaration(); + apiDeclaration.setConsumes(new ArrayList<>(expectedConsumes)); + apiDeclaration.setProduces(new ArrayList<>(expectedProduces)); + + io.swagger.models.apideclaration.Operation operation = new io.swagger.models.apideclaration.Operation(); + + Operation converted = converter.convertOperation("tag", operation, apiDeclaration); + + assertSetsAreEqual(expectedConsumes, converted.getConsumes()); + assertSetsAreEqual(expectedProduces, converted.getProduces()); + } + + private void assertSetsAreEqual(Set expectedConsumes, List actualConsumes) { + Set actualConsumesSet = new HashSet<>(); + actualConsumesSet.addAll(actualConsumes); + assertEquals(expectedConsumes.size(), actualConsumes.size()); + assertTrue(actualConsumesSet.containsAll(expectedConsumes)); + } } \ No newline at end of file From f92fe87df0c559c93cd4699633fe9f5f5c49040f Mon Sep 17 00:00:00 2001 From: Tony Tam Date: Sun, 7 Jun 2015 00:24:03 -0700 Subject: [PATCH 02/14] updated dev version --- modules/swagger-compat-spec-parser/pom.xml | 4 ++-- modules/swagger-parser/pom.xml | 4 ++-- pom.xml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/swagger-compat-spec-parser/pom.xml b/modules/swagger-compat-spec-parser/pom.xml index 65ad6b05aa..73678064d2 100644 --- a/modules/swagger-compat-spec-parser/pom.xml +++ b/modules/swagger-compat-spec-parser/pom.xml @@ -4,13 +4,13 @@ io.swagger swagger-parser-project - 1.0.8 + 1.0.9-SNAPSHOT ../.. 4.0.0 io.swagger swagger-compat-spec-parser - 1.0.8 + 1.0.9-SNAPSHOT jar swagger-compat-spec-parser diff --git a/modules/swagger-parser/pom.xml b/modules/swagger-parser/pom.xml index 370b3393e3..27306d2f66 100644 --- a/modules/swagger-parser/pom.xml +++ b/modules/swagger-parser/pom.xml @@ -4,13 +4,13 @@ io.swagger swagger-parser-project - 1.0.8 + 1.0.9-SNAPSHOT ../.. 4.0.0 io.swagger swagger-parser - 1.0.8 + 1.0.9-SNAPSHOT jar swagger-parser diff --git a/pom.xml b/pom.xml index 60f9c77876..2e0933039f 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ 4.0.0 io.swagger swagger-parser-project - 1.0.8 + 1.0.9-SNAPSHOT pom swagger-parser-project From 3a0b96bcc0a963a4ed2659820e60c629ea4c9b37 Mon Sep 17 00:00:00 2001 From: Alexey Nechaev Date: Wed, 17 Jun 2015 18:45:54 +0300 Subject: [PATCH 03/14] Fixed #60: Handling of operations with no responses has been fixed. --- .../parser/SwaggerCompatConverter.java | 13 +++++--- .../converter/LegacyConverterTest.java | 31 +++++++++++++++++++ .../test/resources/specs/v1_2/singleFile.json | 1 - 3 files changed, 39 insertions(+), 6 deletions(-) diff --git a/modules/swagger-compat-spec-parser/src/main/java/io/swagger/parser/SwaggerCompatConverter.java b/modules/swagger-compat-spec-parser/src/main/java/io/swagger/parser/SwaggerCompatConverter.java index f8d7efb10e..7e22d7af3c 100644 --- a/modules/swagger-compat-spec-parser/src/main/java/io/swagger/parser/SwaggerCompatConverter.java +++ b/modules/swagger-compat-spec-parser/src/main/java/io/swagger/parser/SwaggerCompatConverter.java @@ -2,6 +2,7 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ObjectNode; + import io.swagger.models.ArrayModel; import io.swagger.models.AuthorizationScope; import io.swagger.models.Contact; @@ -39,6 +40,7 @@ import io.swagger.models.properties.Property; import io.swagger.models.properties.PropertyBuilder; import io.swagger.models.properties.RefProperty; +import io.swagger.models.properties.StringProperty; import io.swagger.models.resourcelisting.ApiInfo; import io.swagger.models.resourcelisting.ApiKeyAuthorization; import io.swagger.models.resourcelisting.ApiListingReference; @@ -234,6 +236,12 @@ public Parameter convertParameter(io.swagger.models.apideclaration.Parameter par p = arrayProperty; } else { p = propertyFromTypedObject(param); + if (p == null) { + System.out.println(String.format( + "WARNING! No property detected for parameter '%s' (%s)! Falling back to string!", + param.getName(), param.getParamType())); + p = new StringProperty(); + } } if (p instanceof ArrayProperty) { ArrayProperty ap = (ArrayProperty) p; @@ -336,11 +344,6 @@ public Property propertyFromTypedObject(ExtendedTypedObject obj) { } } - if (output == null) { - System.out.println("WARNING! No property detected! Falling back to string!"); - output = PropertyBuilder.build("string", null, null); - } - return output; } diff --git a/modules/swagger-compat-spec-parser/src/test/java/io/swagger/converter/LegacyConverterTest.java b/modules/swagger-compat-spec-parser/src/test/java/io/swagger/converter/LegacyConverterTest.java index 1d52464aae..9c3275ad4d 100644 --- a/modules/swagger-compat-spec-parser/src/test/java/io/swagger/converter/LegacyConverterTest.java +++ b/modules/swagger-compat-spec-parser/src/test/java/io/swagger/converter/LegacyConverterTest.java @@ -4,15 +4,24 @@ import io.swagger.models.Info; import io.swagger.models.License; import io.swagger.models.Operation; +import io.swagger.models.Path; +import io.swagger.models.Response; import io.swagger.models.Swagger; import io.swagger.models.auth.ApiKeyAuthDefinition; import io.swagger.models.auth.In; import io.swagger.models.auth.OAuth2Definition; import io.swagger.models.auth.SecuritySchemeDefinition; +import io.swagger.models.parameters.Parameter; +import io.swagger.models.parameters.PathParameter; import io.swagger.models.parameters.QueryParameter; import io.swagger.parser.SwaggerCompatConverter; + import org.testng.annotations.Test; +import com.google.common.base.Predicate; +import com.google.common.collect.Iterables; + +import java.io.IOException; import java.util.List; import java.util.Map; @@ -100,4 +109,26 @@ public void failConversionTest() throws Exception { assertNull(swagger); } + + @Test + public void testFixedProperties() throws IOException { + final Swagger swagger = converter.read("src/test/resources/specs/v1_2/singleFile.json"); + final Path path = swagger.getPath("/pet/{petId}"); + assertEquals(path.getPost().getResponses().size(), 1); + for (Response item : path.getPost().getResponses().values()) { + assertNull(item.getSchema()); + } + assertNull(path.getDelete().getResponses()); + final PathParameter id = (PathParameter) Iterables.find(path.getPatch().getParameters(), + new Predicate() { + + @Override + public boolean apply(Parameter input) { + return "petId".equals(input.getName()); + } + }); + + assertEquals(id.getType(), "string"); + assertNull(id.getFormat()); + } } diff --git a/modules/swagger-compat-spec-parser/src/test/resources/specs/v1_2/singleFile.json b/modules/swagger-compat-spec-parser/src/test/resources/specs/v1_2/singleFile.json index 48414cc98e..81b2942376 100644 --- a/modules/swagger-compat-spec-parser/src/test/resources/specs/v1_2/singleFile.json +++ b/modules/swagger-compat-spec-parser/src/test/resources/specs/v1_2/singleFile.json @@ -119,7 +119,6 @@ "name": "petId", "description": "ID of pet that needs to be fetched", "required": true, - "type": "string", "paramType": "path" }, { From 4a68e703c19b791733f30d84bb9f30266663414a Mon Sep 17 00:00:00 2001 From: russellb337 Date: Fri, 26 Jun 2015 10:04:14 -0700 Subject: [PATCH 04/14] fixing merge --- .../converter/OperationConverterTest.java | 104 ------------------ .../converter/OperationConverterTest.java | 27 ++++- 2 files changed, 25 insertions(+), 106 deletions(-) delete mode 100644 modules/swagger-compat-spec-parser/src/test/java/com/wordnik/swagger/converter/OperationConverterTest.java diff --git a/modules/swagger-compat-spec-parser/src/test/java/com/wordnik/swagger/converter/OperationConverterTest.java b/modules/swagger-compat-spec-parser/src/test/java/com/wordnik/swagger/converter/OperationConverterTest.java deleted file mode 100644 index e6fd8a3e99..0000000000 --- a/modules/swagger-compat-spec-parser/src/test/java/com/wordnik/swagger/converter/OperationConverterTest.java +++ /dev/null @@ -1,104 +0,0 @@ -package com.wordnik.swagger.converter; - -import io.swagger.models.Operation; -import io.swagger.models.Response; -import io.swagger.models.apideclaration.ApiDeclaration; -import io.swagger.models.properties.Property; -import io.swagger.models.properties.RefProperty; -import io.swagger.parser.SwaggerCompatConverter; -import io.swagger.models.ParamType; -import io.swagger.models.Method; -import io.swagger.models.apideclaration.ResponseMessage; - -import java.util.*; - -import org.testng.annotations.Test; - -import static org.testng.Assert.*; - -public class OperationConverterTest { - SwaggerCompatConverter converter = new SwaggerCompatConverter(); - - @Test - public void convertOperation1() throws Exception { - io.swagger.models.apideclaration.Operation operation = new io.swagger.models.apideclaration.Operation(); - - operation.setMethod(Method.GET); - operation.setSummary("the summary"); - operation.setNotes("the notes"); - operation.setNickname("getFun"); - List produces = new ArrayList(); - produces.add("application/json"); - operation.setProduces(produces); - - // response type - operation.setRef("Cat"); - - // response messages - List responses = new ArrayList(); - ResponseMessage message400 = new ResponseMessage(); - message400.setCode(400); - message400.setMessage("got a 400"); - responses.add(message400); - - operation.setResponseMessages(responses); - - // parameters - io.swagger.models.apideclaration.Parameter param = new io.swagger.models.apideclaration.Parameter(); - param.setParamType(ParamType.QUERY); - param.setDescription("a string query param"); - param.setRequired(false); - param.setAllowMultiple(false); - param.setType("string"); - - List parameters = new ArrayList(); - parameters.add(param); - operation.setParameters(parameters); - - Operation converted = converter.convertOperation("tag", operation, new ApiDeclaration()); - - assertTrue(converted.getTags().size() == 1); - assertEquals(converted.getTags().get(0), "tag"); - assertEquals(operation.getSummary(), converted.getSummary()); - assertEquals(operation.getNotes(), converted.getDescription()); - assertEquals(operation.getNickname(), converted.getOperationId()); - assertTrue(converted.getProduces().size() == 1); - assertEquals(converted.getProduces().get(0), "application/json"); - assertTrue(converted.getParameters().size() == 1); - assertTrue(converted.getResponses().size() == 2); - - Response response = converted.getResponses().get("200"); - assertNotNull(response); - assertEquals(response.getDescription(), "success"); - - Property property = response.getSchema(); - assertNotNull(property); - assertTrue(property.getClass().equals(RefProperty.class)); - RefProperty ref = (RefProperty) property; - assertEquals(ref.getSimpleRef(), "Cat"); - } - - @Test - public void testConvertOperation_ConsumesAndProducesInheritedFromApiDeclaration() throws Exception { - Set expectedConsumes = new HashSet<>(Arrays.asList("application/json", "application/xml")); - Set expectedProduces = new HashSet<>(Arrays.asList("text/plain")); - - final ApiDeclaration apiDeclaration = new ApiDeclaration(); - apiDeclaration.setConsumes(new ArrayList<>(expectedConsumes)); - apiDeclaration.setProduces(new ArrayList<>(expectedProduces)); - - io.swagger.models.apideclaration.Operation operation = new io.swagger.models.apideclaration.Operation(); - - Operation converted = converter.convertOperation("tag", operation, apiDeclaration); - - assertSetsAreEqual(expectedConsumes, converted.getConsumes()); - assertSetsAreEqual(expectedProduces, converted.getProduces()); - } - - private void assertSetsAreEqual(Set expectedConsumes, List actualConsumes) { - Set actualConsumesSet = new HashSet<>(); - actualConsumesSet.addAll(actualConsumes); - assertEquals(expectedConsumes.size(), actualConsumes.size()); - assertTrue(actualConsumesSet.containsAll(expectedConsumes)); - } -} \ No newline at end of file diff --git a/modules/swagger-compat-spec-parser/src/test/java/io/swagger/converter/OperationConverterTest.java b/modules/swagger-compat-spec-parser/src/test/java/io/swagger/converter/OperationConverterTest.java index d8895d65ce..a59bdece16 100644 --- a/modules/swagger-compat-spec-parser/src/test/java/io/swagger/converter/OperationConverterTest.java +++ b/modules/swagger-compat-spec-parser/src/test/java/io/swagger/converter/OperationConverterTest.java @@ -11,8 +11,7 @@ import io.swagger.parser.SwaggerCompatConverter; import org.testng.annotations.Test; -import java.util.ArrayList; -import java.util.List; +import java.util.*; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertNotNull; @@ -79,4 +78,28 @@ public void convertOperation1() throws Exception { RefProperty ref = (RefProperty) property; assertEquals(ref.getSimpleRef(), "Cat"); } + + @Test + public void testConvertOperation_ConsumesAndProducesInheritedFromApiDeclaration() throws Exception { + Set expectedConsumes = new HashSet<>(Arrays.asList("application/json", "application/xml")); + Set expectedProduces = new HashSet<>(Arrays.asList("text/plain")); + + final ApiDeclaration apiDeclaration = new ApiDeclaration(); + apiDeclaration.setConsumes(new ArrayList<>(expectedConsumes)); + apiDeclaration.setProduces(new ArrayList<>(expectedProduces)); + + io.swagger.models.apideclaration.Operation operation = new io.swagger.models.apideclaration.Operation(); + + Operation converted = converter.convertOperation("tag", operation, apiDeclaration); + + assertSetsAreEqual(expectedConsumes, converted.getConsumes()); + assertSetsAreEqual(expectedProduces, converted.getProduces()); + } + + private void assertSetsAreEqual(Set expectedConsumes, List actualConsumes) { + Set actualConsumesSet = new HashSet<>(); + actualConsumesSet.addAll(actualConsumes); + assertEquals(expectedConsumes.size(), actualConsumes.size()); + assertTrue(actualConsumesSet.containsAll(expectedConsumes)); + } } \ No newline at end of file From f1a5bf41f5e6744e0b6a6c08ee3940c4d14f4960 Mon Sep 17 00:00:00 2001 From: russellb337 Date: Fri, 26 Jun 2015 10:05:17 -0700 Subject: [PATCH 05/14] fixing formatting --- .../parser/SwaggerCompatConverter.java | 182 ++++++++---------- 1 file changed, 76 insertions(+), 106 deletions(-) diff --git a/modules/swagger-compat-spec-parser/src/main/java/io/swagger/parser/SwaggerCompatConverter.java b/modules/swagger-compat-spec-parser/src/main/java/io/swagger/parser/SwaggerCompatConverter.java index 24e37092dd..6978ca31ad 100644 --- a/modules/swagger-compat-spec-parser/src/main/java/io/swagger/parser/SwaggerCompatConverter.java +++ b/modules/swagger-compat-spec-parser/src/main/java/io/swagger/parser/SwaggerCompatConverter.java @@ -2,51 +2,21 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ObjectNode; -import io.swagger.models.ArrayModel; -import io.swagger.models.AuthorizationScope; -import io.swagger.models.Contact; -import io.swagger.models.Info; -import io.swagger.models.License; -import io.swagger.models.Method; +import io.swagger.models.*; import io.swagger.models.Model; -import io.swagger.models.ModelImpl; import io.swagger.models.Operation; -import io.swagger.models.ParamType; -import io.swagger.models.PassAs; -import io.swagger.models.Path; -import io.swagger.models.RefModel; -import io.swagger.models.Response; -import io.swagger.models.Scheme; -import io.swagger.models.Swagger; -import io.swagger.models.apideclaration.Api; -import io.swagger.models.apideclaration.ApiDeclaration; -import io.swagger.models.apideclaration.ExtendedTypedObject; -import io.swagger.models.apideclaration.Items; -import io.swagger.models.apideclaration.ModelProperty; -import io.swagger.models.apideclaration.ResponseMessage; +import io.swagger.models.apideclaration.*; import io.swagger.models.auth.ApiKeyAuthDefinition; import io.swagger.models.auth.AuthorizationValue; import io.swagger.models.auth.In; import io.swagger.models.auth.OAuth2Definition; -import io.swagger.models.parameters.BodyParameter; -import io.swagger.models.parameters.FormParameter; -import io.swagger.models.parameters.HeaderParameter; +import io.swagger.models.parameters.*; import io.swagger.models.parameters.Parameter; -import io.swagger.models.parameters.PathParameter; -import io.swagger.models.parameters.QueryParameter; -import io.swagger.models.parameters.SerializableParameter; import io.swagger.models.properties.ArrayProperty; import io.swagger.models.properties.Property; import io.swagger.models.properties.PropertyBuilder; import io.swagger.models.properties.RefProperty; -import io.swagger.models.resourcelisting.ApiInfo; -import io.swagger.models.resourcelisting.ApiKeyAuthorization; -import io.swagger.models.resourcelisting.ApiListingReference; -import io.swagger.models.resourcelisting.Authorization; -import io.swagger.models.resourcelisting.AuthorizationCodeGrant; -import io.swagger.models.resourcelisting.ImplicitGrant; -import io.swagger.models.resourcelisting.OAuth2Authorization; -import io.swagger.models.resourcelisting.ResourceListing; +import io.swagger.models.resourcelisting.*; import io.swagger.parser.util.RemoteUrl; import io.swagger.report.MessageBuilder; import io.swagger.transform.migrate.ApiDeclarationMigrator; @@ -344,83 +314,83 @@ public Property propertyFromTypedObject(ExtendedTypedObject obj) { return output; } - public Operation convertOperation(String tag, io.swagger.models.apideclaration.Operation operation, - ApiDeclaration apiDeclaration) { - Method method; - - if (operation.getMethod() == null) { - JsonNode node = (JsonNode) operation.getExtraFields().get("httpMethod"); - method = Method.forValue(node.asText()); - operation.setMethod(method); - } - - Operation output = new Operation() - .summary(operation.getSummary()) - .description(operation.getNotes()) - .operationId(operation.getNickname()); - - if (tag != null) { - output.tag(tag); - } - - for (io.swagger.models.apideclaration.Parameter parameter : operation.getParameters()) { - output.parameter(convertParameter(parameter)); - } - - if(operation.getConsumes() != null && !operation.getConsumes().isEmpty()) { - for(String consumes: operation.getConsumes()) { - output.consumes(consumes); + public Operation convertOperation(String tag, io.swagger.models.apideclaration.Operation operation, + ApiDeclaration apiDeclaration) { + Method method; + + if (operation.getMethod() == null) { + JsonNode node = (JsonNode) operation.getExtraFields().get("httpMethod"); + method = Method.forValue(node.asText()); + operation.setMethod(method); } - } else if (apiDeclaration.getConsumes() != null) { - for(String consumes: apiDeclaration.getConsumes()) { - output.consumes(consumes); + + Operation output = new Operation() + .summary(operation.getSummary()) + .description(operation.getNotes()) + .operationId(operation.getNickname()); + + if (tag != null) { + output.tag(tag); } - } - if(operation.getProduces() != null && !operation.getProduces().isEmpty()) { - for(String produces: operation.getProduces()) { - output.produces(produces); + + for (io.swagger.models.apideclaration.Parameter parameter : operation.getParameters()) { + output.parameter(convertParameter(parameter)); } - } else if (apiDeclaration.getProduces() != null) { - for(String produces: apiDeclaration.getProduces()) { - output.produces(produces); + + if (operation.getConsumes() != null && !operation.getConsumes().isEmpty()) { + for (String consumes : operation.getConsumes()) { + output.consumes(consumes); + } + } else if (apiDeclaration.getConsumes() != null) { + for (String consumes : apiDeclaration.getConsumes()) { + output.consumes(consumes); + } } - } - - for(ResponseMessage message: operation.getResponseMessages()) { - Response response = new Response().description(message.getMessage()); - - Model responseModel = null; - if (message.getResponseModel() != null) { - response.schema(new RefProperty(message.getResponseModel())); + if (operation.getProduces() != null && !operation.getProduces().isEmpty()) { + for (String produces : operation.getProduces()) { + output.produces(produces); + } + } else if (apiDeclaration.getProduces() != null) { + for (String produces : apiDeclaration.getProduces()) { + output.produces(produces); + } } - output.response(message.getCode(), response); - } - - // default response type - Property responseProperty = propertyFromTypedObject(operation); - if (responseProperty != null) { - Response response = new Response() - .description("success") - .schema(responseProperty); - if (output.getResponses() == null) { - output.defaultResponse(response); - } else { - output.response(200, response); + + for (ResponseMessage message : operation.getResponseMessages()) { + Response response = new Response().description(message.getMessage()); + + Model responseModel = null; + if (message.getResponseModel() != null) { + response.schema(new RefProperty(message.getResponseModel())); + } + output.response(message.getCode(), response); + } + + // default response type + Property responseProperty = propertyFromTypedObject(operation); + if (responseProperty != null) { + Response response = new Response() + .description("success") + .schema(responseProperty); + if (output.getResponses() == null) { + output.defaultResponse(response); + } else { + output.response(200, response); + } + } + + Map> auths = operation.getAuthorizations(); + + for (String securityName : auths.keySet()) { + List scopes = auths.get(securityName); + List updatedScopes = new ArrayList(); + for (AuthorizationScope s : scopes) { + updatedScopes.add(s.getScope()); + } + output.addSecurity(securityName, updatedScopes); } - } - - Map> auths = operation.getAuthorizations(); - - for (String securityName : auths.keySet()) { - List scopes = auths.get(securityName); - List updatedScopes = new ArrayList(); - for (AuthorizationScope s : scopes) { - updatedScopes.add(s.getScope()); - } - output.addSecurity(securityName, updatedScopes); - } - - return output; + + return output; } public ApiDeclaration readDeclaration(String input, MessageBuilder messages, List auths) { @@ -550,7 +520,7 @@ public Swagger convert(ResourceListing resourceListing, List api basePath = "/" + basePath; } } - + Swagger swagger = new Swagger() .host(host) From 9c915e13685f201ec33629dd6fac0f574272765d Mon Sep 17 00:00:00 2001 From: russellb337 Date: Fri, 26 Jun 2015 10:16:28 -0700 Subject: [PATCH 06/14] fixing tests --- .../java/io/swagger/converter/OperationConverterTest.java | 8 ++++---- modules/swagger-parser/src/test/scala/RemoteUrlTest.scala | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/swagger-compat-spec-parser/src/test/java/io/swagger/converter/OperationConverterTest.java b/modules/swagger-compat-spec-parser/src/test/java/io/swagger/converter/OperationConverterTest.java index a59bdece16..4567f7823c 100644 --- a/modules/swagger-compat-spec-parser/src/test/java/io/swagger/converter/OperationConverterTest.java +++ b/modules/swagger-compat-spec-parser/src/test/java/io/swagger/converter/OperationConverterTest.java @@ -13,9 +13,7 @@ import java.util.*; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; +import static org.testng.Assert.*; public class OperationConverterTest { SwaggerCompatConverter converter = new SwaggerCompatConverter(); @@ -89,8 +87,10 @@ public void testConvertOperation_ConsumesAndProducesInheritedFromApiDeclaration( apiDeclaration.setProduces(new ArrayList<>(expectedProduces)); io.swagger.models.apideclaration.Operation operation = new io.swagger.models.apideclaration.Operation(); + operation.setMethod(Method.GET); - Operation converted = converter.convertOperation("tag", operation, apiDeclaration); + final SwaggerCompatConverter swaggerCompatConverter = new SwaggerCompatConverter(); + Operation converted = swaggerCompatConverter.convertOperation("tag", operation, apiDeclaration); assertSetsAreEqual(expectedConsumes, converted.getConsumes()); assertSetsAreEqual(expectedProduces, converted.getProduces()); diff --git a/modules/swagger-parser/src/test/scala/RemoteUrlTest.scala b/modules/swagger-parser/src/test/scala/RemoteUrlTest.scala index 7636bc22a6..156b2c2220 100644 --- a/modules/swagger-parser/src/test/scala/RemoteUrlTest.scala +++ b/modules/swagger-parser/src/test/scala/RemoteUrlTest.scala @@ -9,13 +9,13 @@ import scala.collection.JavaConverters._ @RunWith(classOf[JUnitRunner]) class RemoteUrlTest extends FlatSpec with Matchers { it should "read a remote URL" in { - val output = RemoteUrl.urlToString("http://petstore.swagger.io/v2/pet/3", null) + val output = RemoteUrl.urlToString("http://petstore.swagger.io/v2/pet/1", null) output should not be (null) } it should "set a header" in { val av = new AuthorizationValue("accept", "application/xml", "header") - val output = RemoteUrl.urlToString("http://petstore.swagger.io/v2/pet/3", List(av).asJava) + val output = RemoteUrl.urlToString("http://petstore.swagger.io/v2/pet/1", List(av).asJava) output.trim.charAt(0) should be('<') } From eb4b0a7526df043460539f4d3f271e9c5f8b4d28 Mon Sep 17 00:00:00 2001 From: Ivan Ushankin Date: Tue, 30 Jun 2015 15:10:42 +0300 Subject: [PATCH 07/14] Fixed #59: SwaggerParser.parse(String swaggerAsString) always returns null --- .../java/io/swagger/parser/SwaggerParser.java | 2 +- .../src/test/scala/SwaggerReaderTest.scala | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/modules/swagger-parser/src/main/java/io/swagger/parser/SwaggerParser.java b/modules/swagger-parser/src/main/java/io/swagger/parser/SwaggerParser.java index 04e311b200..5a14660eb1 100644 --- a/modules/swagger-parser/src/main/java/io/swagger/parser/SwaggerParser.java +++ b/modules/swagger-parser/src/main/java/io/swagger/parser/SwaggerParser.java @@ -55,7 +55,7 @@ public Swagger parse(String swaggerAsString, List auths) { Swagger output; try { output = new Swagger20Parser().parse(swaggerAsString); - if (output != null && auths != null && auths.size() > 0) { + if (output != null) { return new SwaggerResolver().resolve(output, auths); } } catch (IOException e) { diff --git a/modules/swagger-parser/src/test/scala/SwaggerReaderTest.scala b/modules/swagger-parser/src/test/scala/SwaggerReaderTest.scala index b1ac69aec3..4189893a62 100644 --- a/modules/swagger-parser/src/test/scala/SwaggerReaderTest.scala +++ b/modules/swagger-parser/src/test/scala/SwaggerReaderTest.scala @@ -1,9 +1,14 @@ +import io.swagger.models.Swagger import io.swagger.parser.SwaggerParser import io.swagger.util.Json +import org.apache.commons.io.FileUtils import org.junit.runner.RunWith import org.scalatest.{FlatSpec, Matchers} import org.scalatest.junit.JUnitRunner +import java.io.File +import java.nio.charset.StandardCharsets + @RunWith(classOf[JUnitRunner]) class SwaggerReaderTest extends FlatSpec with Matchers { val m = Json.mapper() @@ -41,4 +46,16 @@ class SwaggerReaderTest extends FlatSpec with Matchers { }""" ) } + + it should "read the issue 59 resource" in { + val parser = new SwaggerParser() + val sampleFilePath = "./src/test/resources/uber.json" + + val swaggerFromFile = parser.parse(FileUtils.readFileToString(new File(sampleFilePath), StandardCharsets.UTF_8)) + val swaggerFromString = parser.read(sampleFilePath) + + swaggerFromFile.isInstanceOf[Swagger] should be(true) + swaggerFromString.isInstanceOf[Swagger] should be(true) + swaggerFromFile should equal(swaggerFromString) + } } From d8848ba6a93b75a3320cd23342a9b7c7da4d0a54 Mon Sep 17 00:00:00 2001 From: Tony Tam Date: Mon, 20 Jul 2015 23:29:12 -0700 Subject: [PATCH 08/14] added resolve option --- .../main/java/io/swagger/parser/SwaggerParser.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/modules/swagger-parser/src/main/java/io/swagger/parser/SwaggerParser.java b/modules/swagger-parser/src/main/java/io/swagger/parser/SwaggerParser.java index 5a14660eb1..7f3f336dd9 100644 --- a/modules/swagger-parser/src/main/java/io/swagger/parser/SwaggerParser.java +++ b/modules/swagger-parser/src/main/java/io/swagger/parser/SwaggerParser.java @@ -65,6 +65,10 @@ public Swagger parse(String swaggerAsString, List auths) { } public Swagger read(JsonNode node) { + return read(node, false); + } + + public Swagger read(JsonNode node, boolean resolve) { if (node == null) { return null; } @@ -75,7 +79,12 @@ public Swagger read(JsonNode node) { try { output = new Swagger20Parser().read(node); if (output != null) { - return output; + if(resolve) { + return new SwaggerResolver().resolve(output, new ArrayList()); + } + else { + return output; + } } } catch (IOException e) { // continue; From 48ee2e3daf703421ad51adfe5f172c97adc8d05c Mon Sep 17 00:00:00 2001 From: Tony Tam Date: Mon, 27 Jul 2015 12:46:27 -0700 Subject: [PATCH 09/14] updated swagger-core version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 2e0933039f..eaa64f166c 100644 --- a/pom.xml +++ b/pom.xml @@ -209,7 +209,7 @@ 2.4 2.10.4 1.6.3 - 1.5.0 + 1.5.1-SNAPSHOT 4.8.1 2.1.3 From f047cafb05b309390393f842f7cddb2d7f49fd00 Mon Sep 17 00:00:00 2001 From: Tony Tam Date: Tue, 28 Jul 2015 21:59:04 -0700 Subject: [PATCH 10/14] fix for #69, added yaml support for resolver --- .../io/swagger/parser/SwaggerResolver.java | 11 ++- .../src/test/scala/SwaggerResolverTest.scala | 69 +++++++++++++++++++ 2 files changed, 79 insertions(+), 1 deletion(-) diff --git a/modules/swagger-parser/src/main/java/io/swagger/parser/SwaggerResolver.java b/modules/swagger-parser/src/main/java/io/swagger/parser/SwaggerResolver.java index 4ba3b9df77..438d180e63 100644 --- a/modules/swagger-parser/src/main/java/io/swagger/parser/SwaggerResolver.java +++ b/modules/swagger-parser/src/main/java/io/swagger/parser/SwaggerResolver.java @@ -1,6 +1,8 @@ package io.swagger.parser; import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; + import io.swagger.models.ArrayModel; import io.swagger.models.Model; import io.swagger.models.ModelImpl; @@ -19,6 +21,7 @@ import io.swagger.models.properties.RefProperty; import io.swagger.parser.util.RemoteUrl; import io.swagger.util.Json; +import io.swagger.util.Yaml; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -85,7 +88,13 @@ public void applyResolutions(List auths) { JsonNode location = null; String locationName = null; if (contents != null) { - location = Json.mapper().readTree(contents); + ObjectMapper mapper; + if (contents.trim().startsWith("{")) { + mapper = Json.mapper(); + } else { + mapper = Yaml.mapper(); + } + location = mapper.readTree(contents); String[] objectPath = definitionPath.split("/"); for (String objectPathPart : objectPath) { LOGGER.debug("getting part " + objectPathPart); diff --git a/modules/swagger-parser/src/test/scala/SwaggerResolverTest.scala b/modules/swagger-parser/src/test/scala/SwaggerResolverTest.scala index 9a677a2b42..cc8987a210 100644 --- a/modules/swagger-parser/src/test/scala/SwaggerResolverTest.scala +++ b/modules/swagger-parser/src/test/scala/SwaggerResolverTest.scala @@ -22,6 +22,20 @@ class SwaggerResolverTest extends FlatSpec with Matchers { swagger.getDefinitions().get("Tag") should not be (null) } + it should "resolve a simple remote model property definition in yaml" in { + val swagger = new Swagger() + swagger.addDefinition( + "Sample", new ModelImpl() + .property("remoteRef", new RefProperty("http://petstore.swagger.io/v2/swagger.yaml#/definitions/Tag"))) + + val resolved = new SwaggerResolver().resolve(swagger, null) + val prop = resolved.getDefinitions().get("Sample").getProperties().get("remoteRef") + prop.isInstanceOf[RefProperty] should be(true) + val ref = prop.asInstanceOf[RefProperty] + ref.get$ref() should equal("#/definitions/Tag") + swagger.getDefinitions().get("Tag") should not be (null) + } + it should "resolve an array remote model property definition" in { val swagger = new Swagger() swagger.addDefinition( @@ -37,6 +51,21 @@ class SwaggerResolverTest extends FlatSpec with Matchers { swagger.getDefinitions().get("Tag") should not be (null) } + it should "resolve an array remote model property definition in yaml" in { + val swagger = new Swagger() + swagger.addDefinition( + "Sample", new ModelImpl() + .property("remoteRef", new ArrayProperty(new RefProperty("http://petstore.swagger.io/v2/swagger.yaml#/definitions/Tag")))) + + val resolved = new SwaggerResolver().resolve(swagger, null) + val prop = resolved.getDefinitions().get("Sample").getProperties().get("remoteRef") + prop.isInstanceOf[ArrayProperty] should be(true) + val ap = prop.asInstanceOf[ArrayProperty] + val ref = ap.getItems().asInstanceOf[RefProperty] + ref.get$ref() should equal("#/definitions/Tag") + swagger.getDefinitions().get("Tag") should not be (null) + } + it should "resolve an map remote model property definition" in { val swagger = new Swagger() swagger.addDefinition( @@ -51,6 +80,20 @@ class SwaggerResolverTest extends FlatSpec with Matchers { swagger.getDefinitions().get("Tag") should not be (null) } + it should "resolve an map remote model property definition in yaml" in { + val swagger = new Swagger() + swagger.addDefinition( + "Sample", new ModelImpl() + .property("remoteRef", new MapProperty(new RefProperty("http://petstore.swagger.io/v2/swagger.yaml#/definitions/Tag")))) + val resolved = new SwaggerResolver().resolve(swagger, null) + val prop = resolved.getDefinitions().get("Sample").getProperties().get("remoteRef") + prop.isInstanceOf[MapProperty] should be(true) + val ap = prop.asInstanceOf[MapProperty] + val ref = ap.getAdditionalProperties().asInstanceOf[RefProperty] + ref.get$ref() should equal("#/definitions/Tag") + swagger.getDefinitions().get("Tag") should not be (null) + } + it should "resolve operation bodyparam remote refs" in { val swagger = new Swagger() swagger.path("/fun", new Path() @@ -65,6 +108,19 @@ class SwaggerResolverTest extends FlatSpec with Matchers { swagger.getDefinitions().get("Tag") should not be (null) } + it should "resolve operation bodyparam remote refs in yaml" in { + val swagger = new Swagger() + swagger.path("/fun", new Path() + .get(new Operation() + .parameter(new BodyParameter() + .schema(new RefModel("http://petstore.swagger.io/v2/swagger.yaml#/definitions/Tag"))))) + + val resolved = new SwaggerResolver().resolve(swagger, null) + val param = swagger.getPaths().get("/fun").getGet().getParameters().get(0).asInstanceOf[BodyParameter] + val ref = param.getSchema().asInstanceOf[RefModel] + ref.get$ref() should equal("#/definitions/Tag") + swagger.getDefinitions().get("Tag") should not be (null) + } it should "resolve operation parameter remote refs" in { val swagger = new Swagger() @@ -119,5 +175,18 @@ class SwaggerResolverTest extends FlatSpec with Matchers { ref.get$ref() should equal("#/definitions/Tag") swagger.getDefinitions().get("Tag") should not be (null) } + + it should "resolve response remote refs in yaml" in { + val swagger = new Swagger() + swagger.path("/fun", new Path() + .get(new Operation() + .response(200, new Response() + .schema(new RefProperty("http://petstore.swagger.io/v2/swagger.yaml#/definitions/Tag"))))) + val resolved = new SwaggerResolver().resolve(swagger, null) + val response = swagger.getPaths().get("/fun").getGet().getResponses().get("200") + val ref = response.getSchema.asInstanceOf[RefProperty] + ref.get$ref() should equal("#/definitions/Tag") + swagger.getDefinitions().get("Tag") should not be (null) + } } From 9a102996c0d02275716433de1114249b8265c99a Mon Sep 17 00:00:00 2001 From: Tony Tam Date: Tue, 28 Jul 2015 22:14:07 -0700 Subject: [PATCH 11/14] fixed imports --- .../parser/SwaggerCompatConverter.java | 28 +++++++++++++++---- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/modules/swagger-compat-spec-parser/src/main/java/io/swagger/parser/SwaggerCompatConverter.java b/modules/swagger-compat-spec-parser/src/main/java/io/swagger/parser/SwaggerCompatConverter.java index 0950f03c8a..09a044409d 100644 --- a/modules/swagger-compat-spec-parser/src/main/java/io/swagger/parser/SwaggerCompatConverter.java +++ b/modules/swagger-compat-spec-parser/src/main/java/io/swagger/parser/SwaggerCompatConverter.java @@ -1,8 +1,5 @@ package io.swagger.parser; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.ObjectNode; - import io.swagger.models.ArrayModel; import io.swagger.models.AuthorizationScope; import io.swagger.models.Contact; @@ -10,14 +7,32 @@ import io.swagger.models.License; import io.swagger.models.Method; import io.swagger.models.Model; +import io.swagger.models.ModelImpl; import io.swagger.models.Operation; -import io.swagger.models.apideclaration.*; +import io.swagger.models.ParamType; +import io.swagger.models.PassAs; +import io.swagger.models.Path; +import io.swagger.models.RefModel; +import io.swagger.models.Response; +import io.swagger.models.Scheme; +import io.swagger.models.Swagger; +import io.swagger.models.apideclaration.Api; +import io.swagger.models.apideclaration.ApiDeclaration; +import io.swagger.models.apideclaration.ExtendedTypedObject; +import io.swagger.models.apideclaration.Items; +import io.swagger.models.apideclaration.ModelProperty; +import io.swagger.models.apideclaration.ResponseMessage; import io.swagger.models.auth.ApiKeyAuthDefinition; import io.swagger.models.auth.AuthorizationValue; import io.swagger.models.auth.In; import io.swagger.models.auth.OAuth2Definition; -import io.swagger.models.parameters.*; +import io.swagger.models.parameters.BodyParameter; +import io.swagger.models.parameters.FormParameter; +import io.swagger.models.parameters.HeaderParameter; import io.swagger.models.parameters.Parameter; +import io.swagger.models.parameters.PathParameter; +import io.swagger.models.parameters.QueryParameter; +import io.swagger.models.parameters.SerializableParameter; import io.swagger.models.properties.ArrayProperty; import io.swagger.models.properties.Property; import io.swagger.models.properties.PropertyBuilder; @@ -44,6 +59,9 @@ import java.util.List; import java.util.Map; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ObjectNode; + // legacy models public class SwaggerCompatConverter implements SwaggerParserExtension { From 0be166d0b2f7eebe5e2a7cbf71d260d5afcbef40 Mon Sep 17 00:00:00 2001 From: Tony Tam Date: Fri, 31 Jul 2015 09:59:43 -0700 Subject: [PATCH 12/14] added array support for remote refs --- .../io/swagger/parser/SwaggerResolver.java | 16 ++++++++++++++++ .../src/test/scala/SwaggerResolverTest.scala | 18 ++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/modules/swagger-parser/src/main/java/io/swagger/parser/SwaggerResolver.java b/modules/swagger-parser/src/main/java/io/swagger/parser/SwaggerResolver.java index 438d180e63..e476a33e63 100644 --- a/modules/swagger-parser/src/main/java/io/swagger/parser/SwaggerResolver.java +++ b/modules/swagger-parser/src/main/java/io/swagger/parser/SwaggerResolver.java @@ -207,6 +207,22 @@ public void detectOperationRefs() { resolutionMap.put(key, m); } } + else if (schema instanceof ArrayProperty) { + Property item = ((ArrayProperty)schema).getItems(); + if (item instanceof RefProperty) { + RefProperty ref = (RefProperty) item; + String key = ref.get$ref(); + + if (key != null && key.startsWith("http")) { + List m = resolutionMap.get(key); + if (m == null) { + m = new ArrayList(); + } + m.add(new ResolutionContext(ref, schema, "ref")); + resolutionMap.put(key, m); + } + } + } } } } diff --git a/modules/swagger-parser/src/test/scala/SwaggerResolverTest.scala b/modules/swagger-parser/src/test/scala/SwaggerResolverTest.scala index cc8987a210..00bea7ccd0 100644 --- a/modules/swagger-parser/src/test/scala/SwaggerResolverTest.scala +++ b/modules/swagger-parser/src/test/scala/SwaggerResolverTest.scala @@ -188,5 +188,23 @@ class SwaggerResolverTest extends FlatSpec with Matchers { ref.get$ref() should equal("#/definitions/Tag") swagger.getDefinitions().get("Tag") should not be (null) } + + it should "resolve array response remote refs in yaml" in { + val swagger = new Swagger() + swagger.path("/fun", new Path() + .get(new Operation() + .response(200, new Response() + .schema( + new ArrayProperty( + new RefProperty("http://petstore.swagger.io/v2/swagger.yaml#/definitions/Tag")))))) + val resolved = new SwaggerResolver().resolve(swagger, null) + val response = swagger.getPaths().get("/fun").getGet().getResponses().get("200") + val array = response.getSchema.asInstanceOf[ArrayProperty] + array.getItems() should not be (null) + + val ref = array.getItems().asInstanceOf[RefProperty]; + ref.get$ref() should equal("#/definitions/Tag") + swagger.getDefinitions().get("Tag") should not be (null) + } } From 0e3bb1a365e0d45a52bfb4e262870711f5ae6d33 Mon Sep 17 00:00:00 2001 From: Tony Tam Date: Sun, 2 Aug 2015 19:34:36 -0700 Subject: [PATCH 13/14] updated swagger-core version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index eaa64f166c..a4439f31a1 100644 --- a/pom.xml +++ b/pom.xml @@ -209,7 +209,7 @@ 2.4 2.10.4 1.6.3 - 1.5.1-SNAPSHOT + 1.5.1 4.8.1 2.1.3 From 29ab5a5ba830aea0841f2f4f5a82fb60dbcfce8c Mon Sep 17 00:00:00 2001 From: Tony Tam Date: Sun, 2 Aug 2015 19:36:28 -0700 Subject: [PATCH 14/14] prepare for release --- modules/swagger-compat-spec-parser/pom.xml | 4 ++-- modules/swagger-parser/pom.xml | 4 ++-- pom.xml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/swagger-compat-spec-parser/pom.xml b/modules/swagger-compat-spec-parser/pom.xml index 73678064d2..1b9a038788 100644 --- a/modules/swagger-compat-spec-parser/pom.xml +++ b/modules/swagger-compat-spec-parser/pom.xml @@ -4,13 +4,13 @@ io.swagger swagger-parser-project - 1.0.9-SNAPSHOT + 1.0.9 ../.. 4.0.0 io.swagger swagger-compat-spec-parser - 1.0.9-SNAPSHOT + 1.0.9 jar swagger-compat-spec-parser diff --git a/modules/swagger-parser/pom.xml b/modules/swagger-parser/pom.xml index 27306d2f66..997f0adbf2 100644 --- a/modules/swagger-parser/pom.xml +++ b/modules/swagger-parser/pom.xml @@ -4,13 +4,13 @@ io.swagger swagger-parser-project - 1.0.9-SNAPSHOT + 1.0.9 ../.. 4.0.0 io.swagger swagger-parser - 1.0.9-SNAPSHOT + 1.0.9 jar swagger-parser diff --git a/pom.xml b/pom.xml index a4439f31a1..b280c1b984 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ 4.0.0 io.swagger swagger-parser-project - 1.0.9-SNAPSHOT + 1.0.9 pom swagger-parser-project