@@ -88,6 +88,32 @@ setting binary_output_format to 'UTF-8-LOSSY'."
8888 }
8989}
9090
91+ #[ derive( Debug , Clone , Copy , PartialEq , Eq , Default ) ]
92+ pub enum HttpHandlerDataFormat {
93+ #[ default]
94+ Display ,
95+ Driver ,
96+ }
97+
98+ impl HttpHandlerDataFormat {
99+ pub fn parse ( s : & str ) -> Result < Self , ErrorCode > {
100+ match s. to_ascii_lowercase ( ) . as_str ( ) {
101+ "display" => Ok ( HttpHandlerDataFormat :: Display ) ,
102+ "driver" => Ok ( HttpHandlerDataFormat :: Driver ) ,
103+ other => Err ( ErrorCode :: InvalidArgument ( format ! (
104+ "Invalid http json result mode '{other}', valid values: DISPLAY | DRIVER"
105+ ) ) ) ,
106+ }
107+ }
108+
109+ pub fn as_str ( & self ) -> & ' static str {
110+ match self {
111+ HttpHandlerDataFormat :: Display => "display" ,
112+ HttpHandlerDataFormat :: Driver => "driver" ,
113+ }
114+ }
115+ }
116+
91117#[ derive( Debug , Clone , PartialEq , Eq ) ]
92118pub struct InputFormatSettings {
93119 pub jiff_timezone : TimeZone ,
@@ -116,6 +142,7 @@ pub struct OutputFormatSettings {
116142 pub jiff_timezone : TimeZone ,
117143 pub geometry_format : GeometryDataType ,
118144 pub binary_format : BinaryDisplayFormat ,
145+ pub http_json_result_mode : HttpHandlerDataFormat ,
119146
120147 // used only in http handler response
121148 pub format_null_as_str : bool ,
@@ -127,6 +154,7 @@ impl Default for OutputFormatSettings {
127154 jiff_timezone : TimeZone :: UTC ,
128155 geometry_format : GeometryDataType :: default ( ) ,
129156 binary_format : BinaryDisplayFormat :: Hex ,
157+ http_json_result_mode : HttpHandlerDataFormat :: Display ,
130158 format_null_as_str : false ,
131159 }
132160 }
0 commit comments