Suggestion to improve naming convention for clarity in API responses #14145
FaridAmroun
started this conversation in
Ideas and feature requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi
In the current API responses for consumers (and potentially other endpoints), the field 'id' represents a UUID. However, its naming doesn't explicitly reflect its nature, which may lead to confusion for developers consuming the API.
Example for current response:
{
"id": "bb1bcb0c-878d-4135-a298-1723f1af36dc",
"username": "flask_client",
"created_ad" : 1736447804,
"updated_at": 1736447804,
}
Suggested Improvement:
Rename the "id " field to UUID (or a similar name) to better represent its format and purpose.
Proposed response:
{
"UUID": "bb1bcb0c-878d-4135-a298-1723f1af36dc",
"username": "flask_client",
"created_ad" : 1736447804,
"updated_at": 1736447804,
}
Benefits:
1- Enhance clarity for developers consuming the API by explicitly indicating that the field represents a UUID.
2- Aligns field naming conventions with the actual format and purpose of the value.
3- Improves usability, especially for new developers onboarding to the API.
Step to implement:
1- Identify all API responses where the "id" field represents a UUID
2- Update the field name in these responses to UUID or a similarly descriptive name.
3- Adjust the relevant documentation to reflect the changes.
Additional notes:
This is a non-breaking change if implemented with backward compatibility (e.g., supporting both id and UUID for a transition period).
Looking forward to feedback and discussion!
F.Amroun
Beta Was this translation helpful? Give feedback.
All reactions