mirror of
https://gitee.com/zyjblog/oatpp.git
synced 2024-12-22 22:16:37 +08:00
Update README.md
This commit is contained in:
parent
63ce57cc12
commit
0b151a7af9
16
README.md
16
README.md
@ -14,7 +14,7 @@ Organic. Pure C++.
|
||||
- **Asynchronous server (High performance. Handle 30K+ simultaneous connections)**
|
||||
- Multithreaded server (Simple API)
|
||||
- Connection agnostic. (Use whatever transport. Whatever SSL backend. Whatever sockets, pipes, files. etc. It cares about HTTP stream only)
|
||||
- REST framework
|
||||
- REST framework (with ability to autodocument endpoints see [oatpp-swagger](https://github.com/oatpp/oatpp-swagger))
|
||||
- Retrofit-like client wrapper (Use whatever request executor for example cURL, or minimalistic one provided out of the box)
|
||||
- Object mapping (Fast object serialization-deserialization. Currently JSON, more formats comes shortly)
|
||||
- Simple dependency injection framework
|
||||
@ -149,6 +149,20 @@ $ curl -X POST "localhost:8001/demo/api_async/json" -d '{"message": "hello json
|
||||
dtoMessage: hello json post
|
||||
```
|
||||
|
||||
### Swagger documentation
|
||||
|
||||
```c++
|
||||
ENDPOINT_INFO(createUser) {
|
||||
info->summary = "Create new User";
|
||||
info->addConsumes<UserDto::ObjectWrapper>("application/json");
|
||||
info->addResponse<UserDto::ObjectWrapper>(Status::CODE_200, "application/json");
|
||||
}
|
||||
ENDPOINT("POST", "demo/api/users", createUser,
|
||||
BODY_DTO(UserDto::ObjectWrapper, userDto)) {
|
||||
return createDtoResponse(Status::CODE_200, m_database->createUser(userDto));
|
||||
}
|
||||
```
|
||||
|
||||
## How to start
|
||||
|
||||
Grab any project from [examples](https://github.com/oatpp/oatpp-examples), and follow README
|
||||
|
Loading…
Reference in New Issue
Block a user