File tree Expand file tree Collapse file tree
okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client
okhttp-gson/src/main/java/org/openapitools/client
okhttp-gson-oneOf-array/src/main/java/org/openapitools/client
okhttp-gson-oneOf/src/main/java/org/openapitools/client
okhttp-gson-streaming/src/main/java/org/openapitools/client
okhttp-gson-3.1-duplicated-operationid/src/main/java/org/openapitools/client
okhttp-gson-3.1/src/main/java/org/openapitools/client
okhttp-gson-awsv4signature/src/main/java/org/openapitools/client
okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client
okhttp-gson-group-parameter/src/main/java/org/openapitools/client
okhttp-gson-nullable-required/src/main/java/org/openapitools/client
okhttp-gson-parcelableModel/src/main/java/org/openapitools/client
okhttp-gson-swagger1/src/main/java/org/openapitools/client
okhttp-gson-swagger2/src/main/java/org/openapitools/client
wildcard-accept-header/java/src/main/java/org/openapitools/client Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -793,6 +793,32 @@ public String parameterToString(Object param) {
793793 }
794794 }
795795
796+ /**
797+ * Format the given parameter object as an ASCII-safe JSON string.
798+ *
799+ * @param param Parameter
800+ * @return JSON representation of the parameter
801+ */
802+ public String parameterToJsonString (Object param ) {
803+ String json = JSON .serialize (param );
804+ StringBuilder escaped = new StringBuilder (json .length ());
805+
806+ for (int i = 0 ; i < json .length (); i ++) {
807+ char c = json .charAt (i );
808+ if (c >= 0x7f ) {
809+ escaped .append ("\\ u" );
810+ escaped .append (Character .forDigit ((c >> 12 ) & 0xf , 16 ));
811+ escaped .append (Character .forDigit ((c >> 8 ) & 0xf , 16 ));
812+ escaped .append (Character .forDigit ((c >> 4 ) & 0xf , 16 ));
813+ escaped .append (Character .forDigit (c & 0xf , 16 ));
814+ } else {
815+ escaped .append (c );
816+ }
817+ }
818+
819+ return escaped .toString ();
820+ }
821+
796822 /**
797823 * Formats the specified query parameter to a list containing a single {@code Pair} object.
798824 *
Original file line number Diff line number Diff line change @@ -723,6 +723,32 @@ public String parameterToString(Object param) {
723723 }
724724 }
725725
726+ /**
727+ * Format the given parameter object as an ASCII-safe JSON string.
728+ *
729+ * @param param Parameter
730+ * @return JSON representation of the parameter
731+ */
732+ public String parameterToJsonString (Object param ) {
733+ String json = JSON .serialize (param );
734+ StringBuilder escaped = new StringBuilder (json .length ());
735+
736+ for (int i = 0 ; i < json .length (); i ++) {
737+ char c = json .charAt (i );
738+ if (c >= 0x7f ) {
739+ escaped .append ("\\ u" );
740+ escaped .append (Character .forDigit ((c >> 12 ) & 0xf , 16 ));
741+ escaped .append (Character .forDigit ((c >> 8 ) & 0xf , 16 ));
742+ escaped .append (Character .forDigit ((c >> 4 ) & 0xf , 16 ));
743+ escaped .append (Character .forDigit (c & 0xf , 16 ));
744+ } else {
745+ escaped .append (c );
746+ }
747+ }
748+
749+ return escaped .toString ();
750+ }
751+
726752 /**
727753 * Formats the specified query parameter to a list containing a single {@code Pair} object.
728754 *
Original file line number Diff line number Diff line change @@ -697,6 +697,32 @@ public String parameterToString(Object param) {
697697 }
698698 }
699699
700+ /**
701+ * Format the given parameter object as an ASCII-safe JSON string.
702+ *
703+ * @param param Parameter
704+ * @return JSON representation of the parameter
705+ */
706+ public String parameterToJsonString (Object param ) {
707+ String json = JSON .serialize (param );
708+ StringBuilder escaped = new StringBuilder (json .length ());
709+
710+ for (int i = 0 ; i < json .length (); i ++) {
711+ char c = json .charAt (i );
712+ if (c >= 0x7f ) {
713+ escaped .append ("\\ u" );
714+ escaped .append (Character .forDigit ((c >> 12 ) & 0xf , 16 ));
715+ escaped .append (Character .forDigit ((c >> 8 ) & 0xf , 16 ));
716+ escaped .append (Character .forDigit ((c >> 4 ) & 0xf , 16 ));
717+ escaped .append (Character .forDigit (c & 0xf , 16 ));
718+ } else {
719+ escaped .append (c );
720+ }
721+ }
722+
723+ return escaped .toString ();
724+ }
725+
700726 /**
701727 * Formats the specified query parameter to a list containing a single {@code Pair} object.
702728 *
Original file line number Diff line number Diff line change @@ -697,6 +697,32 @@ public String parameterToString(Object param) {
697697 }
698698 }
699699
700+ /**
701+ * Format the given parameter object as an ASCII-safe JSON string.
702+ *
703+ * @param param Parameter
704+ * @return JSON representation of the parameter
705+ */
706+ public String parameterToJsonString (Object param ) {
707+ String json = JSON .serialize (param );
708+ StringBuilder escaped = new StringBuilder (json .length ());
709+
710+ for (int i = 0 ; i < json .length (); i ++) {
711+ char c = json .charAt (i );
712+ if (c >= 0x7f ) {
713+ escaped .append ("\\ u" );
714+ escaped .append (Character .forDigit ((c >> 12 ) & 0xf , 16 ));
715+ escaped .append (Character .forDigit ((c >> 8 ) & 0xf , 16 ));
716+ escaped .append (Character .forDigit ((c >> 4 ) & 0xf , 16 ));
717+ escaped .append (Character .forDigit (c & 0xf , 16 ));
718+ } else {
719+ escaped .append (c );
720+ }
721+ }
722+
723+ return escaped .toString ();
724+ }
725+
700726 /**
701727 * Formats the specified query parameter to a list containing a single {@code Pair} object.
702728 *
Original file line number Diff line number Diff line change @@ -697,6 +697,32 @@ public String parameterToString(Object param) {
697697 }
698698 }
699699
700+ /**
701+ * Format the given parameter object as an ASCII-safe JSON string.
702+ *
703+ * @param param Parameter
704+ * @return JSON representation of the parameter
705+ */
706+ public String parameterToJsonString (Object param ) {
707+ String json = JSON .serialize (param );
708+ StringBuilder escaped = new StringBuilder (json .length ());
709+
710+ for (int i = 0 ; i < json .length (); i ++) {
711+ char c = json .charAt (i );
712+ if (c >= 0x7f ) {
713+ escaped .append ("\\ u" );
714+ escaped .append (Character .forDigit ((c >> 12 ) & 0xf , 16 ));
715+ escaped .append (Character .forDigit ((c >> 8 ) & 0xf , 16 ));
716+ escaped .append (Character .forDigit ((c >> 4 ) & 0xf , 16 ));
717+ escaped .append (Character .forDigit (c & 0xf , 16 ));
718+ } else {
719+ escaped .append (c );
720+ }
721+ }
722+
723+ return escaped .toString ();
724+ }
725+
700726 /**
701727 * Formats the specified query parameter to a list containing a single {@code Pair} object.
702728 *
Original file line number Diff line number Diff line change @@ -793,6 +793,32 @@ public String parameterToString(Object param) {
793793 }
794794 }
795795
796+ /**
797+ * Format the given parameter object as an ASCII-safe JSON string.
798+ *
799+ * @param param Parameter
800+ * @return JSON representation of the parameter
801+ */
802+ public String parameterToJsonString (Object param ) {
803+ String json = JSON .serialize (param );
804+ StringBuilder escaped = new StringBuilder (json .length ());
805+
806+ for (int i = 0 ; i < json .length (); i ++) {
807+ char c = json .charAt (i );
808+ if (c >= 0x7f ) {
809+ escaped .append ("\\ u" );
810+ escaped .append (Character .forDigit ((c >> 12 ) & 0xf , 16 ));
811+ escaped .append (Character .forDigit ((c >> 8 ) & 0xf , 16 ));
812+ escaped .append (Character .forDigit ((c >> 4 ) & 0xf , 16 ));
813+ escaped .append (Character .forDigit (c & 0xf , 16 ));
814+ } else {
815+ escaped .append (c );
816+ }
817+ }
818+
819+ return escaped .toString ();
820+ }
821+
796822 /**
797823 * Formats the specified query parameter to a list containing a single {@code Pair} object.
798824 *
Original file line number Diff line number Diff line change @@ -793,6 +793,32 @@ public String parameterToString(Object param) {
793793 }
794794 }
795795
796+ /**
797+ * Format the given parameter object as an ASCII-safe JSON string.
798+ *
799+ * @param param Parameter
800+ * @return JSON representation of the parameter
801+ */
802+ public String parameterToJsonString (Object param ) {
803+ String json = JSON .serialize (param );
804+ StringBuilder escaped = new StringBuilder (json .length ());
805+
806+ for (int i = 0 ; i < json .length (); i ++) {
807+ char c = json .charAt (i );
808+ if (c >= 0x7f ) {
809+ escaped .append ("\\ u" );
810+ escaped .append (Character .forDigit ((c >> 12 ) & 0xf , 16 ));
811+ escaped .append (Character .forDigit ((c >> 8 ) & 0xf , 16 ));
812+ escaped .append (Character .forDigit ((c >> 4 ) & 0xf , 16 ));
813+ escaped .append (Character .forDigit (c & 0xf , 16 ));
814+ } else {
815+ escaped .append (c );
816+ }
817+ }
818+
819+ return escaped .toString ();
820+ }
821+
796822 /**
797823 * Formats the specified query parameter to a list containing a single {@code Pair} object.
798824 *
Original file line number Diff line number Diff line change @@ -813,6 +813,32 @@ public String parameterToString(Object param) {
813813 }
814814 }
815815
816+ /**
817+ * Format the given parameter object as an ASCII-safe JSON string.
818+ *
819+ * @param param Parameter
820+ * @return JSON representation of the parameter
821+ */
822+ public String parameterToJsonString (Object param ) {
823+ String json = JSON .serialize (param );
824+ StringBuilder escaped = new StringBuilder (json .length ());
825+
826+ for (int i = 0 ; i < json .length (); i ++) {
827+ char c = json .charAt (i );
828+ if (c >= 0x7f ) {
829+ escaped .append ("\\ u" );
830+ escaped .append (Character .forDigit ((c >> 12 ) & 0xf , 16 ));
831+ escaped .append (Character .forDigit ((c >> 8 ) & 0xf , 16 ));
832+ escaped .append (Character .forDigit ((c >> 4 ) & 0xf , 16 ));
833+ escaped .append (Character .forDigit (c & 0xf , 16 ));
834+ } else {
835+ escaped .append (c );
836+ }
837+ }
838+
839+ return escaped .toString ();
840+ }
841+
816842 /**
817843 * Formats the specified query parameter to a list containing a single {@code Pair} object.
818844 *
Original file line number Diff line number Diff line change @@ -810,6 +810,32 @@ public String parameterToString(Object param) {
810810 }
811811 }
812812
813+ /**
814+ * Format the given parameter object as an ASCII-safe JSON string.
815+ *
816+ * @param param Parameter
817+ * @return JSON representation of the parameter
818+ */
819+ public String parameterToJsonString (Object param ) {
820+ String json = JSON .serialize (param );
821+ StringBuilder escaped = new StringBuilder (json .length ());
822+
823+ for (int i = 0 ; i < json .length (); i ++) {
824+ char c = json .charAt (i );
825+ if (c >= 0x7f ) {
826+ escaped .append ("\\ u" );
827+ escaped .append (Character .forDigit ((c >> 12 ) & 0xf , 16 ));
828+ escaped .append (Character .forDigit ((c >> 8 ) & 0xf , 16 ));
829+ escaped .append (Character .forDigit ((c >> 4 ) & 0xf , 16 ));
830+ escaped .append (Character .forDigit (c & 0xf , 16 ));
831+ } else {
832+ escaped .append (c );
833+ }
834+ }
835+
836+ return escaped .toString ();
837+ }
838+
813839 /**
814840 * Formats the specified query parameter to a list containing a single {@code Pair} object.
815841 *
Original file line number Diff line number Diff line change @@ -793,6 +793,32 @@ public String parameterToString(Object param) {
793793 }
794794 }
795795
796+ /**
797+ * Format the given parameter object as an ASCII-safe JSON string.
798+ *
799+ * @param param Parameter
800+ * @return JSON representation of the parameter
801+ */
802+ public String parameterToJsonString (Object param ) {
803+ String json = JSON .serialize (param );
804+ StringBuilder escaped = new StringBuilder (json .length ());
805+
806+ for (int i = 0 ; i < json .length (); i ++) {
807+ char c = json .charAt (i );
808+ if (c >= 0x7f ) {
809+ escaped .append ("\\ u" );
810+ escaped .append (Character .forDigit ((c >> 12 ) & 0xf , 16 ));
811+ escaped .append (Character .forDigit ((c >> 8 ) & 0xf , 16 ));
812+ escaped .append (Character .forDigit ((c >> 4 ) & 0xf , 16 ));
813+ escaped .append (Character .forDigit (c & 0xf , 16 ));
814+ } else {
815+ escaped .append (c );
816+ }
817+ }
818+
819+ return escaped .toString ();
820+ }
821+
796822 /**
797823 * Formats the specified query parameter to a list containing a single {@code Pair} object.
798824 *
You can’t perform that action at this time.
0 commit comments