mardi 9 avril 2019

REST GET Design For Optional Feature Param

I have a predictive model that I am wrapping in a REST endpoint. Under the hood, the /forecast endpoint chooses one of hundreds of models to make the prediction based on the GET param feature_name.

We have a use case to get all predictions from all models with a single HTTP request. Should we:

  1. Make feature_name optional, and if nothing is passed, return predictions for all models?
  2. Make users pass a special word like 'all' to feature_name if they want all the predictions?
  3. Maintain two endpoints, forecast and forecast_all?
  4. Something I haven't thought of?

Aucun commentaire:

Enregistrer un commentaire