REST API should not return voided data or retired metadata by default

Hello all–

GET calls to the REST API should not include voided or retired objects by default, correct?

I just found two cases, with programs and patient programs, where this appears not to be the case:

I feel like I’ve run into this before, so as a heads up, it’s something to look out for, and we probably should have tests for this for all our resources.

Take care, Mark

1 Like

Just a note that is a test, which is executed for all resources, so I’d start from adding an additional assert there that there are no retired items included.

1 Like

This is correct. Returning invalid results by default is one of the regrets for the API and in our hopes to address for API 2.0. We figured we could at least correct this mistake in the REST API. Unfortunately, the precedent in the original API probably trains devs to think this is appropriate.

Maybe we can fix it in the core API in 3.0? :slight_smile:

This is an excellent suggestion. I would do it for both retired & voided resources if we can.