Skip to content

gix::Url should serialize/deserialize to string #2215

@nrdxp

Description

@nrdxp

Current behavior 😯

Currently, the default behavior of the gix::Url is to seralize as a sort of json object of it's components. Just curious if there is actually some conscious reason for this, or perhaps it is just something that got overlooked, in which case, I can maybe submit a patch for it to rectify.

Expected behavior 🤔

I don't think this is what anyone whould expect nor desire from a type representing a URL.

I am able to rectify this in my own code by using #[serde(serialize_with // ..., etc to change the behavior, but it is a bit tedious when using the Url in multiple places. I think the most intuitive approach is to seralize and deserialize to a string representation of a URL, since that is primarily what a URL is.

Git behavior

not strictly relevant

Steps to reproduce 🕹

just serialize a gix::Url with serde and observe the output.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions