remove trailing space in cpprest, update samples

This commit is contained in:
wing328
2017-04-24 22:45:16 +08:00
parent fc2b3d49ea
commit aa85468932
32 changed files with 217 additions and 139 deletions

View File

@@ -1,9 +1,9 @@
/**
* Swagger Petstore
* This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@wordnik.com
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
@@ -283,6 +283,10 @@ int32_t ModelBase::int32_tFromJson(web::json::value& val)
{
return val.as_integer();
}
float ModelBase::floatFromJson(web::json::value& val)
{
return val.as_double();
}
utility::string_t ModelBase::stringFromJson(web::json::value& val)
{
return val.is_string() ? val.as_string() : U("");
@@ -319,6 +323,15 @@ int32_t ModelBase::int32_tFromHttpContent(std::shared_ptr<HttpContent> val)
ss >> result;
return result;
}
float ModelBase::floatFromHttpContent(std::shared_ptr<HttpContent> val)
{
utility::string_t str = ModelBase::stringFromHttpContent(val);
utility::stringstream_t ss(str);
float result = 0;
ss >> result;
return result;
}
utility::string_t ModelBase::stringFromHttpContent(std::shared_ptr<HttpContent> val)
{
std::shared_ptr<std::istream> data = val->getData();