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

Metadata

Metadata

Assignees

Labels

testingPackages are available from testing repositories

Type

Projects

Status
Testing

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions