cirruslabs / orchard

Orchestrator for running Tart Virtual Machines on a cluster of Apple Silicon devices
Other
189 stars 13 forks source link

Return '[]' instead of 'null' for /vms query #169

Closed eecsmap closed 3 months ago

eecsmap commented 3 months ago

I just realized when query /vms, and there is no vm created, it returns HTTP code 200 with content 'null' instead of '[]'.

I am curious what is the consideration behind choosing 'null' instead of '[]' when a list of items are expected.

Btw, I am calling it from my Jenkins Plugin which expects a JSONArray object parsed from the content.

Actually the code handle parsing response have a guess on the type to return. If it starts with '{' it returns JSONObject, with '[' a JSONArray. So when it is 'null', it will be hard to guess the type. Before I try to make further change my side. I want to get a better understanding of the content to parse.

Same for the /workers

Many thanks!

eecsmap commented 3 months ago

Thanks for the fix. May I ask, when will it be merged and available?

eecsmap commented 3 months ago

Hi, I know it is merged and 0.18 is released. Yet brew update still provides the old 0.17. When would it be available in homebrew please?

edigaryev commented 3 months ago

Hi, I know it is merged and 0.18 is released. Yet brew update still provides the old 0.17. When would it be available in homebrew please?

Should be good now, thanks for noticing!