Skip to content

Docs: describe behaviour of FromStrAsJson in case type deserialises from a JSON string (opposed to an object or array, for example) #18

@jofas

Description

@jofas

The current behaviour might be confusing when the type deserialises from a JSON string (see #13). Describing that the &str passed to FromStr::from_str is treated as a container containing the JSON string (i.e. the string slice must start and end with " so the content is a valid JSON string) and not the JSON string itself hopefully mitigates further confusion. The example I gave here could be enhanced and used as an example for the docs.

Also, the use of the expression "json string" is imprecise in the current docs. This should be amended, too, to avoid even more confusion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions