posit-dev / publisher

MIT License
3 stars 0 forks source link

Fix empty array response for recursive resources #1938

Open dotNomad opened 3 days ago

dotNomad commented 3 days ago

This fixes the case where there are no Deployments or Configurations and the recursive param was passed. In that case the response array was never created and was being encoded to null.

This fixes that by instantiating the response immediately as a variable length slice.

If recursive isn't passed it will be overwritten by readLatestDeploymentFiles

If recursive is passed and nothing is found it will still be an empty []

Intent

Fixes #1937

Type of Change

Directions for Reviewers

Test with deployments/configs, without, and recursively