From 3ea028ac232f1c1264142cb8f29736542cf0b321 Mon Sep 17 00:00:00 2001 From: frantuma Date: Fri, 2 Nov 2018 14:43:44 +0100 Subject: [PATCH] ref #8884 - fix openapi-yaml serialization --- .../swagger-codegen-maven-plugin/examples/java-client.xml | 2 +- .../io/swagger/codegen/languages/SwaggerYamlGenerator.java | 5 ++--- .../codegen/options/AkkaScalaClientOptionsProvider.java | 2 -- pom.xml | 2 +- pom.xml.bash | 2 +- pom.xml.circleci | 2 +- pom.xml.circleci.java7 | 2 +- pom.xml.ios | 2 +- pom.xml.jenkins | 2 +- pom.xml.jenkins.java7 | 2 +- pom.xml.shippable | 2 +- pom.xml.travis | 2 +- 12 files changed, 12 insertions(+), 15 deletions(-) diff --git a/modules/swagger-codegen-maven-plugin/examples/java-client.xml b/modules/swagger-codegen-maven-plugin/examples/java-client.xml index e968acab8aa..5fa1f8755de 100644 --- a/modules/swagger-codegen-maven-plugin/examples/java-client.xml +++ b/modules/swagger-codegen-maven-plugin/examples/java-client.xml @@ -118,7 +118,7 @@ - 1.5.20 + 1.5.21 2.25.1 2.9.5 2.7 diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SwaggerYamlGenerator.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SwaggerYamlGenerator.java index 51a7df7d9ae..07a1f03f054 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SwaggerYamlGenerator.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SwaggerYamlGenerator.java @@ -8,14 +8,12 @@ import com.fasterxml.jackson.dataformat.yaml.YAMLFactory; import com.fasterxml.jackson.dataformat.yaml.YAMLGenerator; import io.swagger.codegen.*; -import io.swagger.codegen.examples.ExampleGenerator; import io.swagger.jackson.mixin.ResponseSchemaMixin; import io.swagger.models.Model; import io.swagger.models.Response; import io.swagger.models.Swagger; -import io.swagger.models.properties.Property; import io.swagger.util.DeserializationModule; -import io.swagger.util.Yaml; +import io.swagger.util.ReferenceSerializationConfigurer; import org.apache.commons.io.FileUtils; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; @@ -120,5 +118,6 @@ private void configureMapper(ObjectMapper mapper) { mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); mapper.addMixIn(Response.class, ResponseSchemaMixin.class); + ReferenceSerializationConfigurer.serializeAsComputedRef(mapper); } } diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/AkkaScalaClientOptionsProvider.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/AkkaScalaClientOptionsProvider.java index cf0142a9e0e..ca4a9060574 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/AkkaScalaClientOptionsProvider.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/AkkaScalaClientOptionsProvider.java @@ -4,8 +4,6 @@ import com.google.common.collect.ImmutableMap; -import com.sun.org.apache.bcel.internal.classfile.Code; - import java.util.Map; public class AkkaScalaClientOptionsProvider implements OptionsProvider { diff --git a/pom.xml b/pom.xml index 2c8f65aacb4..b3d9abde5ad 100644 --- a/pom.xml +++ b/pom.xml @@ -936,7 +936,7 @@ 1.0.36 2.11.1 3.3.0 - 1.5.20 + 1.5.21 2.4 1.2 4.8.1 diff --git a/pom.xml.bash b/pom.xml.bash index 81d32a29971..9343e7ffa9f 100644 --- a/pom.xml.bash +++ b/pom.xml.bash @@ -912,7 +912,7 @@ 1.0.36 2.11.1 3.3.0 - 1.5.20 + 1.5.21 2.4 1.2 4.8.1 diff --git a/pom.xml.circleci b/pom.xml.circleci index f5e33074790..cf5da79d9bf 100644 --- a/pom.xml.circleci +++ b/pom.xml.circleci @@ -960,7 +960,7 @@ 1.0.36 2.11.1 3.3.0 - 1.5.20 + 1.5.21 2.4 1.2 4.8.1 diff --git a/pom.xml.circleci.java7 b/pom.xml.circleci.java7 index 95161d11f07..48506835c1f 100644 --- a/pom.xml.circleci.java7 +++ b/pom.xml.circleci.java7 @@ -942,7 +942,7 @@ 1.0.36 2.11.1 3.3.0 - 1.5.20 + 1.5.21 2.4 1.2 4.8.1 diff --git a/pom.xml.ios b/pom.xml.ios index 9b10a5b554b..d8c6330f429 100644 --- a/pom.xml.ios +++ b/pom.xml.ios @@ -920,7 +920,7 @@ 1.0.36 2.11.1 3.3.0 - 1.5.20 + 1.5.21 2.4 1.2 4.8.1 diff --git a/pom.xml.jenkins b/pom.xml.jenkins index 56708331552..e59e1dd9901 100644 --- a/pom.xml.jenkins +++ b/pom.xml.jenkins @@ -1000,7 +1000,7 @@ 1.0.36 2.11.1 3.3.0 - 1.5.20 + 1.5.21 2.4 1.2 4.8.1 diff --git a/pom.xml.jenkins.java7 b/pom.xml.jenkins.java7 index 4b5f28dbcf9..45eab481807 100644 --- a/pom.xml.jenkins.java7 +++ b/pom.xml.jenkins.java7 @@ -924,7 +924,7 @@ 1.0.36 2.11.1 3.3.0 - 1.5.20 + 1.5.21 2.4 1.2 4.8.1 diff --git a/pom.xml.shippable b/pom.xml.shippable index 489ceb233ae..3cba1f61fcb 100644 --- a/pom.xml.shippable +++ b/pom.xml.shippable @@ -914,7 +914,7 @@ 1.0.36 2.11.1 3.3.0 - 1.5.20 + 1.5.21 2.4 1.2 4.8.1 diff --git a/pom.xml.travis b/pom.xml.travis index 2c8f65aacb4..b3d9abde5ad 100644 --- a/pom.xml.travis +++ b/pom.xml.travis @@ -936,7 +936,7 @@ 1.0.36 2.11.1 3.3.0 - 1.5.20 + 1.5.21 2.4 1.2 4.8.1