From 59c231b2ad25f6f1748853b92b6d3f822e12d495 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 --- .../io/swagger/codegen/languages/SwaggerYamlGenerator.java | 5 ++--- .../codegen/options/AkkaScalaClientOptionsProvider.java | 2 -- pom.xml | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) 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 51a7df7d9ae6..07a1f03f054a 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 cf0142a9e0ee..ca4a90605744 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 2c8f65aacb48..b3d9abde5adc 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