Skip to content

[Bug]: Uuid unable to deserialize from string #138

@mdtusz

Description

@mdtusz

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Current Behaviour

When trying to deserialize to a struct containing a Uuid from a string representation, deserializing fails.

#[derive(Serialize, Deserialize)]
struct Foo {
 id: Uuid
}

let id = Uuid:new_v4();
let c = cbor!({ "id" => id.to_string() }).unwrap();

let parsed: Foo = c.deserialized().unwrap();

assert_eq!(parsed.id, id);

This previously worked, but I am unable to track down when exactly the issue arose, where exactly the issue lives, or whether it is indeed an issue with ciborium, or an issue with serde or uuid - any guidance will be appreciated.

Expected Behaviour

I would expect for ciborium/serde to allow for parsing string UUID values into Uuid's, as they will often be written as strings by CBOR clients.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions