Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix empty array response for recursive resources #1938

Merged
merged 1 commit into from
Jul 9, 2024
Merged

Conversation

dotNomad
Copy link
Collaborator

@dotNomad dotNomad commented Jul 3, 2024

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

    • Bug Fix
    • New Feature
    • Breaking Change
    • Documentation
    • Refactor
    • Tooling

Directions for Reviewers

Test with deployments/configs, without, and recursively

Copy link
Collaborator

@sagerb sagerb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sagerb sagerb merged commit 2f16ee0 into main Jul 9, 2024
12 checks passed
@sagerb sagerb deleted the dotnomad/slice-fix branch July 9, 2024 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Recursive configurations and deployments GET endpoints return null instead of empty array
2 participants