meshery / meshery

Meshery, the cloud native manager
https://meshery.io
Apache License 2.0
4.97k stars 1.54k forks source link

[server]fix missing services attribute for empty design #10968

Closed MUzairS15 closed 2 weeks ago

MUzairS15 commented 2 weeks ago

Notes for Reviewers The Services struct had omitempty tag because of which if the design was empty, it was not being streamed inside the response.

Signed commits

MUzairS15 commented 2 weeks ago

// @aabidsofi19 @leecalcote

github-actions[bot] commented 2 weeks ago

MUzairS15 commented 2 weeks ago

The services key as you said should be ever present, and this PR ensures this happens. Comparing it with primary constraint not null, if design is empty, it is not that services will be null but an empty object.

skipping/removing the key for empty design makes it difficult to understand whether design is actually empty or have got corrupted.

leecalcote commented 2 weeks ago

The services key as you said should be ever present, and this PR ensures this happens. Comparing it with primary constraint not null, if design is empty, it is not that services will be null but an empty object.

Aha! Ok, that’s very good.