Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Updated docs for OpenAPI 3.
  • Loading branch information
noboomu authored Nov 30, 2018
1 parent 2d9f8ce commit bd08926
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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<ByteBuffer> plaintext(ServerRequest request)
{
return response("Hello, World!").textPlain();
Expand Down Expand Up @@ -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<ByteBuffer> plaintext(ServerRequest request, @QueryParam("message") String message)
{
return ServerResponse.response("Hello, World!").textPlain();
Expand All @@ -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<World> getWorld(ServerRequest request, @QueryParam("id") Integer id, @QueryParam("randomNumber") Integer randomNumber )
{
return response(new World(id,randomNumber)).applicationJson();
Expand All @@ -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));
Expand All @@ -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<ServerResponse<User>> futureUser( ServerRequest request )
{
return CompletableFuture.completedFuture(response( new User(123L) ).applicationJson() );
Expand Down Expand Up @@ -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<Map<String,Object>> complexParameters(
ServerRequest serverRequest,
@PathParam("pathLong") final Long pathLong,
Expand Down Expand Up @@ -245,7 +245,7 @@ public ServerResponse<Map<String,Object>> 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.
Expand Down

0 comments on commit bd08926

Please sign in to comment.