PromptsVault AI is thinking...
Searching the best prompts from our community
Searching the best prompts from our community
Prompts matching the #rest tag
Design clean RESTful APIs. Principles: 1. Use nouns for resources (/users, not /getUsers). 2. HTTP methods: GET (read), POST (create), PUT (update), DELETE (delete). 3. Proper status codes (200 OK, 201 Created, 400 Bad Request, 404 Not Found, 500 Server Error). 4. Versioning (/v1/users). 5. Filtering, sorting, pagination (?page=2&sort=name). 6. HATEOAS (include links to related resources). 7. Consistent naming (camelCase or snake_case). Use JSON. Stateless requests. Authentication with JWT/OAuth. Rate limiting. Comprehensive documentation (OpenAPI/Swagger). Error messages should be helpful.
Document APIs with OpenAPI/Swagger. Structure: 1. OpenAPI specification (YAML/JSON). 2. Paths for endpoints. 3. Request/response schemas. 4. Parameter descriptions. 5. Authentication schemes. 6. Example requests/responses. 7. Error codes documentation. 8. Interactive try-it-out. Use Swagger UI for visualization. Generate from code or design-first. Keep docs in sync with implementation.