Skip to content

Deserializing ID as integer not String #455

@ValouBambou

Description

@ValouBambou

Hi, I'm using an API where ID are integers, not string. Thus, the generated code by the macro is using type ID = String. And it leads to Deserialization error such as Error("invalid type: integer `570721`, expected a string", line: 1, column: 45). Is there a way to specify this to the derive macro ? I'm confused because some of the examples in the documentation are using integers, so it may be possible (EDIT: I realized that the example is confusing because of the hidden context with struct User { id:i32}).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions