Helper classes for create C++ Data Transfer Object
Use a wsjcpp
:
$ wsjcpp install https://github.com/wsjcpp/wsjcpp-dto:master
Or include this files:
- src.wsjcpp/nlohmann_json/json.hpp
- src/wsjcpp_dto.h
- src/wsjcpp_dto.cpp
class WsjcppDtoPerson : public WsjcppDto {
public:
WsjcppDtoPerson() : WsjcppDto("person", "Person") {
requireField<WsjcppDtoString>("name", "Name of person");
optionalField<WsjcppDtoInteger>("age", "Age of person");
};
};