OHDSI / WebAPI

OHDSI WebAPI contains all OHDSI services that can be called from OHDSI applications
Apache License 2.0
126 stars 156 forks source link

Make it easier to find endpoint implementations in code #2240

Closed chrisknoll closed 1 year ago

chrisknoll commented 1 year ago

Expected behavior

It should be easy to find which class/method is handling a request. For example: return httpService.doGet(config.webAPIRoot + 'cache/clear')

Means that there is an endpoint /WebAPI/cache/clear that will be invoked when that URL is requested. This method is get and we have annotations that mark methods to respond to various HTTP verbs with specified paths.

Actual behavior

Can not easily navigate to the implementation of this endpoint.

Steps to reproduce behavior

  1. Go to source code
  2. Search for "cache" (as the root of the path that the controller should specify). Not found
  3. search for "refresh", find lots of hits, none relating to cache/refresh. Not found
  4. search for cache" (maybe the path starts with /, so exclude the leading ") Not found
  5. Go into netbeans, and look at the rrestful web services (which read the REST annotations and services that expose endpoints:

image

Observe, there are no /cache endpoints displayed.

Our code needs to be easy to navigate, and considering it is simply and application that responds to HTTP requests, it should be extremely easy to find out which method is handling a specific HTTP endpoint.

chrisknoll commented 1 year ago

It appears, in this case, that trying to invoke that endpoint in the UI (the clear server cache button) results in a 404...so the answer here is that we can't find the endpoint in code because it doesn't exist.

Can anyone provide any insight as to why this button in the configuration screen exists, and if there ever was a cache/refresh endpoint?