diff --git a/src/main/java/io/sinistral/proteus/server/handlers/HandlerGenerator.java b/src/main/java/io/sinistral/proteus/server/handlers/HandlerGenerator.java index 2b4e2ed..dfded9f 100644 --- a/src/main/java/io/sinistral/proteus/server/handlers/HandlerGenerator.java +++ b/src/main/java/io/sinistral/proteus/server/handlers/HandlerGenerator.java @@ -281,8 +281,7 @@ public static void addStatement(MethodSpec.Builder builder, Parameter parameter) */ public static TypeHandler forType(Type type) { - log.debug("forType " + type); - + boolean hasValueOf = false; boolean hasFromString = false; boolean isOptional = type.getTypeName().contains("java.util.Optional"); @@ -471,8 +470,7 @@ else if (type.getTypeName().contains("java.nio.ByteBuffer")) Class erasedType = (Class) extractErasedType(type); - log.debug("erasedType: " + erasedType + " for " + type); - + if (hasValueOfMethod(erasedType)) { return OptionalValueOfType; diff --git a/src/main/java/io/sinistral/proteus/server/swagger/Reader.java b/src/main/java/io/sinistral/proteus/server/swagger/Reader.java index beaec61..f5ff4e9 100644 --- a/src/main/java/io/sinistral/proteus/server/swagger/Reader.java +++ b/src/main/java/io/sinistral/proteus/server/swagger/Reader.java @@ -832,7 +832,7 @@ private Operation parseMethod(Class cls, Method method, AnnotatedMethod annot operationId = this.getOperationId(method.getName()); } - LOGGER.debug("initial operationId: " + operationId + " nickname: " + apiOperation.nickname()); + // LOGGER.debug("initial operationId: " + operationId + " nickname: " + apiOperation.nickname()); String responseContainer = null; @@ -849,7 +849,7 @@ private Operation parseMethod(Class cls, Method method, AnnotatedMethod annot operationId = apiOperation.nickname(); } - LOGGER.debug("operationId after nickname: " + operationId); + // LOGGER.debug("operationId after nickname: " + operationId); defaultResponseHeaders = parseResponseHeaders(apiOperation.responseHeaders()); @@ -1061,7 +1061,8 @@ else if( responseCls.isAssignableFrom(CompletableFuture.class) ) if (operation.getResponses() == null) { Response response = new Response().description(SUCCESSFUL_OPERATION); - operation.defaultResponse(response); + + operation.response(200, response); } processOperationDecorator(operation, method); @@ -1073,7 +1074,7 @@ private void processOperationDecorator(Operation operation, Method method) { final Iterator chain = SwaggerExtensions.chain(); if (chain.hasNext()) { SwaggerExtension extension = chain.next(); - LOGGER.debug("trying to decorate operation: {}", extension); + // LOGGER.debug("trying to decorate operation: {}", extension); extension.decorateOperation(operation, method, chain); } } @@ -1081,8 +1082,7 @@ private void processOperationDecorator(Operation operation, Method method) { private void addResponse(Operation operation, ApiResponse apiResponse) { Map responseHeaders = parseResponseHeaders(apiResponse.responseHeaders()); - Response response = new Response() -.description(apiResponse.message()).headers(responseHeaders); + Response response = new Response().description(apiResponse.message()).headers(responseHeaders); if (apiResponse.code() == 0) { operation.defaultResponse(response); @@ -1111,7 +1111,7 @@ private List getParameters(Type type, List annotations, j } - LOGGER.debug("getParameters for {}", type); + // LOGGER.debug("getParameters for {}", type); Set typesToSkip = new HashSet<>(); typesToSkip.add(TypeFactory.defaultInstance().constructType(ServerRequest.class)); typesToSkip.add(TypeFactory.defaultInstance().constructType(HttpServerExchange.class)); @@ -1150,7 +1150,7 @@ private List getParameters(Type type, List annotations, j final List processed = new ArrayList(parameters.size()); for (Parameter parameter : parameters) { - LOGGER.debug("getParameters for {}", type); + // LOGGER.debug("getParameters for {}", type); if (ParameterProcessor.applyAnnotations(swagger, parameter, type, annotations) != null) { @@ -1159,11 +1159,11 @@ private List getParameters(Type type, List annotations, j } return processed; } else { - LOGGER.debug("no parameter found, looking at body params"); + // LOGGER.debug("no parameter found, looking at body params"); final List body = new ArrayList(); if (!typesToSkip.contains(type)) { - LOGGER.debug("getBody Parameters for {}", type); + // LOGGER.debug("getBody Parameters for {}", type); Parameter param = ParameterProcessor.applyAnnotations(swagger, null, type, annotations); if (param != null) { diff --git a/src/main/java/io/sinistral/proteus/services/SwaggerService.java b/src/main/java/io/sinistral/proteus/services/SwaggerService.java index aabd887..0141ac3 100644 --- a/src/main/java/io/sinistral/proteus/services/SwaggerService.java +++ b/src/main/java/io/sinistral/proteus/services/SwaggerService.java @@ -60,15 +60,7 @@ public class SwaggerService extends BaseService implements Supplier + + + {{ applicationName }} ReDoc + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/reference.conf b/src/main/resources/reference.conf index 03dfd51..416fd0d 100644 --- a/src/main/resources/reference.conf +++ b/src/main/resources/reference.conf @@ -6,33 +6,24 @@ application { version = "1.0" name="proteus" - # tmpdir - tmpdir = ${java.io.tmpdir}/${application.name} - # path (a.k.a. as contextPath) path = "/v1" - # localhost host = "localhost" # HTTP ports port = 8090 + + #securePort = 8443 - # uncomment to enabled HTTPS - # securePort = 8443 - - # we do UTF-8 charset = UTF-8 - - # date format - dateFormat = dd-MMM-yyyy - + fallbackHandler = "io.sinistral.proteus.server.handlers.ServerFallbackHandler" defaultResponseListener = "io.sinistral.proteus.server.handlers.ServerDefaultResponseListener" - redirect_https = "" - + tmpdir = ${java.io.tmpdir}/${application.name} + } api.version="v1" @@ -63,7 +54,7 @@ swagger { # the path that has an index.html template and theme css files resourcePrefix="io/sinistral/proteus/swagger" # swagger version - swagger: "2.0" + swagger="2.0" info { # swagger info title title = ${application.name} @@ -75,12 +66,13 @@ swagger { theme="default" # where the swagger endpoints will be mounted basePath= ${application.path}"/swagger" + # where redoc will be mounted relative to swagger base path + redocPath= "redoc" #the name of the spec file specFilename="swagger.json" consumes = ["application/json"] produces = ["application/json"] - # supported schemes - schemes = ["http"] + } undertow