@@ -483,19 +483,6 @@ def oauth2_redirect():
483483 body = html )
484484
485485
486- def validate_repository_search (entity_type : EntityType , params : Mapping [str , str ]):
487- validate_params (params ,
488- catalog = validate_catalog ,
489- filters = validate_filters ,
490- order = validate_order ,
491- search_after = partial (validate_json_param , 'search_after' ),
492- search_after_uid = str ,
493- search_before = partial (validate_json_param , 'search_before' ),
494- search_before_uid = str ,
495- size = partial (validate_size , entity_type ),
496- sort = validate_field )
497-
498-
499486def validate_entity_type (entity_type : str ):
500487 entity_types = app .metadata_plugin .exposed_indices .keys ()
501488 if entity_type not in entity_types :
@@ -990,7 +977,16 @@ def repository_search(entity_type: str, entity_id: str | None = None) -> JSON:
990977 request = app .current_request
991978 query_params = request .query_params or {}
992979 _hoist_parameters (query_params , request )
993- validate_repository_search (entity_type , query_params )
980+ validate_params (query_params ,
981+ catalog = validate_catalog ,
982+ filters = validate_filters ,
983+ order = validate_order ,
984+ search_after = partial (validate_json_param , 'search_after' ),
985+ search_after_uid = str ,
986+ search_before = partial (validate_json_param , 'search_before' ),
987+ search_before_uid = str ,
988+ size = partial (validate_size , entity_type ),
989+ sort = validate_field )
994990 validate_entity_type (entity_type )
995991 return app .repository_controller .search (catalog = app .catalog ,
996992 entity_type = entity_type ,
0 commit comments