Skip to content

Backup list API returns inconsistent response shape when no backups exist #1855

Description

@Tbaile

Steps to reproduce

  • Register a firewall with the cloud backup service.
  • Ensure the account has zero backups stored remotely.
  • Call:
    api-cli ns.backup registered-list-backups
  • Then create at least one backup and call the same method again.

Expected behavior

values always has the same shape: {"backups": [...]}, whether the list is empty or not.

Actual behavior

When backups exist:

{"values": {"backups": [{"id": "...", "name": "...", "created": ..., "size": ..., "mimetype": "..."}]}}

When no backups exist:

{"values": []}

Callers checking for a backups key (or iterating values.backups) break on the empty case since values is a bare array instead of an object.

Components

ns-api 3.7.1 (ns.backup)
nethsecurity-ui 2.23.2

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    verifiedAll test cases were verified successfully

    Type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions