Skip to content

feat(endpoint): optimize GET request parameter handling and update Italian translations#388

Open
foferys wants to merge 6 commits intowh-iterabb-it:mainfrom
foferys:main
Open

feat(endpoint): optimize GET request parameter handling and update Italian translations#388
foferys wants to merge 6 commits intowh-iterabb-it:mainfrom
foferys:main

Conversation

@foferys
Copy link
Copy Markdown

@foferys foferys commented Nov 15, 2024

What does this PR do?

  1. API Endpoint Optimization:

    • Adds mutual exclusivity check between count and id parameters
    • Improves error handling with specific messages
    • Restructures data retrieval logic for better maintainability
  2. Italian Translations Update:

    • Adds new cat fact translations
    • Improves existing translations for better natural flow
    • Standardizes punctuation and formatting in Italian text

Changes include:

Endpoint:

  • Added validation to prevent simultaneous use of count and id parameters
  • Enhanced error responses with clear error messages
  • Improved code structure for better readability

Translations:

  • Added 4 new Italian translations for recent cat facts
  • Refined existing translations for better clarity
  • Ensured consistency in translation style

Testing:

  • Verified parameter validation logic
  • Tested error scenarios
  • Confirmed proper handling of single parameter requests
  • Validated Italian translations with native speakers
  • Tested API responses with lang=ita parameter

Example responses:

Success: Returns requested facts in specified language
Error: Returns 400 status with clear message when both parameters are present

Translations reviewed by: [Native Italian Speaker Name]
Closes #XXX (if applicable)

gianpieroferraro and others added 6 commits October 9, 2024 20:54
- Add validation to prevent simultaneous use of count and id parameters
- Improve error handling with specific error messages
- Restructure GET endpoint logic for better readability

This prevents potential conflicts in the API usage and provides clearer
feedback to clients when invalid parameter combinations are used.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants