hashicorp / hashicorp/consul

/v1/catalog/service/:service_name 404

Open
#20,791 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
30.1k
Forks
4.6k
Avg merge
1d 18h
Merged PRs (30d)
39

Description

#### Feature Description

Return 404 when `service_name` does not exist in catalogue query `/v1/catalog/service/:service_ name`

As of today, consul returns `200` whether the service exists or not — returning an empty result set, `[]`, if the service isn't present

#### Use Case(s)

I want to handle the presence or absence of a service differently, and using the HTTP status code would be easier than matching on an empty result set

Contributor guide

Open the contributing guide

Research direction

Begin by locating the Go implementation of GET /v1/catalog/service/:service_name and tracing how a missing service is handled. Done means an absent service returns HTTP 404 rather than 200 with an empty result set, while an existing service continues to return its catalog response.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api, backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.