forked from loafle/openapi-generator-original
[cpprest] Add support for nested vectors (#7820)
* Small fixes to prevent crash when empty json body is provided. * cpprest : Add toJson and toHttpContent array support. * petstore : Run script. * cpprest : Fix toHttpContent function header. * petstore : Run script. * cpprest : Add support for primitive response without enclosing item. * cpprest : Fix spaces. * cpprest : Fix build if bodyParam is optional. * cpprest : Fix vector of vector param. * Small updates to use utf encoding Add * operator for ^required
This commit is contained in:
parent
3b7230b170
commit
73bd24db7d
@ -125,20 +125,6 @@ pplx::task<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/r
|
||||
{{/isContainer}}
|
||||
{{/required}}
|
||||
{
|
||||
{{#isContainer}}
|
||||
{{#isQueryParam}}
|
||||
queryParams[utility::conversions::to_string_t("{{baseName}}")] = ApiClient::parameterToArrayString<{{items.datatype}}>({{^required}}*{{/required}}{{paramName}});
|
||||
{{/isQueryParam}}
|
||||
{{#isHeaderParam}}
|
||||
headerParams[utility::conversions::to_string_t("{{baseName}}")] = ApiClient::parameterToArrayString<{{items.datatype}}>({{^required}}*{{/required}}{{paramName}});
|
||||
{{/isHeaderParam}}
|
||||
{{#isFormParam}}
|
||||
{{^isFile}}
|
||||
formParams[ utility::conversions::to_string_t("{{baseName}}") ] = ApiClient::parameterToArrayString<{{items.datatype}}>({{^required}}*{{/required}}{{paramName}});
|
||||
{{/isFile}}
|
||||
{{/isFormParam}}
|
||||
{{/isContainer}}
|
||||
{{^isContainer}}
|
||||
{{#isQueryParam}}
|
||||
queryParams[utility::conversions::to_string_t("{{baseName}}")] = ApiClient::parameterToString({{^required}}*{{/required}}{{paramName}});
|
||||
{{/isQueryParam}}
|
||||
@ -153,7 +139,6 @@ pplx::task<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/r
|
||||
formParams[ utility::conversions::to_string_t("{{baseName}}") ] = ApiClient::parameterToString({{^required}}*{{/required}}{{paramName}});
|
||||
{{/isFile}}
|
||||
{{/isFormParam}}
|
||||
{{/isContainer}}
|
||||
}
|
||||
{{/isPathParam}}
|
||||
{{/isBodyParam}}
|
||||
@ -187,8 +172,9 @@ pplx::task<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/r
|
||||
json = web::json::value::array(jsonArray);
|
||||
}
|
||||
{{/isListContainer}}
|
||||
{{^isListContainer}}
|
||||
json = ModelBase::toJson({{paramName}});
|
||||
{{^isListContainer}}{{#required}}json = ModelBase::toJson({{paramName}});
|
||||
{{/required}}{{^required}}if ({{paramName}})
|
||||
json = ModelBase::toJson(*{{paramName}});{{/required}}
|
||||
{{/isListContainer}}
|
||||
{{/isPrimitiveType}}
|
||||
|
||||
@ -217,15 +203,11 @@ pplx::task<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/r
|
||||
{{/items.isDateTime}}{{/items.isString}}{{/items.isPrimitiveType}}
|
||||
}
|
||||
multipart->add(ModelBase::toHttpContent(utility::conversions::to_string_t("{{paramName}}"), web::json::value::array(jsonArray), utility::conversions::to_string_t("application/json")));
|
||||
}
|
||||
{{/isListContainer}}
|
||||
{{^isListContainer}}
|
||||
{{#isString}}multipart->add(ModelBase::toHttpContent(utility::conversions::to_string_t("{{paramName}}"), {{paramName}}));
|
||||
{{/isString}}
|
||||
{{^isString}}
|
||||
if({{paramName}}.get())
|
||||
}{{/isListContainer}}
|
||||
{{^isListContainer}}{{#isString}}multipart->add(ModelBase::toHttpContent(utility::conversions::to_string_t("{{paramName}}"), {{paramName}}));
|
||||
{{/isString}}{{^isString}}if({{^required}}{{paramName}} && (*{{paramName}}){{/required}}{{#required}}{{paramName}}{{/required}}.get())
|
||||
{
|
||||
{{paramName}}->toMultipart(multipart, utility::conversions::to_string_t("{{paramName}}"));
|
||||
{{^required}}(*{{/required}}{{paramName}}{{^required}}){{/required}}->toMultipart(multipart, utility::conversions::to_string_t("{{paramName}}"));
|
||||
}
|
||||
{{/isString}}
|
||||
{{/isListContainer}}
|
||||
@ -345,8 +327,9 @@ pplx::task<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/r
|
||||
result[item.first] = itemObj;
|
||||
{{/vendorExtensions.x-codegen-response.items.isString}}{{/vendorExtensions.x-codegen-response.items.isPrimitiveType}}
|
||||
}
|
||||
{{/isMapContainer}}{{^isMapContainer}}{{#vendorExtensions.x-codegen-response.isPrimitiveType}}result = ModelBase::{{vendorExtensions.x-codegen-response.items.datatype}}FromJson(json);
|
||||
{{/vendorExtensions.x-codegen-response.isPrimitiveType}}{{^vendorExtensions.x-codegen-response.isPrimitiveType}}{{#vendorExtensions.x-codegen-response.isString}}result = ModelBase::stringFromJson(json);
|
||||
{{/isMapContainer}}{{^isMapContainer}}{{#vendorExtensions.x-codegen-response.isPrimitiveType}}{{#vendorExtensions.x-codegen-response.items.datatype}}result = ModelBase::{{vendorExtensions.x-codegen-response.items.datatype}}FromJson(json);
|
||||
{{/vendorExtensions.x-codegen-response.items.datatype}}{{^vendorExtensions.x-codegen-response.items.datatype}}result = ModelBase::{{vendorExtensions.x-codegen-response.datatype}}FromJson(json);
|
||||
{{/vendorExtensions.x-codegen-response.items.datatype}}{{/vendorExtensions.x-codegen-response.isPrimitiveType}}{{^vendorExtensions.x-codegen-response.isPrimitiveType}}{{#vendorExtensions.x-codegen-response.isString}}result = ModelBase::stringFromJson(json);
|
||||
{{/vendorExtensions.x-codegen-response.isString}}{{^vendorExtensions.x-codegen-response.isString}}result->fromJson(json);{{/vendorExtensions.x-codegen-response.isString}}{{/vendorExtensions.x-codegen-response.isPrimitiveType}}{{/isMapContainer}}{{/isListContainer}}
|
||||
}{{#vendorExtensions.x-codegen-response.isString}}
|
||||
else if(responseHttpContentType == utility::conversions::to_string_t("text/plain"))
|
||||
|
@ -40,20 +40,8 @@ public:
|
||||
static utility::string_t parameterToString(int64_t value);
|
||||
static utility::string_t parameterToString(float value);
|
||||
static utility::string_t parameterToString(const utility::datetime &value);
|
||||
|
||||
template<class T>
|
||||
static utility::string_t parameterToArrayString(std::vector<T> value)
|
||||
{
|
||||
utility::stringstream_t ss;
|
||||
|
||||
for( size_t i = 0; i < value.size(); i++)
|
||||
{
|
||||
if( i > 0) ss << utility::conversions::to_string_t(", ");
|
||||
ss << ApiClient::parameterToString(value[i]);
|
||||
}
|
||||
|
||||
return ss.str();
|
||||
}
|
||||
static utility::string_t parameterToString(const std::vector<T>& value);
|
||||
|
||||
pplx::task<web::http::http_response> callApi(
|
||||
const utility::string_t& path,
|
||||
@ -71,6 +59,20 @@ protected:
|
||||
std::shared_ptr<ApiConfiguration> m_Configuration;
|
||||
};
|
||||
|
||||
template<class T>
|
||||
utility::string_t ApiClient::parameterToString(const std::vector<T>& value)
|
||||
{
|
||||
utility::stringstream_t ss;
|
||||
|
||||
for( size_t i = 0; i < value.size(); i++)
|
||||
{
|
||||
if( i > 0) ss << utility::conversions::to_string_t(", ");
|
||||
ss << ApiClient::parameterToString(value[i]);
|
||||
}
|
||||
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
{{#apiNamespaceDeclarations}}
|
||||
}
|
||||
{{/apiNamespaceDeclarations}}
|
||||
|
@ -15,6 +15,8 @@
|
||||
#include <cpprest/details/basic_types.h>
|
||||
#include <cpprest/json.h>
|
||||
|
||||
#include <vector>
|
||||
|
||||
{{#modelNamespaceDeclarations}}
|
||||
namespace {{this}} {
|
||||
{{/modelNamespaceDeclarations}}
|
||||
@ -41,6 +43,8 @@ public:
|
||||
static web::json::value toJson( int64_t value );
|
||||
static web::json::value toJson( double value );
|
||||
static web::json::value toJson( bool value );
|
||||
template<class T>
|
||||
static web::json::value toJson(const std::vector<T>& value);
|
||||
|
||||
static int64_t int64_tFromJson(web::json::value& val);
|
||||
static int32_t int32_tFromJson(web::json::value& val);
|
||||
@ -58,6 +62,8 @@ public:
|
||||
static std::shared_ptr<HttpContent> toHttpContent( const utility::string_t& name, int32_t value, const utility::string_t& contentType = utility::conversions::to_string_t("") );
|
||||
static std::shared_ptr<HttpContent> toHttpContent( const utility::string_t& name, int64_t value, const utility::string_t& contentType = utility::conversions::to_string_t("") );
|
||||
static std::shared_ptr<HttpContent> toHttpContent( const utility::string_t& name, double value, const utility::string_t& contentType = utility::conversions::to_string_t("") );
|
||||
template <class T>
|
||||
static std::shared_ptr<HttpContent> toHttpContent( const utility::string_t& name, const std::vector<T>& value, const utility::string_t& contentType = utility::conversions::to_string_t("") );
|
||||
|
||||
static int64_t int64_tFromHttpContent(std::shared_ptr<HttpContent> val);
|
||||
static int32_t int32_tFromHttpContent(std::shared_ptr<HttpContent> val);
|
||||
@ -74,6 +80,27 @@ public:
|
||||
static std::shared_ptr<std::istream> fromBase64( const utility::string_t& encoded );
|
||||
};
|
||||
|
||||
template<class T>
|
||||
web::json::value ModelBase::toJson(const std::vector<T>& value) {
|
||||
std::vector<web::json::value> ret;
|
||||
for (auto& x : value) {
|
||||
ret.push_back(toJson(x));
|
||||
}
|
||||
|
||||
return web::json::value::array(ret);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
std::shared_ptr<HttpContent> ModelBase::toHttpContent( const utility::string_t& name, const std::vector<T>& value, const utility::string_t& contentType ) {
|
||||
web::json::value json_array = ModelBase::toJson(value);
|
||||
std::shared_ptr<HttpContent> content( new HttpContent );
|
||||
content->setName( name );
|
||||
content->setContentDisposition( utility::conversions::to_string_t("form-data") );
|
||||
content->setContentType( contentType );
|
||||
content->setData( std::shared_ptr<std::istream>( new std::stringstream( utility::conversions::to_utf8string(json_array.serialize()) ) ) );
|
||||
return content;
|
||||
}
|
||||
|
||||
{{#modelNamespaceDeclarations}}
|
||||
}
|
||||
{{/modelNamespaceDeclarations}}
|
||||
|
@ -1 +1 @@
|
||||
2.3.0-SNAPSHOT
|
||||
2.4.0-SNAPSHOT
|
@ -5,7 +5,7 @@
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
@ -5,7 +5,7 @@
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
@ -52,20 +52,8 @@ public:
|
||||
static utility::string_t parameterToString(int64_t value);
|
||||
static utility::string_t parameterToString(float value);
|
||||
static utility::string_t parameterToString(const utility::datetime &value);
|
||||
|
||||
template<class T>
|
||||
static utility::string_t parameterToArrayString(std::vector<T> value)
|
||||
{
|
||||
utility::stringstream_t ss;
|
||||
|
||||
for( size_t i = 0; i < value.size(); i++)
|
||||
{
|
||||
if( i > 0) ss << utility::conversions::to_string_t(", ");
|
||||
ss << ApiClient::parameterToString(value[i]);
|
||||
}
|
||||
|
||||
return ss.str();
|
||||
}
|
||||
static utility::string_t parameterToString(const std::vector<T>& value);
|
||||
|
||||
pplx::task<web::http::http_response> callApi(
|
||||
const utility::string_t& path,
|
||||
@ -83,6 +71,20 @@ protected:
|
||||
std::shared_ptr<ApiConfiguration> m_Configuration;
|
||||
};
|
||||
|
||||
template<class T>
|
||||
utility::string_t ApiClient::parameterToString(const std::vector<T>& value)
|
||||
{
|
||||
utility::stringstream_t ss;
|
||||
|
||||
for( size_t i = 0; i < value.size(); i++)
|
||||
{
|
||||
if( i > 0) ss << utility::conversions::to_string_t(", ");
|
||||
ss << ApiClient::parameterToString(value[i]);
|
||||
}
|
||||
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
@ -5,7 +5,7 @@
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
@ -5,7 +5,7 @@
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
@ -5,7 +5,7 @@
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
@ -5,7 +5,7 @@
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
@ -5,7 +5,7 @@
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
@ -5,7 +5,7 @@
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
@ -5,7 +5,7 @@
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
@ -5,7 +5,7 @@
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
@ -5,7 +5,7 @@
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
@ -5,7 +5,7 @@
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
@ -26,6 +26,8 @@
|
||||
#include <cpprest/details/basic_types.h>
|
||||
#include <cpprest/json.h>
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace io {
|
||||
namespace swagger {
|
||||
namespace client {
|
||||
@ -53,6 +55,8 @@ public:
|
||||
static web::json::value toJson( int64_t value );
|
||||
static web::json::value toJson( double value );
|
||||
static web::json::value toJson( bool value );
|
||||
template<class T>
|
||||
static web::json::value toJson(const std::vector<T>& value);
|
||||
|
||||
static int64_t int64_tFromJson(web::json::value& val);
|
||||
static int32_t int32_tFromJson(web::json::value& val);
|
||||
@ -70,6 +74,8 @@ public:
|
||||
static std::shared_ptr<HttpContent> toHttpContent( const utility::string_t& name, int32_t value, const utility::string_t& contentType = utility::conversions::to_string_t("") );
|
||||
static std::shared_ptr<HttpContent> toHttpContent( const utility::string_t& name, int64_t value, const utility::string_t& contentType = utility::conversions::to_string_t("") );
|
||||
static std::shared_ptr<HttpContent> toHttpContent( const utility::string_t& name, double value, const utility::string_t& contentType = utility::conversions::to_string_t("") );
|
||||
template <class T>
|
||||
static std::shared_ptr<HttpContent> toHttpContent( const utility::string_t& name, const std::vector<T>& value, const utility::string_t& contentType = utility::conversions::to_string_t("") );
|
||||
|
||||
static int64_t int64_tFromHttpContent(std::shared_ptr<HttpContent> val);
|
||||
static int32_t int32_tFromHttpContent(std::shared_ptr<HttpContent> val);
|
||||
@ -86,6 +92,27 @@ public:
|
||||
static std::shared_ptr<std::istream> fromBase64( const utility::string_t& encoded );
|
||||
};
|
||||
|
||||
template<class T>
|
||||
web::json::value ModelBase::toJson(const std::vector<T>& value) {
|
||||
std::vector<web::json::value> ret;
|
||||
for (auto& x : value) {
|
||||
ret.push_back(toJson(x));
|
||||
}
|
||||
|
||||
return web::json::value::array(ret);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
std::shared_ptr<HttpContent> ModelBase::toHttpContent( const utility::string_t& name, const std::vector<T>& value, const utility::string_t& contentType ) {
|
||||
web::json::value json_array = ModelBase::toJson(value);
|
||||
std::shared_ptr<HttpContent> content( new HttpContent );
|
||||
content->setName( name );
|
||||
content->setContentDisposition( utility::conversions::to_string_t("form-data") );
|
||||
content->setContentType( contentType );
|
||||
content->setData( std::shared_ptr<std::istream>( new std::stringstream( utility::conversions::to_utf8string(json_array.serialize()) ) ) );
|
||||
return content;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
@ -5,7 +5,7 @@
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
@ -5,7 +5,7 @@
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
@ -5,7 +5,7 @@
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
@ -16,8 +16,8 @@
|
||||
* This is the implementation of a JSON object.
|
||||
*/
|
||||
|
||||
#ifndef _Object_H_
|
||||
#define _Object_H_
|
||||
#ifndef IO_SWAGGER_CLIENT_MODEL_Object_H_
|
||||
#define IO_SWAGGER_CLIENT_MODEL_Object_H_
|
||||
|
||||
|
||||
#include "ModelBase.h"
|
||||
@ -60,4 +60,4 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* _Object_H_ */
|
||||
#endif /* IO_SWAGGER_CLIENT_MODEL_Object_H_ */
|
||||
|
@ -5,7 +5,7 @@
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
@ -97,6 +97,7 @@ pplx::task<void> PetApi::addPet(std::shared_ptr<Pet> body)
|
||||
web::json::value json;
|
||||
|
||||
json = ModelBase::toJson(body);
|
||||
|
||||
|
||||
httpBody = std::shared_ptr<IHttpBody>( new JsonBody( json ) );
|
||||
}
|
||||
@ -105,7 +106,8 @@ pplx::task<void> PetApi::addPet(std::shared_ptr<Pet> body)
|
||||
{
|
||||
requestHttpContentType = utility::conversions::to_string_t("multipart/form-data");
|
||||
std::shared_ptr<MultipartFormData> multipart(new MultipartFormData);
|
||||
if(body.get())
|
||||
|
||||
if(body.get())
|
||||
{
|
||||
body->toMultipart(multipart, utility::conversions::to_string_t("body"));
|
||||
}
|
||||
@ -301,7 +303,7 @@ pplx::task<std::vector<std::shared_ptr<Pet>>> PetApi::findPetsByStatus(std::vect
|
||||
std::unordered_set<utility::string_t> consumeHttpContentTypes;
|
||||
|
||||
{
|
||||
queryParams[utility::conversions::to_string_t("status")] = ApiClient::parameterToArrayString<utility::string_t>(status);
|
||||
queryParams[utility::conversions::to_string_t("status")] = ApiClient::parameterToString(status);
|
||||
}
|
||||
|
||||
std::shared_ptr<IHttpBody> httpBody;
|
||||
@ -427,7 +429,7 @@ pplx::task<std::vector<std::shared_ptr<Pet>>> PetApi::findPetsByTags(std::vector
|
||||
std::unordered_set<utility::string_t> consumeHttpContentTypes;
|
||||
|
||||
{
|
||||
queryParams[utility::conversions::to_string_t("tags")] = ApiClient::parameterToArrayString<utility::string_t>(tags);
|
||||
queryParams[utility::conversions::to_string_t("tags")] = ApiClient::parameterToString(tags);
|
||||
}
|
||||
|
||||
std::shared_ptr<IHttpBody> httpBody;
|
||||
@ -694,6 +696,7 @@ pplx::task<void> PetApi::updatePet(std::shared_ptr<Pet> body)
|
||||
web::json::value json;
|
||||
|
||||
json = ModelBase::toJson(body);
|
||||
|
||||
|
||||
httpBody = std::shared_ptr<IHttpBody>( new JsonBody( json ) );
|
||||
}
|
||||
@ -702,7 +705,8 @@ pplx::task<void> PetApi::updatePet(std::shared_ptr<Pet> body)
|
||||
{
|
||||
requestHttpContentType = utility::conversions::to_string_t("multipart/form-data");
|
||||
std::shared_ptr<MultipartFormData> multipart(new MultipartFormData);
|
||||
if(body.get())
|
||||
|
||||
if(body.get())
|
||||
{
|
||||
body->toMultipart(multipart, utility::conversions::to_string_t("body"));
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
@ -5,7 +5,7 @@
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
@ -433,6 +433,7 @@ pplx::task<std::shared_ptr<Order>> StoreApi::placeOrder(std::shared_ptr<Order> b
|
||||
web::json::value json;
|
||||
|
||||
json = ModelBase::toJson(body);
|
||||
|
||||
|
||||
httpBody = std::shared_ptr<IHttpBody>( new JsonBody( json ) );
|
||||
}
|
||||
@ -441,7 +442,8 @@ pplx::task<std::shared_ptr<Order>> StoreApi::placeOrder(std::shared_ptr<Order> b
|
||||
{
|
||||
requestHttpContentType = utility::conversions::to_string_t("multipart/form-data");
|
||||
std::shared_ptr<MultipartFormData> multipart(new MultipartFormData);
|
||||
if(body.get())
|
||||
|
||||
if(body.get())
|
||||
{
|
||||
body->toMultipart(multipart, utility::conversions::to_string_t("body"));
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
@ -5,7 +5,7 @@
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
@ -95,6 +95,7 @@ pplx::task<void> UserApi::createUser(std::shared_ptr<User> body)
|
||||
web::json::value json;
|
||||
|
||||
json = ModelBase::toJson(body);
|
||||
|
||||
|
||||
httpBody = std::shared_ptr<IHttpBody>( new JsonBody( json ) );
|
||||
}
|
||||
@ -103,7 +104,8 @@ pplx::task<void> UserApi::createUser(std::shared_ptr<User> body)
|
||||
{
|
||||
requestHttpContentType = utility::conversions::to_string_t("multipart/form-data");
|
||||
std::shared_ptr<MultipartFormData> multipart(new MultipartFormData);
|
||||
if(body.get())
|
||||
|
||||
if(body.get())
|
||||
{
|
||||
body->toMultipart(multipart, utility::conversions::to_string_t("body"));
|
||||
}
|
||||
@ -212,7 +214,7 @@ pplx::task<void> UserApi::createUsersWithArrayInput(std::vector<std::shared_ptr<
|
||||
}
|
||||
json = web::json::value::array(jsonArray);
|
||||
}
|
||||
|
||||
|
||||
httpBody = std::shared_ptr<IHttpBody>( new JsonBody( json ) );
|
||||
}
|
||||
// multipart formdata
|
||||
@ -229,7 +231,7 @@ pplx::task<void> UserApi::createUsersWithArrayInput(std::vector<std::shared_ptr<
|
||||
}
|
||||
multipart->add(ModelBase::toHttpContent(utility::conversions::to_string_t("body"), web::json::value::array(jsonArray), utility::conversions::to_string_t("application/json")));
|
||||
}
|
||||
|
||||
|
||||
httpBody = multipart;
|
||||
requestHttpContentType += utility::conversions::to_string_t("; boundary=") + multipart->getBoundary();
|
||||
}
|
||||
@ -334,7 +336,7 @@ pplx::task<void> UserApi::createUsersWithListInput(std::vector<std::shared_ptr<U
|
||||
}
|
||||
json = web::json::value::array(jsonArray);
|
||||
}
|
||||
|
||||
|
||||
httpBody = std::shared_ptr<IHttpBody>( new JsonBody( json ) );
|
||||
}
|
||||
// multipart formdata
|
||||
@ -351,7 +353,7 @@ pplx::task<void> UserApi::createUsersWithListInput(std::vector<std::shared_ptr<U
|
||||
}
|
||||
multipart->add(ModelBase::toHttpContent(utility::conversions::to_string_t("body"), web::json::value::array(jsonArray), utility::conversions::to_string_t("application/json")));
|
||||
}
|
||||
|
||||
|
||||
httpBody = multipart;
|
||||
requestHttpContentType += utility::conversions::to_string_t("; boundary=") + multipart->getBoundary();
|
||||
}
|
||||
@ -893,6 +895,7 @@ pplx::task<void> UserApi::updateUser(utility::string_t username, std::shared_ptr
|
||||
web::json::value json;
|
||||
|
||||
json = ModelBase::toJson(body);
|
||||
|
||||
|
||||
httpBody = std::shared_ptr<IHttpBody>( new JsonBody( json ) );
|
||||
}
|
||||
@ -901,7 +904,8 @@ pplx::task<void> UserApi::updateUser(utility::string_t username, std::shared_ptr
|
||||
{
|
||||
requestHttpContentType = utility::conversions::to_string_t("multipart/form-data");
|
||||
std::shared_ptr<MultipartFormData> multipart(new MultipartFormData);
|
||||
if(body.get())
|
||||
|
||||
if(body.get())
|
||||
{
|
||||
body->toMultipart(multipart, utility::conversions::to_string_t("body"));
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
@ -36,7 +36,7 @@ git_remote=`git remote`
|
||||
if [ "$git_remote" = "" ]; then # git remote not defined
|
||||
|
||||
if [ "$GIT_TOKEN" = "" ]; then
|
||||
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential in your environment."
|
||||
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
|
||||
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
|
||||
else
|
||||
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
|
||||
|
@ -5,7 +5,7 @@
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
@ -5,7 +5,7 @@
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
@ -5,7 +5,7 @@
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
@ -5,7 +5,7 @@
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
@ -5,7 +5,7 @@
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
@ -5,7 +5,7 @@
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
@ -5,7 +5,7 @@
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
@ -5,7 +5,7 @@
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
@ -5,7 +5,7 @@
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
@ -5,7 +5,7 @@
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
@ -5,7 +5,7 @@
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
@ -5,7 +5,7 @@
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.3.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by the swagger code generator 2.4.0-SNAPSHOT.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user