Last active
September 24, 2024 17:18
-
-
Save aiherrera/3ea9c2152a3748fa26977c87e1b3f6bd to your computer and use it in GitHub Desktop.
Best practices
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Nunca hacer merge directo a main, siempre hacer PRs | |
2. Todos los endpoints deben seguir la siguiente estructura: `http://localhost:8000/api/v1/....` | |
3. Todas las respuestas debe seguir la siguiente estructura: | |
// Example returning data(Listing) | |
{ | |
"status": 200, | |
"data": { | |
[ | |
{ | |
"name": "Euro", | |
"abbreviation": "EUR", | |
"id": 1 | |
} | |
] | |
} | |
} | |
// Example returning data(One record) | |
{ | |
"status": 200, | |
"data": { | |
{ | |
"name": "Euro", | |
"abbreviation": "EUR", | |
"id": 1 | |
} | |
} | |
} | |
// Example returning a message | |
{ | |
"status": 200, | |
"data": { | |
"message": "Created successfully" | |
} | |
} | |
// Example returning a 422 Unprocessable Entity error | |
{ | |
"status": 422, | |
"error": { | |
"message": "Field name should be a string", | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment