Skip to content

Can not parse generic classes #135

@emrahbabayigit

Description

@emrahbabayigit

I checked source code. The lookuptable was created only for CreditData. Because of that Response is not parsing

Simple example:

var r = fastJSON.JSON.ToObject<Response<CreditData>>("{\"data \":{\"Credit \":10},\"Error\":\"noerror\"}");
Debug.Assert(r.Error != null);
Debug.Assert(r.data != null);

public class Response<T>
{
  public T data { get; set; }
  public string Error { get; set; }
}

public class CreditData
{
   public int Credit { get; set; }
}

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