forked from loafle/openapi-generator-original
[C++][Restbed/Pistache] Added fix for byte array (#752)
* Added fix for byte array * Fix spacing * Adapted default value for ByteArray * Adapted default value for ByteArray in Pistache Server
This commit is contained in:
@@ -341,7 +341,7 @@ public class CppPistacheServerCodegen extends AbstractCppCodegen {
|
||||
return "0";
|
||||
}
|
||||
else if (ModelUtils.isByteArraySchema(p)) {
|
||||
return "";
|
||||
return "\"\"";
|
||||
} else if (ModelUtils.isMapSchema(p)) {
|
||||
String inner = getSchemaType((Schema) p.getAdditionalProperties());
|
||||
return "std::map<std::string, " + inner + ">()";
|
||||
|
||||
@@ -90,6 +90,7 @@ public class CppRestbedServerCodegen extends AbstractCppCodegen {
|
||||
typeMapping.put("binary", "restbed::Bytes");
|
||||
typeMapping.put("number", "double");
|
||||
typeMapping.put("UUID", "std::string");
|
||||
typeMapping.put("ByteArray", "std::string");
|
||||
|
||||
super.importMapping = new HashMap<String, String>();
|
||||
importMapping.put("std::vector", "#include <vector>");
|
||||
@@ -271,6 +272,8 @@ public class CppRestbedServerCodegen extends AbstractCppCodegen {
|
||||
} else if (ModelUtils.isMapSchema(p)) {
|
||||
Schema inner = (Schema) p.getAdditionalProperties();
|
||||
return getSchemaType(p) + "<std::string, " + getTypeDeclaration(inner) + ">";
|
||||
} else if (ModelUtils.isByteArraySchema(p)) {
|
||||
return "std::string";
|
||||
} else if (ModelUtils.isStringSchema(p)
|
||||
|| ModelUtils.isDateSchema(p)
|
||||
|| ModelUtils.isDateTimeSchema(p) || ModelUtils.isFileSchema(p)
|
||||
@@ -301,6 +304,8 @@ public class CppRestbedServerCodegen extends AbstractCppCodegen {
|
||||
return "0L";
|
||||
}
|
||||
return "0";
|
||||
} else if (ModelUtils.isByteArraySchema(p)) {
|
||||
return "\"\"";
|
||||
} else if (ModelUtils.isMapSchema(p)) {
|
||||
String inner = getSchemaType((Schema) p.getAdditionalProperties());
|
||||
return "std::map<std::string, " + inner + ">()";
|
||||
|
||||
@@ -1 +1 @@
|
||||
3.0.0-SNAPSHOT
|
||||
3.2.1-SNAPSHOT
|
||||
@@ -5,7 +5,7 @@
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.2.1-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.2.1-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.2.1-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.2.1-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.2.1-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.2.1-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.2.1-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.2.1-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.2.1-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.2.1-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.2.1-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.2.1-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.2.1-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.2.1-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.2.1-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.2.1-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.2.1-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.2.1-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user