-
-
Notifications
You must be signed in to change notification settings - Fork 521
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
Datetime fields are not serialized by .into_json() on queries #530
Comments
Hey @e-rhodes, sorry for the delay. Thanks for providing a minimal reproducible example! Please check #539 for the fix. |
Been using this branch with no issues---nice work! Will it be merged into master sometime soon or is this waiting for a 0.7 release? |
Please merge. It's a blocker. Also, UUID is not converting when using into_json. This is a wonderful library and works very well with some patience. I think adding more examples in documentation will make it easier to use. |
We will release it on |
Hey @yashsamit, thanks for the support! Do you have any suggestions on what to add? In terms of examples and documentations? |
Description
When using the
.into_json()
method to load the result of a query into aJsonValue
object, the resulting JSON is missing any date/datetime fields (chronoDate
/DateTime<Tz>
objects) that were present in the model.Steps to Reproduce
.into_json()
on the result.Expected Behavior
The JsonValue object will include String representations of datetimes in YYYY-MM-DDTHH:MM:SSZ (or similar) format, as is the result of serializing the model with
serde_json::json!()
.Actual Behavior
The resulting JsonValue has the correct structure, but any date or datetime fields are missing.
Reproduces How Often
Every time.
Versions
├── sea-orm v0.6.0
│ ├── sea-orm-macros v0.6.0 (proc-macro)
│ ├── sea-query v0.21.0
│ │ ├── sea-query-derive v0.2.0 (proc-macro)
│ ├── sea-strum v0.23.0
│ │ └── sea-strum_macros v0.23.0 (proc-macro)
│ ├── sqlx v0.5.10
│ │ ├── sqlx-core v0.5.10
│ │ │ ├── sqlformat v0.1.8
│ │ │ ├── sqlx-rt v0.5.10
│ │ └── sqlx-macros v0.5.10 (proc-macro)
│ │ ├── sqlx-core v0.5.10 (*)
│ │ ├── sqlx-rt v0.5.10 (*)
I'm using MySQL 8.0 on Windows 10.
Additional Information
Relevant lines from Cargo.toml (remaining crates are actix dependencies and other unrelated items):
Here is a minimal repository showing the issue.
The text was updated successfully, but these errors were encountered: