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

use empty slice instead of nil slice when no tags exist for /v1/catalog/services #145

Merged
merged 1 commit into from
May 19, 2014
Merged

Conversation

abursavich
Copy link
Contributor

the docs for /v1/catalog/services show that the result should be like:

{
    "consul": [],
    "redis": [],
    "postgresql": [
        "master",
        "slave"
    ]
}

but it was actually like:

{
    "consul": null,
    "redis": null,
    "postgresql": [
        "master",
        "slave"
    ]
}

however, other endpoints (/v1/catalog/service/<service> and /v1/catalog/node/<node>) are documented to and actually return nulls for empty tags. for consistency, maybe it makes more sense to update the docs for /v1/catalog/services to reflect the current behavior?

@abursavich
Copy link
Contributor Author

my point about consistency doesn't quite hold up. it depends on how you configure the service. for the other endpoints mentioned, they will show null if the tags were not configured. but they will show an empty array if the tags were explicitly configured as such.

@armon
Copy link
Member

armon commented May 19, 2014

Thanks!

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.

2 participants