Home United States USA — software C++ RESTful Web Service With Swagger-UI and Auto-Documented Endpoints

C++ RESTful Web Service With Swagger-UI and Auto-Documented Endpoints

484
0
SHARE

A 5 minutes tutorial how-to-use C++ web framework Oat++ to build RESTful web-service and integrate it with Swagger-UI.
Let’s be friends: Comment (0) Join the DZone community and get the full member experience. This is a 5 minutes tutorial how-to-use Oat++ web framework to build your own C++ performant web-service and integrate it with Swagger-UI. Clone oatpp repo: On Mac/Linux: For more detailed instructions see – installing Oat++ on Unix/Linux. On Windows: For more detailed instructions see – installing Oat++ on Windows. Now we are able to build services using Oat++. It is a zero-dependency framework, so NO additional installations are required. Clone “oatpp-starter” Build “oatpp-starter” on Mac/Linux Build “oatpp-starter” on Windows Run compiled executable: Now go to localhost:8000 and make sure that you can see the response from server MyController class – contains declared endpoints and their info together with additional Swagger annotations. MyDto class – resides in DTOs.hpp. Describes the Data-Transfer-Object used in the « Hello World » response mentioned above. In oatpp DTOs are used in ObjectMapping and Serialization/Deserialization. App.

Continue reading...