As I mentioned I have written some code which allows for auto generation of OpenAPI Calls based of ad_proc documentation.
The idea is that you use ad_proc to define the endpoint and the objects to be used in the endpoint and let the openapi generator then generate the OpenAPI code and use that e.g. in SwaggerUI to access the endpoint.
If someone is interested I am more than willing to give a demo to get feedback what I actually need to do in order to export the code for use as an OpenACS Package by others.
To give you an idea, here is an example
namespace eval cog_rest::json_object {
ad_proc -public search_result {} {
@return object json_object cognovis_object The object of the search result
@return search_text string Text we display for the search result
@return actions json_array webix_notification_action Actions for the notification
@return sort_order integer order by which to order the search result
} -
}
ad_proc cog_rest::get::webix_search {
-rest_user_id:required
-query:required
{-object_type ""}
} {
@param query string String which we are querying for
@return search_results json_array search_result Results which match the query and for which the current user has access
} {
set query [string tolower $query]
regsub -all {["']} $query {} query
# Remove accents and other special characters from search query
# set query [db_exec_plsql normalize "select norm_text(:query)"]
set search_results [list]
if {$object_type eq ""} {
set object_types [list "im_project" "im_company" "person" "im_invoice"]
} else {
set object_types $object_type
}
foreach object_type $object_types {
set search_results [concat $search_results [webix::search::${object_type} -query $query -rest_user_id $rest_user_id]]
}
return [cog_rest::json_response]
}