@@ -90,6 +90,7 @@ public CppRestbedServerCodegen() {
9090 typeMapping .put ("binary" , "restbed::Bytes" );
9191 typeMapping .put ("number" , "double" );
9292 typeMapping .put ("UUID" , "std::string" );
93+ typeMapping .put ("ByteArray" , "std::string" );
9394
9495 super .importMapping = new HashMap <String , String >();
9596 importMapping .put ("std::vector" , "#include <vector>" );
@@ -271,6 +272,8 @@ public String getTypeDeclaration(Schema p) {
271272 } else if (ModelUtils .isMapSchema (p )) {
272273 Schema inner = (Schema ) p .getAdditionalProperties ();
273274 return getSchemaType (p ) + "<std::string, " + getTypeDeclaration (inner ) + ">" ;
275+ } else if (ModelUtils .isByteArraySchema (p )) {
276+ return "std::string" ;
274277 } else if (ModelUtils .isStringSchema (p )
275278 || ModelUtils .isDateSchema (p )
276279 || ModelUtils .isDateTimeSchema (p ) || ModelUtils .isFileSchema (p )
@@ -301,6 +304,8 @@ public String toDefaultValue(Schema p) {
301304 return "0L" ;
302305 }
303306 return "0" ;
307+ } else if (ModelUtils .isByteArraySchema (p )) {
308+ return "\" \" " ;
304309 } else if (ModelUtils .isMapSchema (p )) {
305310 String inner = getSchemaType ((Schema ) p .getAdditionalProperties ());
306311 return "std::map<std::string, " + inner + ">()" ;
0 commit comments