Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/generators/tiny-cpp.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|Maps|✗|ToolingExtension
|CollectionFormat|✓|OAS2
|CollectionFormatMulti|✓|OAS2
|Enum||OAS2,OAS3
|Enum||OAS2,OAS3
|ArrayOfEnum|✓|ToolingExtension
|ArrayOfModel|✓|ToolingExtension
|ArrayOfCollectionOfPrimitives|✓|ToolingExtension
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,13 +249,13 @@ bool ModelBase::fromJson( const web::json::value& val, bool & outVal )
}
bool ModelBase::fromJson( const web::json::value& val, float & outVal )
{
outVal = !val.is_double() ? std::numeric_limits<float>::quiet_NaN(): static_cast<float>(val.as_double());
return val.is_double();
outVal = (!val.is_double() && !val.is_integer()) ? std::numeric_limits<float>::quiet_NaN(): static_cast<float>(val.as_double());
return val.is_double() || val.is_integer();
}
bool ModelBase::fromJson( const web::json::value& val, double & outVal )
{
outVal = !val.is_double() ? std::numeric_limits<double>::quiet_NaN(): val.as_double();
return val.is_double() ;
outVal = (!val.is_double() && !val.is_integer()) ? std::numeric_limits<double>::quiet_NaN(): val.as_double();
return val.is_double() || val.is_integer();
}
bool ModelBase::fromJson( const web::json::value& val, int32_t & outVal )
{
Expand Down
8 changes: 4 additions & 4 deletions samples/client/petstore/cpp-restsdk/client/ModelBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,13 +260,13 @@ bool ModelBase::fromJson( const web::json::value& val, bool & outVal )
}
bool ModelBase::fromJson( const web::json::value& val, float & outVal )
{
outVal = !val.is_double() ? std::numeric_limits<float>::quiet_NaN(): static_cast<float>(val.as_double());
return val.is_double();
outVal = (!val.is_double() && !val.is_integer()) ? std::numeric_limits<float>::quiet_NaN(): static_cast<float>(val.as_double());
return val.is_double() || val.is_integer();
}
bool ModelBase::fromJson( const web::json::value& val, double & outVal )
{
outVal = !val.is_double() ? std::numeric_limits<double>::quiet_NaN(): val.as_double();
return val.is_double() ;
outVal = (!val.is_double() && !val.is_integer()) ? std::numeric_limits<double>::quiet_NaN(): val.as_double();
return val.is_double() || val.is_integer();
}
bool ModelBase::fromJson( const web::json::value& val, int32_t & outVal )
{
Expand Down