From bd08926910a144befbb5b6fe312a2037528ff7f4 Mon Sep 17 00:00:00 2001 From: noboomu Date: Thu, 29 Nov 2018 18:42:28 -0800 Subject: [PATCH 1/2] Update README.md Updated docs for OpenAPI 3. --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index eccbc36..32f8541 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ Controllers Controller classes respect standard Swagger / JAX-RS annotations: ```java -@Api(tags="benchmarks") +@Tags({@Tag(name = "benchmarks")}) @Path("/benchmarks") @Produces((MediaType.APPLICATION_JSON)) @Consumes((MediaType.MEDIA_TYPE_WILDCARD)) @@ -65,7 +65,7 @@ Controller class methods respect standard Swagger / JAX-RS annotations: @GET @Path("/plaintext") @Produces((MediaType.TEXT_PLAIN)) -@ApiOperation(value = "Plaintext endpoint" ) +@Operation(description = "Plaintext endpoint" ) public ServerResponse plaintext(ServerRequest request) { return response("Hello, World!").textPlain(); @@ -135,7 +135,7 @@ For methods that should return a `String` or `ByteBuffer` to the client users ca @GET @Path("/hello-world") @Produces((MediaType.TEXT_PLAIN)) -@ApiOperation(value = "Serve a plaintext message using a ServerResponse") +@Operation(description = "Serve a plaintext message using a ServerResponse") public ServerResponse plaintext(ServerRequest request, @QueryParam("message") String message) { return ServerResponse.response("Hello, World!").textPlain(); @@ -148,7 +148,7 @@ For other types of responses the following demonstrates the preferred style: @GET @Path("/world") @Produces((MediaType.APPLICATION_JSON)) -@ApiOperation(value = "Return a world JSON object", httpMethod = "GET", response=World.class ) +@Operation(description = "Return a world JSON object") public ServerResponse getWorld(ServerRequest request, @QueryParam("id") Integer id, @QueryParam("randomNumber") Integer randomNumber ) { return response(new World(id,randomNumber)).applicationJson(); @@ -161,7 +161,7 @@ The entity can be set separately as well: @GET @Path("/world") @Produces((MediaType.APPLICATION_JSON)) -@ApiOperation(value = "Return a world JSON object", httpMethod = "GET", response=World.class ) +@Operation(description = "Return a world JSON object") public io.sinistral.proteus.server.ServerResponse getWorld(Integer id, Integer randomNumber ) { return io.sinistral.proteus.server.ServerResponse.response().entity(new World(id,randomNumber)); @@ -173,7 +173,7 @@ public io.sinistral.proteus.server.ServerResponse getWorld(Integer id, Integer ```java @GET @Path("/future/user") -@ApiOperation(value = "Future user endpoint", httpMethod = "GET" ) +@Operation(description = "Future user endpoint" ) public CompletableFuture> futureUser( ServerRequest request ) { return CompletableFuture.completedFuture(response( new User(123L) ).applicationJson() ); @@ -205,7 +205,7 @@ Optional parameters are also supported, here is a more complex endpoint demonstr ```java @GET @Path("/response/parameters/complex/{pathLong}") -@ApiOperation(value = "Complex parameters", httpMethod = "GET") +@Operation(description = "Complex parameters") public ServerResponse> complexParameters( ServerRequest serverRequest, @PathParam("pathLong") final Long pathLong, @@ -245,7 +245,7 @@ public ServerResponse> complexParameters( Services ------------- -Proteus comes with two standard services that extend the ```io.sinistral.proteus.services.BaseService``` class. +Proteus comes with three standard services that extend the ```io.sinistral.proteus.services.BaseService``` class. - __AssetsService__ The AssetsService mounts an asset directory at a given path and is configured in your ```application.conf``` file. From de23db495ba563ccd42fb8e4b73042a41367c1f8 Mon Sep 17 00:00:00 2001 From: noboomu Date: Thu, 29 Nov 2018 18:48:23 -0800 Subject: [PATCH 2/2] Update README.md --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 32f8541..0d15df0 100644 --- a/README.md +++ b/README.md @@ -31,8 +31,6 @@ Getting Started /bin/bash -e <(curl -fsSL https://raw.githubusercontent.com/noboomu/proteus-example/master/scripts/quickStart.sh) ``` -- Open [http://localhost:8090/v1/swagger](http://localhost:8090/v1/swagger) for a v2 Swagger UI. -- Open [http://localhost:8090/v1/swagger/redoc](http://localhost:8090/v1/swagger/redoc) for a pretty version of your API. - Open [http://localhost:8090/v1/openapi](http://localhost:8090/v1/openapi) for an OpenAPI UI. ### As a dependency