Skip to content

Commit a1530ee

Browse files
authored
Merge pull request #8427 from swagger-api/extra-schema-in-response
added mixIn configuration on mapper to fix extra schema on swagger-yaml
2 parents 9555a1d + 54e38a5 commit a1530ee

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SwaggerYamlGenerator.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@
88
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
99
import com.fasterxml.jackson.dataformat.yaml.YAMLGenerator;
1010
import io.swagger.codegen.*;
11+
import io.swagger.jackson.mixin.ResponseSchemaMixin;
12+
import io.swagger.models.Response;
1113
import io.swagger.models.Swagger;
1214
import io.swagger.util.DeserializationModule;
15+
import io.swagger.util.Yaml;
1316
import org.apache.commons.io.FileUtils;
1417
import org.slf4j.Logger;
1518
import org.slf4j.LoggerFactory;
@@ -92,5 +95,6 @@ private void configureMapper(ObjectMapper mapper) {
9295
mapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
9396
mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
9497
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
98+
mapper.addMixIn(Response.class, ResponseSchemaMixin.class);
9599
}
96100
}

0 commit comments

Comments
 (0)