|
@@ -135,9 +135,9 @@ The new Type Introduced - `oatpp::Any`.
|
|
|
Now it's possible to do like this:
|
|
|
|
|
|
```cpp
|
|
|
-class MyDto : public oatpp::Object {
|
|
|
+class MyDto : public oatpp::DTO {
|
|
|
|
|
|
- DTO_INIT(MyDto, Object)
|
|
|
+ DTO_INIT(MyDto, DTO)
|
|
|
|
|
|
DTO_FIELD(Any, any); // Put any oatpp::<Type> here
|
|
|
DTO_FIELD(List<Any>, listOfAny)
|
|
@@ -235,9 +235,9 @@ ENUM(MyEnum, v_int32,
|
|
|
VALUE(V3, 30, "enum1-v3")
|
|
|
);
|
|
|
|
|
|
-class MyDto : public oatpp::Object {
|
|
|
+class MyDto : public oatpp::DTO {
|
|
|
|
|
|
- DTO_INIT(MyDto, Object)
|
|
|
+ DTO_INIT(MyDto, DTO)
|
|
|
|
|
|
DTO_FIELD(Enum<MyEnum>, enum1); // Default interpretation - AsString
|
|
|
DTO_FIELD(Enum<MyEnum>::NotNull, enum2); // NOT_NULL constraint for Ser/De
|
|
@@ -300,9 +300,9 @@ Now DTOs can be used as a Key in `unordered_map` and `unordered_set`.
|
|
|
The convenience `DTO_HC_EQ` (DTO_HASHCODE_AND_EQUALS) macro has been added.
|
|
|
|
|
|
```cpp
|
|
|
-class User : public oatpp::Object {
|
|
|
+class User : public oatpp::DTO {
|
|
|
|
|
|
- DTO_INIT(User, Object)
|
|
|
+ DTO_INIT(User, DTO)
|
|
|
|
|
|
DTO_FIELD(String, firstName);
|
|
|
DTO_FIELD(String, lastName);
|
|
@@ -324,9 +324,9 @@ Now it's possible to add a description for DTO fields, which will be automatical
|
|
|
displayed in swagger-UI.
|
|
|
|
|
|
```cpp
|
|
|
-class MyDto : public oatpp::Object {
|
|
|
+class MyDto : public oatpp::DTO {
|
|
|
|
|
|
- DTO_INIT(MyDto, Object)
|
|
|
+ DTO_INIT(MyDto, DTO)
|
|
|
|
|
|
DTO_FIELD_INFO(id) {
|
|
|
info->description = "identifier";
|