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

GenerateSerializerSourceCodes doesn't recursive when type is array #120

Closed
neuecc opened this issue Oct 6, 2015 · 2 comments
Closed

GenerateSerializerSourceCodes doesn't recursive when type is array #120

neuecc opened this issue Oct 6, 2015 · 2 comments
Labels
bug Detected as bug

Comments

@neuecc
Copy link

neuecc commented Oct 6, 2015

SerializerCodeGenerationConfiguration.IsRecursive is nice feature, thanks.
But if top type is array, doesn't recursive.

public class MyClass
{
    // can't generate MyClass3Serializer.
    // If MyClass2 MyProperty, can generate MyClass3Serializer.
    public MyClass2[] MyProperty { get; set; }
}

public class MyClass2
{
    public MyClass3 MyProperty { get; set; }
}

public class MyClass3
{
    public int MyProperty { get; set; }
}

repro full code.

var settings = new SerializerCodeGenerationConfiguration
{
    OutputDirectory = Path.GetTempPath(),
    SerializationMethod = SerializationMethod.Array,
    Namespace = "Hoge" + ".GeneratedSerializers",
    IsRecursive = true,
    PreferReflectionBasedSerializer = false
};

var result = SerializerGenerator.GenerateSerializerSourceCodes(settings, typeof(MyClass));
foreach (var item in result)
{
    // expected : MyClass, MyClass2, MyClass3
    // actual   : MyClass, MyClass2
    Console.WriteLine(item.TargetType);
}
@yfakariya yfakariya added the bug Detected as bug label Oct 8, 2015
@yfakariya
Copy link
Member

Sorry, I'll fix it soon.

@yfakariya
Copy link
Member

It was solved in 0.6.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Detected as bug
Projects
None yet
Development

No branches or pull requests

2 participants