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

Projects
None yet
2 participants
@hbagdi
Copy link
Member

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

hotfix(db) ensure an empty JSON array is returned when no targets
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
@thibaultcha
Copy link
Member

left a comment

Perfect, thanks!

@thibaultcha thibaultcha merged commit e68d84e into Kong:next Dec 6, 2018

1 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build failed
Details
license/cla All CLA requirements met.

@hbagdi hbagdi deleted the hbagdi:hotfix/targets-empty-array branch Dec 6, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.