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

hotfix(db) ensure an empty JSON array is returned when no targets #4058

Merged
merged 1 commit into from
Dec 6, 2018

Conversation

hbagdi
Copy link
Member

@hbagdi hbagdi commented Dec 6, 2018

When an upstream is created and no targets are added, GET /upstreams/:upstream/targets should return an empty data JSON property
in the response as an array.

This change ensure an empty JSON array([]) is returned and not an
empty object({}).

A regression test has been added to ensure we catch this for endpoints:

  • /upstreams/:upstream/targets
  • /upstreams/:upstream/targets/all

Fix #4043

When an upstream is created and no targets are added, `GET
/upstreams/:upstream/targets` should return an empty `data` JSON property
in the response as an array.

This change ensure an empty JSON array(`[]`) is returned and not an
empty object(`{}`).

A regression test has been added to ensure we catch this for endpoints:
- `/upstreams/:upstream/targets`
- `/upstreams/:upstream/targets/all`

Fix Kong#4043
Copy link
Member

@thibaultcha thibaultcha left a comment

Choose a reason for hiding this comment

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

Perfect, thanks!

@thibaultcha thibaultcha merged commit e68d84e into Kong:next Dec 6, 2018
@hbagdi hbagdi deleted the hotfix/targets-empty-array branch December 6, 2018 18:36
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.

None yet

2 participants