diff --git a/core/src/main/resources/reference.conf b/core/src/main/resources/reference.conf index a11b71a..610134f 100644 --- a/core/src/main/resources/reference.conf +++ b/core/src/main/resources/reference.conf @@ -95,8 +95,8 @@ openapi { } ] - converters = [ - "io.sinistral.proteus.openapi.jaxrs2.ServerModelResolver" + converterClasses = [ + ] } diff --git a/openapi/src/main/java/io/sinistral/proteus/openapi/services/OpenAPIService.java b/openapi/src/main/java/io/sinistral/proteus/openapi/services/OpenAPIService.java index c3daba8..6fa5c5a 100644 --- a/openapi/src/main/java/io/sinistral/proteus/openapi/services/OpenAPIService.java +++ b/openapi/src/main/java/io/sinistral/proteus/openapi/services/OpenAPIService.java @@ -9,6 +9,7 @@ import com.google.inject.name.Named; import com.typesafe.config.Config; import io.sinistral.proteus.openapi.jaxrs2.Reader; +import io.sinistral.proteus.openapi.jaxrs2.ServerModelResolver; import io.sinistral.proteus.openapi.jaxrs2.ServerParameterExtension; import io.sinistral.proteus.server.endpoints.EndpointInfo; import io.sinistral.proteus.services.DefaultService; @@ -254,7 +255,15 @@ protected void generateSpec() throws Exception SwaggerConfiguration config = new SwaggerConfiguration().resourceClasses(classes.stream().map(Class::getName).collect(Collectors.toSet())).openAPI(openApi); - config.setModelConverterClassess(new HashSet<>( openAPIConfig.getStringList("converters") )); + Set modelConverterClasses = new HashSet<>(); + + modelConverterClasses.add(ServerModelResolver.class.getName()); + + List additionalConverterClasses = openAPIConfig.getStringList("converterClasses"); + + modelConverterClasses.addAll(additionalConverterClasses); + + config.setModelConverterClassess(modelConverterClasses); OpenApiContext ctx = new GenericOpenApiContext().openApiConfiguration(config) .openApiReader(new Reader(config)) diff --git a/openapi/src/test/resources/application.conf b/openapi/src/test/resources/application.conf index a3b5b1b..098b42b 100644 --- a/openapi/src/test/resources/application.conf +++ b/openapi/src/test/resources/application.conf @@ -33,7 +33,7 @@ application { api.version="v1" -openapi.converters = ["io.sinistral.proteus.openapi.jaxrs2.ServerModelResolver","io.sinistral.proteus.openapi.test.converters.MoneyModelConverter"] +openapi.converterClasses = ["io.sinistral.proteus.openapi.test.converters.MoneyModelConverter"] globalHeaders {