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

Tweak healthcheck response body #9

Merged
merged 1 commit into from
Aug 10, 2020

Conversation

rohanpm
Copy link
Member

@rohanpm rohanpm commented Aug 7, 2020

We want to give some simple static response here, but {"200": "OK"}
isn't ideal. The response status is meant to be communicated in the
HTTP status code. Embedding in the response body as well encourages
callers to wrongly ignore the HTTP code and opens the possibility
that the two codes might not match.

Let's use the same response model as FastAPI uses by default for
errors, which is:

  • no embedded response code
  • a "detail" attribute with human-oriented text

This isn't a big deal since this is mainly for internal use, but
let's get it right before adding other APIs.

We want to give some simple static response here, but {"200": "OK"}
isn't ideal. The response status is meant to be communicated in the
HTTP status code. Embedding in the response body as well encourages
callers to wrongly ignore the HTTP code and opens the possibility
that the two codes might not match.

Let's use the same response model as FastAPI uses by default for
errors, which is:

- no embedded response code
- a "detail" attribute with human-oriented text

This isn't a big deal since this is mainly for internal use, but
let's get it right before adding other APIs.
@rohanpm rohanpm marked this pull request as ready for review August 7, 2020 04:20
@rohanpm rohanpm requested a review from lmilbaum August 7, 2020 04:20
@rohanpm rohanpm merged commit 9093894 into release-engineering:master Aug 10, 2020
@rohanpm rohanpm deleted the healthcheck-response branch August 10, 2020 22:50
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

3 participants