File tree Expand file tree Collapse file tree 37 files changed +177
-79
lines changed
modules/openapi-generator/src/main/resources/cpp-rest-sdk-client
samples/client/petstore/cpp-restsdk Expand file tree Collapse file tree 37 files changed +177
-79
lines changed Original file line number Diff line number Diff line change @@ -140,7 +140,11 @@ void {{classname}}::fromJson(web::json::value& val)
140
140
{ {^required} }
141
141
if(val.has_field(utility::conversions::to_string_t("{ {baseName} }")))
142
142
{
143
- {{setter} }(ModelBase::{ {baseType} }FromJson(val[utility::conversions::to_string_t("{ {baseName} }")]));
143
+ web::json::value& fieldValue = val[utility::conversions::to_string_t(" {{baseName}}" )];
144
+ if (! fieldValue.is_null())
145
+ {
146
+ {{setter} }(ModelBase::{ {baseType} }FromJson(fieldValue));
147
+ }
144
148
}
145
149
{ {/required} }
146
150
{ {#required} }
@@ -242,27 +246,28 @@ void {{classname}}::fromJson(web::json::value& val)
242
246
{ {^required} }
243
247
if(val.has_field(utility::conversions::to_string_t("{ {baseName} }")))
244
248
{
245
- {{#isString} }
246
- { {setter} }(ModelBase::stringFromJson(val[utility::conversions::to_string_t("{ {baseName} }")]));
247
- { {/isString} }
248
- { {#isByteArray} }
249
- { {setter} }(ModelBase::stringFromJson(val[utility::conversions::to_string_t("{ {baseName} }")]));
250
- { {/isByteArray} }
251
- { {^isString} }
252
- { {#isDateTime} }
253
- { {setter} }(ModelBase::dateFromJson(val[utility::conversions::to_string_t("{ {baseName} }")]));
254
- { {/isDateTime} }
255
- { {^isDateTime} }
256
- { {^isByteArray} }
257
- if(!val[utility::conversions::to_string_t("{ {baseName} }")].is_null())
249
+ web::json::value& fieldValue = val[utility::conversions::to_string_t(" {{baseName}}" )];
250
+ if (! fieldValue.is_null())
258
251
{
252
+ {{#isString} }
253
+ { {setter} }(ModelBase::stringFromJson(fieldValue));
254
+ { {/isString} }
255
+ { {#isByteArray} }
256
+ { {setter} }(ModelBase::stringFromJson(fieldValue));
257
+ { {/isByteArray} }
258
+ { {^isString} }
259
+ { {#isDateTime} }
260
+ { {setter} }(ModelBase::dateFromJson(fieldValue));
261
+ { {/isDateTime} }
262
+ { {^isDateTime} }
263
+ { {^isByteArray} }
259
264
{ {{dataType} }} newItem({ {{defaultValue} }});
260
- newItem->fromJson(val[utility::conversions::to_string_t(" { {baseName } }")] );
265
+ newItem->fromJson(fieldValue );
261
266
{ {setter} }( newItem );
267
+ { {/isByteArray} }
268
+ { {/isDateTime} }
269
+ { {/isString} }
262
270
}
263
- { {/isByteArray} }
264
- { {/isDateTime} }
265
- { {/isString} }
266
271
}
267
272
{ {/required} }
268
273
{ {#required} }
Original file line number Diff line number Diff line change 1
- 3.2.2 -SNAPSHOT
1
+ 3.3.0 -SNAPSHOT
Original file line number Diff line number Diff line change 4
4
*
5
5
* OpenAPI spec version: 1.0.0
6
6
*
7
- * NOTE: This class is auto generated by OpenAPI-Generator 3.2.2 -SNAPSHOT.
7
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0 -SNAPSHOT.
8
8
* https://openapi-generator.tech
9
9
* Do not edit the class manually.
10
10
*/
Original file line number Diff line number Diff line change 4
4
*
5
5
* OpenAPI spec version: 1.0.0
6
6
*
7
- * NOTE: This class is auto generated by OpenAPI-Generator 3.2.2 -SNAPSHOT.
7
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0 -SNAPSHOT.
8
8
* https://openapi-generator.tech
9
9
* Do not edit the class manually.
10
10
*/
Original file line number Diff line number Diff line change 4
4
*
5
5
* OpenAPI spec version: 1.0.0
6
6
*
7
- * NOTE: This class is auto generated by OpenAPI-Generator 3.2.2 -SNAPSHOT.
7
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0 -SNAPSHOT.
8
8
* https://openapi-generator.tech
9
9
* Do not edit the class manually.
10
10
*/
Original file line number Diff line number Diff line change 4
4
*
5
5
* OpenAPI spec version: 1.0.0
6
6
*
7
- * NOTE: This class is auto generated by OpenAPI-Generator 3.2.2 -SNAPSHOT.
7
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0 -SNAPSHOT.
8
8
* https://openapi-generator.tech
9
9
* Do not edit the class manually.
10
10
*/
Original file line number Diff line number Diff line change 4
4
*
5
5
* OpenAPI spec version: 1.0.0
6
6
*
7
- * NOTE: This class is auto generated by OpenAPI-Generator 3.2.2 -SNAPSHOT.
7
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0 -SNAPSHOT.
8
8
* https://openapi-generator.tech
9
9
* Do not edit the class manually.
10
10
*/
Original file line number Diff line number Diff line change 4
4
*
5
5
* OpenAPI spec version: 1.0.0
6
6
*
7
- * NOTE: This class is auto generated by OpenAPI-Generator 3.2.2 -SNAPSHOT.
7
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0 -SNAPSHOT.
8
8
* https://openapi-generator.tech
9
9
* Do not edit the class manually.
10
10
*/
Original file line number Diff line number Diff line change 4
4
*
5
5
* OpenAPI spec version: 1.0.0
6
6
*
7
- * NOTE: This class is auto generated by OpenAPI-Generator 3.2.2 -SNAPSHOT.
7
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0 -SNAPSHOT.
8
8
* https://openapi-generator.tech
9
9
* Do not edit the class manually.
10
10
*/
Original file line number Diff line number Diff line change 4
4
*
5
5
* OpenAPI spec version: 1.0.0
6
6
*
7
- * NOTE: This class is auto generated by OpenAPI-Generator 3.2.2 -SNAPSHOT.
7
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0 -SNAPSHOT.
8
8
* https://openapi-generator.tech
9
9
* Do not edit the class manually.
10
10
*/
Original file line number Diff line number Diff line change 4
4
*
5
5
* OpenAPI spec version: 1.0.0
6
6
*
7
- * NOTE: This class is auto generated by OpenAPI-Generator 3.2.2 -SNAPSHOT.
7
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0 -SNAPSHOT.
8
8
* https://openapi-generator.tech
9
9
* Do not edit the class manually.
10
10
*/
Original file line number Diff line number Diff line change 4
4
*
5
5
* OpenAPI spec version: 1.0.0
6
6
*
7
- * NOTE: This class is auto generated by OpenAPI-Generator 3.2.2 -SNAPSHOT.
7
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0 -SNAPSHOT.
8
8
* https://openapi-generator.tech
9
9
* Do not edit the class manually.
10
10
*/
Original file line number Diff line number Diff line change 4
4
*
5
5
* OpenAPI spec version: 1.0.0
6
6
*
7
- * NOTE: This class is auto generated by OpenAPI-Generator 3.2.2 -SNAPSHOT.
7
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0 -SNAPSHOT.
8
8
* https://openapi-generator.tech
9
9
* Do not edit the class manually.
10
10
*/
Original file line number Diff line number Diff line change 4
4
*
5
5
* OpenAPI spec version: 1.0.0
6
6
*
7
- * NOTE: This class is auto generated by OpenAPI-Generator 3.2.2 -SNAPSHOT.
7
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0 -SNAPSHOT.
8
8
* https://openapi-generator.tech
9
9
* Do not edit the class manually.
10
10
*/
Original file line number Diff line number Diff line change 4
4
*
5
5
* OpenAPI spec version: 1.0.0
6
6
*
7
- * NOTE: This class is auto generated by OpenAPI-Generator 3.2.2 -SNAPSHOT.
7
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0 -SNAPSHOT.
8
8
* https://openapi-generator.tech
9
9
* Do not edit the class manually.
10
10
*/
Original file line number Diff line number Diff line change 4
4
*
5
5
* OpenAPI spec version: 1.0.0
6
6
*
7
- * NOTE: This class is auto generated by OpenAPI-Generator 3.2.2 -SNAPSHOT.
7
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0 -SNAPSHOT.
8
8
* https://openapi-generator.tech
9
9
* Do not edit the class manually.
10
10
*/
Original file line number Diff line number Diff line change 4
4
*
5
5
* OpenAPI spec version: 1.0.0
6
6
*
7
- * NOTE: This class is auto generated by OpenAPI-Generator 3.2.2 -SNAPSHOT.
7
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0 -SNAPSHOT.
8
8
* https://openapi-generator.tech
9
9
* Do not edit the class manually.
10
10
*/
Original file line number Diff line number Diff line change 4
4
*
5
5
* OpenAPI spec version: 1.0.0
6
6
*
7
- * NOTE: This class is auto generated by OpenAPI-Generator 3.2.2 -SNAPSHOT.
7
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0 -SNAPSHOT.
8
8
* https://openapi-generator.tech
9
9
* Do not edit the class manually.
10
10
*/
Original file line number Diff line number Diff line change 4
4
*
5
5
* OpenAPI spec version: 1.0.0
6
6
*
7
- * NOTE: This class is auto generated by OpenAPI-Generator 3.2.2 -SNAPSHOT.
7
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0 -SNAPSHOT.
8
8
* https://openapi-generator.tech
9
9
* Do not edit the class manually.
10
10
*/
Original file line number Diff line number Diff line change 4
4
*
5
5
* OpenAPI spec version: 1.0.0
6
6
*
7
- * NOTE: This class is auto generated by OpenAPI-Generator 3.2.2 -SNAPSHOT.
7
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0 -SNAPSHOT.
8
8
* https://openapi-generator.tech
9
9
* Do not edit the class manually.
10
10
*/
Original file line number Diff line number Diff line change 4
4
*
5
5
* OpenAPI spec version: 1.0.0
6
6
*
7
- * NOTE: This class is auto generated by OpenAPI-Generator 3.2.2 -SNAPSHOT.
7
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0 -SNAPSHOT.
8
8
* https://openapi-generator.tech
9
9
* Do not edit the class manually.
10
10
*/
Original file line number Diff line number Diff line change 4
4
*
5
5
* OpenAPI spec version: 1.0.0
6
6
*
7
- * NOTE: This class is auto generated by OpenAPI-Generator 3.2.2 -SNAPSHOT.
7
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0 -SNAPSHOT.
8
8
* https://openapi-generator.tech
9
9
* Do not edit the class manually.
10
10
*/
Original file line number Diff line number Diff line change 4
4
*
5
5
* OpenAPI spec version: 1.0.0
6
6
*
7
- * NOTE: This class is auto generated by OpenAPI-Generator 3.2.2 -SNAPSHOT.
7
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0 -SNAPSHOT.
8
8
* https://openapi-generator.tech
9
9
* Do not edit the class manually.
10
10
*/
Original file line number Diff line number Diff line change 4
4
*
5
5
* OpenAPI spec version: 1.0.0
6
6
*
7
- * NOTE: This class is auto generated by OpenAPI-Generator 3.2.2 -SNAPSHOT.
7
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0 -SNAPSHOT.
8
8
* https://openapi-generator.tech
9
9
* Do not edit the class manually.
10
10
*/
Original file line number Diff line number Diff line change 4
4
*
5
5
* OpenAPI spec version: 1.0.0
6
6
*
7
- * NOTE: This class is auto generated by OpenAPI-Generator 3.2.2 -SNAPSHOT.
7
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0 -SNAPSHOT.
8
8
* https://openapi-generator.tech
9
9
* Do not edit the class manually.
10
10
*/
Original file line number Diff line number Diff line change 4
4
*
5
5
* OpenAPI spec version: 1.0.0
6
6
*
7
- * NOTE: This class is auto generated by OpenAPI-Generator 3.2.2 -SNAPSHOT.
7
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0 -SNAPSHOT.
8
8
* https://openapi-generator.tech
9
9
* Do not edit the class manually.
10
10
*/
@@ -61,15 +61,27 @@ void ApiResponse::fromJson(web::json::value& val)
61
61
{
62
62
if (val.has_field (utility::conversions::to_string_t (" code" )))
63
63
{
64
- setCode (ModelBase::int32_tFromJson (val[utility::conversions::to_string_t (" code" )]));
64
+ web::json::value& fieldValue = val[utility::conversions::to_string_t (" code" )];
65
+ if (!fieldValue.is_null ())
66
+ {
67
+ setCode (ModelBase::int32_tFromJson (fieldValue));
68
+ }
65
69
}
66
70
if (val.has_field (utility::conversions::to_string_t (" type" )))
67
71
{
68
- setType (ModelBase::stringFromJson (val[utility::conversions::to_string_t (" type" )]));
72
+ web::json::value& fieldValue = val[utility::conversions::to_string_t (" type" )];
73
+ if (!fieldValue.is_null ())
74
+ {
75
+ setType (ModelBase::stringFromJson (fieldValue));
76
+ }
69
77
}
70
78
if (val.has_field (utility::conversions::to_string_t (" message" )))
71
79
{
72
- setMessage (ModelBase::stringFromJson (val[utility::conversions::to_string_t (" message" )]));
80
+ web::json::value& fieldValue = val[utility::conversions::to_string_t (" message" )];
81
+ if (!fieldValue.is_null ())
82
+ {
83
+ setMessage (ModelBase::stringFromJson (fieldValue));
84
+ }
73
85
}
74
86
}
75
87
Original file line number Diff line number Diff line change 4
4
*
5
5
* OpenAPI spec version: 1.0.0
6
6
*
7
- * NOTE: This class is auto generated by OpenAPI-Generator 3.2.2 -SNAPSHOT.
7
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0 -SNAPSHOT.
8
8
* https://openapi-generator.tech
9
9
* Do not edit the class manually.
10
10
*/
Original file line number Diff line number Diff line change 4
4
*
5
5
* OpenAPI spec version: 1.0.0
6
6
*
7
- * NOTE: This class is auto generated by OpenAPI-Generator 3.2.2 -SNAPSHOT.
7
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0 -SNAPSHOT.
8
8
* https://openapi-generator.tech
9
9
* Do not edit the class manually.
10
10
*/
@@ -55,11 +55,19 @@ void Category::fromJson(web::json::value& val)
55
55
{
56
56
if (val.has_field (utility::conversions::to_string_t (" id" )))
57
57
{
58
- setId (ModelBase::int64_tFromJson (val[utility::conversions::to_string_t (" id" )]));
58
+ web::json::value& fieldValue = val[utility::conversions::to_string_t (" id" )];
59
+ if (!fieldValue.is_null ())
60
+ {
61
+ setId (ModelBase::int64_tFromJson (fieldValue));
62
+ }
59
63
}
60
64
if (val.has_field (utility::conversions::to_string_t (" name" )))
61
65
{
62
- setName (ModelBase::stringFromJson (val[utility::conversions::to_string_t (" name" )]));
66
+ web::json::value& fieldValue = val[utility::conversions::to_string_t (" name" )];
67
+ if (!fieldValue.is_null ())
68
+ {
69
+ setName (ModelBase::stringFromJson (fieldValue));
70
+ }
63
71
}
64
72
}
65
73
Original file line number Diff line number Diff line change 4
4
*
5
5
* OpenAPI spec version: 1.0.0
6
6
*
7
- * NOTE: This class is auto generated by OpenAPI-Generator 3.2.2 -SNAPSHOT.
7
+ * NOTE: This class is auto generated by OpenAPI-Generator 3.3.0 -SNAPSHOT.
8
8
* https://openapi-generator.tech
9
9
* Do not edit the class manually.
10
10
*/
You can’t perform that action at this time.
0 commit comments