@@ -74,44 +74,44 @@ Schema::ObjectWrapper Generator::generateSchemaForType(const oatpp::data::mappin
74
74
75
75
OATPP_ASSERT (type && " [oatpp-swagger::oas3::Generator::generateSchemaForType()]: Error. Type should not be null." );
76
76
77
- auto typeName = type->name ;
78
- if (typeName == oatpp::data::mapping::type::__class::String::CLASS_NAME ){
77
+ auto classId = type->classId . id ;
78
+ if (classId == oatpp::data::mapping::type::__class::String::CLASS_ID. id ){
79
79
auto result = Schema::createShared ();
80
80
result->type = " string" ;
81
81
return result;
82
- } else if (typeName == oatpp::data::mapping::type::__class::Int32::CLASS_NAME ){
82
+ } else if (classId == oatpp::data::mapping::type::__class::Int32::CLASS_ID. id ){
83
83
auto result = Schema::createShared ();
84
84
result->type = " integer" ;
85
85
result->format = " int32" ;
86
86
return result;
87
- } else if (typeName == oatpp::data::mapping::type::__class::Int64::CLASS_NAME ){
87
+ } else if (classId == oatpp::data::mapping::type::__class::Int64::CLASS_ID. id ){
88
88
auto result = Schema::createShared ();
89
89
result->type = " integer" ;
90
90
result->format = " int64" ;
91
91
return result;
92
- } else if (typeName == oatpp::data::mapping::type::__class::Float32 ::CLASS_NAME ){
92
+ } else if (classId == oatpp::data::mapping::type::__class::Float32 ::CLASS_ID. id ){
93
93
auto result = Schema::createShared ();
94
94
result->type = " number" ;
95
95
result->format = " float" ;
96
96
return result;
97
- } else if (typeName == oatpp::data::mapping::type::__class::Float64 ::CLASS_NAME ){
97
+ } else if (classId == oatpp::data::mapping::type::__class::Float64 ::CLASS_ID. id ){
98
98
auto result = Schema::createShared ();
99
99
result->type = " number" ;
100
100
result->format = " double" ;
101
101
return result;
102
- } else if (typeName == oatpp::data::mapping::type::__class::Boolean ::CLASS_NAME ){
102
+ } else if (classId == oatpp::data::mapping::type::__class::Boolean ::CLASS_ID. id ){
103
103
auto result = Schema::createShared ();
104
104
result->type = " boolean" ;
105
105
return result;
106
- } else if (typeName == oatpp::data::mapping::type::__class::AbstractObject::CLASS_NAME ){
106
+ } else if (classId == oatpp::data::mapping::type::__class::AbstractObject::CLASS_ID. id ){
107
107
return generateSchemaForTypeObject (type, linkSchema, usedTypes);
108
- } else if (typeName == oatpp::data::mapping::type::__class::AbstractList::CLASS_NAME ){
108
+ } else if (classId == oatpp::data::mapping::type::__class::AbstractList::CLASS_ID. id ){
109
109
return generateSchemaForTypeList (type, linkSchema, usedTypes);
110
- } else if (typeName == oatpp::data::mapping::type::__class::AbstractListMap::CLASS_NAME ){
110
+ } else if (classId == oatpp::data::mapping::type::__class::AbstractListMap::CLASS_ID. id ){
111
111
// TODO
112
112
} else {
113
113
auto result = Schema::createShared ();
114
- result->type = type->name ;
114
+ result->type = type->classId . name ;
115
115
if (type->nameQualifier ) {
116
116
result->format = type->nameQualifier ;
117
117
}
@@ -181,11 +181,11 @@ RequestBody::ObjectWrapper Generator::generateRequestBody(const Endpoint::Info&
181
181
182
182
OATPP_ASSERT (endpointInfo.body .type && " [oatpp-swagger::oas3::Generator::generateRequestBody()]: Error. Type should not be null." );
183
183
184
- if (endpointInfo.body .type ->name == oatpp::data::mapping::type::__class::AbstractObject::CLASS_NAME ) {
184
+ if (endpointInfo.body .type ->classId . id == oatpp::data::mapping::type::__class::AbstractObject::CLASS_ID. id ) {
185
185
body->content ->put (" application/json" , mediaType);
186
- } else if (endpointInfo.body .type ->name == oatpp::data::mapping::type::__class::AbstractList::CLASS_NAME ) {
186
+ } else if (endpointInfo.body .type ->classId . id == oatpp::data::mapping::type::__class::AbstractList::CLASS_ID. id ) {
187
187
body->content ->put (" application/json" , mediaType);
188
- } else if (endpointInfo.body .type ->name == oatpp::data::mapping::type::__class::AbstractListMap::CLASS_NAME ) {
188
+ } else if (endpointInfo.body .type ->classId . id == oatpp::data::mapping::type::__class::AbstractListMap::CLASS_ID. id ) {
189
189
body->content ->put (" application/json" , mediaType);
190
190
} else {
191
191
body->content ->put (" text/plain" , mediaType);
@@ -397,12 +397,12 @@ void Generator::decomposeMap(const oatpp::data::mapping::type::Type* type, UsedT
397
397
398
398
void Generator::decomposeType (const oatpp::data::mapping::type::Type* type, UsedTypes& decomposedTypes) {
399
399
OATPP_ASSERT (type && " [oatpp-swagger::oas3::Generator::decomposeType()]: Error. Type should not be null." );
400
- auto typeName = type->name ;
401
- if (typeName == oatpp::data::mapping::type::__class::AbstractObject::CLASS_NAME ){
400
+ auto classId = type->classId . id ;
401
+ if (classId == oatpp::data::mapping::type::__class::AbstractObject::CLASS_ID. id ){
402
402
decomposeObject (type, decomposedTypes);
403
- } else if (typeName == oatpp::data::mapping::type::__class::AbstractList::CLASS_NAME ){
403
+ } else if (classId == oatpp::data::mapping::type::__class::AbstractList::CLASS_ID. id ){
404
404
decomposeList (type, decomposedTypes);
405
- } else if (typeName == oatpp::data::mapping::type::__class::AbstractListMap::CLASS_NAME ){
405
+ } else if (classId == oatpp::data::mapping::type::__class::AbstractListMap::CLASS_ID. id ){
406
406
decomposeMap (type, decomposedTypes);
407
407
}
408
408
}
0 commit comments