-
Notifications
You must be signed in to change notification settings - Fork 137
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
Add GroupService to v2 APIs #4807
Conversation
Many error messages reported by REST APIs are localised, but there is no translation. Since REST APIs are not intended for direct user interaction but for software clients, I think we should remove the support to locale. The client should provide the appropriate message to the user. As an alternative, we could have a list of error codes associated with HTTP status which should provide hint of the problem for the client to handle/show correctly. |
887c01c
to
e8716b3
Compare
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, feel free to merge.
About removing locale, I think sometimes we generate messages (e.g. error messages) on the server, then return it to the client (e.g. Web UI, CLI), then the client will display it to the user, so ideally the message should be localized based on the client's locale. At this point it's unlikely that we'll be able to provide translations, but IIUC the locale might also affect other things such as date format. I don't have objection, but I think we should discuss with the team to make sure if we won't introduce issues if we remove it.
Alternatively, we can replace
we'll just do this:
|
I do not like to use the HttpServletRequest because I was thinking the class implementing the operations should be independent of the API layer. For the locale, in the API I do not think it is used for the log otherwise you get messages in different languages depending to the user. There is some usage in the log anyway but it is not everywhere. In the future, and if there is capacity, it should be evaluated and added or removed for all the logs. For the APIs I still think that a error code would be more precise and the message for the user should be generated by the client. However, this has to be discussed and considered in future. Maybe we can take in account this if/when clients will be updated. |
@edewata Thanks, I am merging but we can continue the discussion. |
No description provided.