fix cpp-restbed-server json field serialization #4320 (#4323)

This commit is contained in:
lwlee2608
2019-11-01 10:56:12 +08:00
committed by William Cheng
parent cf29908ff2
commit a9ea8636e5
21 changed files with 84 additions and 77 deletions

View File

@@ -5,7 +5,7 @@
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.1-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 4.2.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
@@ -47,12 +47,12 @@ std::string Order::toJsonString()
{
std::stringstream ss;
ptree pt;
pt.put("Id", m_Id);
pt.put("PetId", m_PetId);
pt.put("Quantity", m_Quantity);
pt.put("ShipDate", m_ShipDate);
pt.put("Status", m_Status);
pt.put("Complete", m_Complete);
pt.put("id", m_Id);
pt.put("petId", m_PetId);
pt.put("quantity", m_Quantity);
pt.put("shipDate", m_ShipDate);
pt.put("status", m_Status);
pt.put("complete", m_Complete);
write_json(ss, pt, false);
return ss.str();
}
@@ -62,12 +62,12 @@ void Order::fromJsonString(std::string const& jsonString)
std::stringstream ss(jsonString);
ptree pt;
read_json(ss,pt);
m_Id = pt.get("Id", 0L);
m_PetId = pt.get("PetId", 0L);
m_Quantity = pt.get("Quantity", 0);
m_ShipDate = pt.get("ShipDate", "");
m_Status = pt.get("Status", "");
m_Complete = pt.get("Complete", false);
m_Id = pt.get("id", 0L);
m_PetId = pt.get("petId", 0L);
m_Quantity = pt.get("quantity", 0);
m_ShipDate = pt.get("shipDate", "");
m_Status = pt.get("status", "");
m_Complete = pt.get("complete", false);
}
int64_t Order::getId() const