Skip to content
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

UUID fields are not serialized by .into_json() on queries #619

Closed
yashsamit opened this issue Mar 20, 2022 · 1 comment · Fixed by #539
Closed

UUID fields are not serialized by .into_json() on queries #619

yashsamit opened this issue Mar 20, 2022 · 1 comment · Fixed by #539
Assignees

Comments

@yashsamit
Copy link

yashsamit commented Mar 20, 2022

Description

Datetime fields are not serialized by .into_json() on queries. Possible duplicate of #530.

Steps to Reproduce

  1. Add UUID in any Model(Entity)
  2. Run into_json query
  3. It will hide the UUID field. If into_json removed field comes back.

Expected Behavior

It should convert UUID to string and should be visible in the final JSON output.

Actual Behavior

The field is missing as explained above.

Reproduces How Often

It can be reproduced every time.

Versions

0.6

Additional Information

#[sea_orm(table_name = "categories")]
pub struct Model {
    #[sea_orm(primary_key)]
    pub id: i32,
    pub api_key: Uuid,
    pub added: DateTime,
    pub updated: DateTime,
}

let db = &data.conn;
let  u = Uuid::parse_str(uuid.as_str()).expect("UUID is required!");
let category = Category::find()
        .filter(categories::Column::ApiKey.eq(u))
        .into_json()
        .one(db)
        .await
        .expect("category not found");
@billy1624 billy1624 self-assigned this Mar 22, 2022
@billy1624 billy1624 linked a pull request Mar 22, 2022 that will close this issue
@billy1624
Copy link
Member

Hey @yashsamit, thanks for the report! It would be fixed on #539

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 a pull request may close this issue.

2 participants