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

chore!: rename the "message" field in API responses to "detail" #705

Merged
merged 2 commits into from
Aug 8, 2023

Conversation

oleobal
Copy link
Collaborator

@oleobal oleobal commented Aug 1, 2023

Description

On error (HTTP 4XX or 5XX), our API's JSON reponses are inconsistent. This is in large part because our own code returns {"message": ...} but DRF returns {"detail": ...}.

This changes all instances were we use message to detail instead (including in non-error responses).

Companion PR: Substra/substra#379

This PR replaces #699, a previous attempt at this

How has this been tested?

I'm not sure how to test this works correctly :)

Checklist

  • changelog was updated with notable changes
  • documentation was updated

Copy link
Contributor

@SdgJlbl SdgJlbl left a comment

Choose a reason for hiding this comment

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

Thanks for the PR

@oleobal
Copy link
Collaborator Author

oleobal commented Aug 2, 2023

/e2e

@Owlfred
Copy link

Owlfred commented Aug 2, 2023

End to end tests: ✔️ SUCCESS

That was easy.

Signed-off-by: Olivier Léobal <olivier.leobal@owkin.com>
@oleobal oleobal merged commit 17bd8f5 into main Aug 8, 2023
6 checks passed
@oleobal oleobal deleted the chore/message-to-detail branch August 8, 2023 10:07
@Milouu Milouu mentioned this pull request Sep 5, 2023
Milouu added a commit that referenced this pull request Sep 7, 2023
### Added

- New `SECRET_KEY` optional environment variable
([#671](#671))
- `/api-token-auth/` and the associated tokens can now be disabled
through the `EXPIRY_TOKEN_ENABLED` environment variable and
`server.allowImplicitLogin` chart value
([#698](#698))
- Tokens issued by `/api-token-auth/` can now be deleted like other API
tokens, through a `DELETE` request on the `/active-api-tokens` endpoint
([#698](#698))

### Changed

- Increase the number of tasks displayable in frontend workflow
[#697](#697)
- BREAKING: Change the format of many API responses from
`{"message":...}` to `{"detail":...}`
([#705](#705))

### Removed

- BREAKING: `SECRET_KEY_PATH` and `SECRET_KEY_LOAD_AND_STORE`
environment variables
([#671](#671))
- Removed logic for storing `SECRET_KEY` at startup, in order to
increase stability; it should be done at a higher level, i.e. the chart
([#671](#671))

## Fixed

- `/api-token-auth/` sometimes handing out tokens that are about to
expire ([#698](#698))

Signed-off-by: Milouu <milan.roustan@owkin.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants