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

FormerlySerializedAs is not respected when parsing arrays #161

Open
trymoto opened this issue Mar 31, 2020 · 0 comments
Open

FormerlySerializedAs is not respected when parsing arrays #161

trymoto opened this issue Mar 31, 2020 · 0 comments

Comments

@trymoto
Copy link

trymoto commented Mar 31, 2020

Hello!
I've had issue with TryDeserialize assigning default values to fields marked with FormerlySerializedAs.

I have a following json structure:

"[
    {
        "public_name": "Name"
    },
    {
        "public_name": "Name2"
    }
]"

Then i use struct type to pass into Deserialize:

[Serializable]
public struct UserDTO
{
    [FormerlySerializedAs("public_name")]
    public string publicName;
}

and the wrapper i'm using is from example StringSerializationAPI in readme:

StringSerializationAPI.Deserialize(typeof(UserDTO[]), jsonString)

However, on the other end i get array with default values

publicName = {string} null

Do i have to create fsDirectConverter for that?

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

No branches or pull requests

1 participant