Skip to content

Fix MongoDB ObjectID and datetime serialization issues #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 12, 2025

Conversation

FlatBallFlyer
Copy link
Contributor

  • Enable MongoJSONEncoder in server.py to handle MongoDB object serialization
  • Remove unused TestDataJSONEncoder from test_data_routes.py
  • Ensure proper JSON serialization of ObjectIDs and datetime objects
  • Maintain test compatibility by keeping to_dict() methods returning datetime objects
  • All 288 tests passing with 91% code coverage

This fixes serialization errors when MongoDB ObjectIDs and datetime objects are returned in API responses, ensuring proper JSON encoding for all endpoints.

- Enable MongoJSONEncoder in server.py to handle MongoDB object serialization
- Remove unused TestDataJSONEncoder from test_data_routes.py
- Ensure proper JSON serialization of ObjectIDs and datetime objects
- Maintain test compatibility by keeping to_dict() methods returning datetime objects
- All 288 tests passing with 91% code coverage

This fixes serialization errors when MongoDB ObjectIDs and datetime objects
are returned in API responses, ensuring proper JSON encoding for all endpoints.
@FlatBallFlyer FlatBallFlyer merged commit e51f123 into main Jul 12, 2025
@FlatBallFlyer FlatBallFlyer deleted the fix/mongodb-objectid-datetime-serialization branch July 12, 2025 23:36
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