4343)
4444def allowed_files () -> flask .Response :
4545 utils_functions .validate_request (flask .request , schemas_dict ["allowed_files" ])
46- params = schemas .AllowedFiles .from_dict (flask .request .get_json ())
4746 extensions : set [str ] = set ()
4847 for geode_object in geode_objects .values ():
4948 for extension in geode_object .input_extensions ():
@@ -71,8 +70,8 @@ def upload_file() -> flask.Response:
7170 methods = schemas_dict ["allowed_objects" ]["methods" ],
7271)
7372def allowed_objects () -> flask .Response :
74- utils_functions .validate_request (flask .request , schemas_dict ["allowed_objects" ])
75- params = schemas .AllowedObjects .from_dict (flask . request . get_json () )
73+ json_data = utils_functions .validate_request (flask .request , schemas_dict ["allowed_objects" ])
74+ params = schemas .AllowedObjects .from_dict (json_data )
7675 file_absolute_path = geode_functions .upload_file_path (params .filename )
7776 file_extension = utils_functions .extension_from_filename (
7877 os .path .basename (file_absolute_path )
@@ -95,8 +94,8 @@ def allowed_objects() -> flask.Response:
9594 methods = schemas_dict ["missing_files" ]["methods" ],
9695)
9796def missing_files () -> flask .Response :
98- utils_functions .validate_request (flask .request , schemas_dict ["missing_files" ])
99- params = schemas .MissingFiles .from_dict (flask . request . get_json () )
97+ json_data = utils_functions .validate_request (flask .request , schemas_dict ["missing_files" ])
98+ params = schemas .MissingFiles .from_dict (json_data )
10099 file_path = geode_functions .upload_file_path (params .filename )
101100 geode_object = geode_functions .geode_object_from_string (params .geode_object_type )
102101 additional_files = geode_object .additional_files (
@@ -132,10 +131,10 @@ def missing_files() -> flask.Response:
132131 methods = schemas_dict ["geographic_coordinate_systems" ]["methods" ],
133132)
134133def crs_converter_geographic_coordinate_systems () -> flask .Response :
135- utils_functions .validate_request (
134+ json_data = utils_functions .validate_request (
136135 flask .request , schemas_dict ["geographic_coordinate_systems" ]
137136 )
138- params = schemas .GeographicCoordinateSystems .from_dict (flask . request . get_json () )
137+ params = schemas .GeographicCoordinateSystems .from_dict (json_data )
139138 geode_object = geode_functions .geode_object_from_string (params .geode_object_type )
140139 infos = (
141140 og_geosciences .GeographicCoordinateSystem3D .geographic_coordinate_systems ()
@@ -157,8 +156,8 @@ def crs_converter_geographic_coordinate_systems() -> flask.Response:
157156 methods = schemas_dict ["inspect_file" ]["methods" ],
158157)
159158def inspect_file () -> flask .Response :
160- utils_functions .validate_request (flask .request , schemas_dict ["inspect_file" ])
161- params = schemas .InspectFile .from_dict (flask . request . get_json () )
159+ json_data = utils_functions .validate_request (flask .request , schemas_dict ["inspect_file" ])
160+ params = schemas .InspectFile .from_dict (json_data )
162161 file_path = geode_functions .upload_file_path (params .filename )
163162 geode_object = geode_functions .geode_object_from_string (
164163 params .geode_object_type
@@ -201,10 +200,10 @@ def extract_inspector_result(inspection_data: Any) -> object:
201200 methods = schemas_dict ["geode_objects_and_output_extensions" ]["methods" ],
202201)
203202def geode_objects_and_output_extensions () -> flask .Response :
204- utils_functions .validate_request (
203+ json_data = utils_functions .validate_request (
205204 flask .request , schemas_dict ["geode_objects_and_output_extensions" ]
206205 )
207- params = schemas .GeodeObjectsAndOutputExtensions .from_dict (flask . request . get_json () )
206+ params = schemas .GeodeObjectsAndOutputExtensions .from_dict (json_data )
208207 file_path = geode_functions .upload_file_path (params .filename )
209208 geode_object = geode_functions .geode_object_from_string (
210209 params .geode_object_type
@@ -223,8 +222,8 @@ def geode_objects_and_output_extensions() -> flask.Response:
223222 methods = schemas_dict ["save_viewable_file" ]["methods" ],
224223)
225224def save_viewable_file () -> flask .Response :
226- utils_functions .validate_request (flask .request , schemas_dict ["save_viewable_file" ])
227- params = schemas .SaveViewableFile .from_dict (flask . request . get_json () )
225+ json_data = utils_functions .validate_request (flask .request , schemas_dict ["save_viewable_file" ])
226+ params = schemas .SaveViewableFile .from_dict (json_data )
228227 return flask .make_response (
229228 utils_functions .generate_native_viewable_and_light_viewable_from_file (
230229 geode_object_type = geode_object_type (params .geode_object_type ),
@@ -239,8 +238,8 @@ def save_viewable_file() -> flask.Response:
239238 methods = schemas_dict ["texture_coordinates" ]["methods" ],
240239)
241240def texture_coordinates () -> flask .Response :
242- utils_functions .validate_request (flask .request , schemas_dict ["texture_coordinates" ])
243- params = schemas .TextureCoordinates .from_dict (flask . request . get_json () )
241+ json_data = utils_functions .validate_request (flask .request , schemas_dict ["texture_coordinates" ])
242+ params = schemas .TextureCoordinates .from_dict (json_data )
244243 geode_object = geode_functions .load_geode_object (params .id )
245244 if not isinstance (geode_object , GeodeSurfaceMesh2D | GeodeSurfaceMesh3D ):
246245 flask .abort (500 , f"{ params .id } is not a GeodeSurfaceMesh" )
@@ -253,10 +252,10 @@ def texture_coordinates() -> flask.Response:
253252 methods = schemas_dict ["vertex_attribute_names" ]["methods" ],
254253)
255254def vertex_attribute_names () -> flask .Response :
256- utils_functions .validate_request (
255+ json_data = utils_functions .validate_request (
257256 flask .request , schemas_dict ["vertex_attribute_names" ]
258257 )
259- params = schemas .VertexAttributeNames .from_dict (flask . request . get_json () )
258+ params = schemas .VertexAttributeNames .from_dict (json_data )
260259 geode_object = geode_functions .load_geode_object (params .id )
261260 if not isinstance (geode_object , GeodeMesh ):
262261 flask .abort (500 , f"{ params .id } is not a GeodeMesh" )
@@ -274,10 +273,10 @@ def vertex_attribute_names() -> flask.Response:
274273 methods = schemas_dict ["polygon_attribute_names" ]["methods" ],
275274)
276275def polygon_attribute_names () -> flask .Response :
277- utils_functions .validate_request (
276+ json_data = utils_functions .validate_request (
278277 flask .request , schemas_dict ["polygon_attribute_names" ]
279278 )
280- params = schemas .PolygonAttributeNames .from_dict (flask . request . get_json () )
279+ params = schemas .PolygonAttributeNames .from_dict (json_data )
281280 geode_object = geode_functions .load_geode_object (params .id )
282281 if not isinstance (geode_object , GeodeSurfaceMesh2D | GeodeSurfaceMesh3D ):
283282 flask .abort (500 , f"{ params .id } is not a GeodeSurfaceMesh" )
@@ -295,10 +294,10 @@ def polygon_attribute_names() -> flask.Response:
295294 methods = schemas_dict ["polyhedron_attribute_names" ]["methods" ],
296295)
297296def polyhedron_attribute_names () -> flask .Response :
298- utils_functions .validate_request (
297+ json_data = utils_functions .validate_request (
299298 flask .request , schemas_dict ["polyhedron_attribute_names" ]
300299 )
301- params = schemas .PolyhedronAttributeNames .from_dict (flask . request . get_json () )
300+ params = schemas .PolyhedronAttributeNames .from_dict (json_data )
302301 geode_object = geode_functions .load_geode_object (params .id )
303302 if not isinstance (geode_object , GeodeSolidMesh3D ):
304303 flask .abort (500 , f"{ params .id } is not a GeodeSolidMesh" )
@@ -335,8 +334,8 @@ def kill() -> flask.Response:
335334 methods = schemas_dict ["export_project" ]["methods" ],
336335)
337336def export_project () -> flask .Response :
338- utils_functions .validate_request (flask .request , schemas_dict ["export_project" ])
339- params = schemas .ExportProject .from_dict (flask . request . get_json () )
337+ json_data = utils_functions .validate_request (flask .request , schemas_dict ["export_project" ])
338+ params = schemas .ExportProject .from_dict (json_data )
340339
341340 project_folder : str = flask .current_app .config ["DATA_FOLDER_PATH" ]
342341 os .makedirs (project_folder , exist_ok = True )
0 commit comments