Skip to content

Fix: Normalize userId to integer in POST/PUT requestsFix: Normalize userId to integer in POST/PUT requests#217

Open
Tania2607 wants to merge 1 commit intotypicode:masterfrom
Tania2607:fix-userid-type
Open

Fix: Normalize userId to integer in POST/PUT requestsFix: Normalize userId to integer in POST/PUT requests#217
Tania2607 wants to merge 1 commit intotypicode:masterfrom
Tania2607:fix-userid-type

Conversation

@Tania2607
Copy link

@Tania2607 Tania2607 commented Jul 28, 2025

When using the /posts endpoint:

  • GET /posts/1 returns userId as an integer:
    { "userId": 1, ... }

  • POST /posts with userId=1 returns it as a string:
    { "userId": "1", ... }

This causes issues in strictly typed languages like Swift or TypeScript.

Suggested fix: Normalize userId as an integer across all responses.

Fixes: #217

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.

1 participant