Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
tminglei authored Apr 23, 2017
1 parent bf2515c commit 58bda3a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


## Features
- lightweight, less then 3000 line codes (framework + built-in route/fake data generating)
- lightweight, less than 3000 line codes (framework + built-in route/fake data generating)
- based on `form-binder-java`, allowing dynamic objects in operation's parameter/response definitions
- directly integrate with `swagger-models`, allowing to operate swagger object when necessary
- can generate mock response w/ fake data on demand for unimplemented api operations
Expand Down Expand Up @@ -50,16 +50,17 @@ static Mapping<?> pet = $(mapping(
static SharingHolder sharing = sharing().pathPrefix("/pet").tag("pet");

static {
sharing.operation(GET, "/:petId<[0-9]+>")
sharing.operation(GET, "/{petId}")
.summary("get pet by id")
.parameter(param(longv()).in("path").name("petId").example(1l))
.response(200, response(pet))
.response(404, response().description("pet not found"))
.notImplemented() // MARK IT `notImplemented`, THEN `binder-swagger-java` WILL GENERATE MOCK RESPONSE FOR YOU
;
}
@POST
public Response addPet(String data) throws BadRequestException, SQLException {
@GET
@Path("/{petId}")
public Response getPetById(@PathParam("petId") String petId) throws NotFoundException, SQLException {
...
```
#### 2) supplement your other swagger info:
Expand Down

0 comments on commit 58bda3a

Please sign in to comment.