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

SerializerGenerator throws exception when IsRecursive = true and target primitive types #105

Closed
neuecc opened this issue Aug 10, 2015 · 2 comments
Labels
bug Detected as bug

Comments

@neuecc
Copy link

neuecc commented Aug 10, 2015

New feature of ver 0.6.0 SerializerCodeGenerationConfiguration.IsRecursive is good.
But if target type contains primitive types, throws serialization exception.

var settings = new SerializerCodeGenerationConfiguration
{
    IsRecursive = true,
};
var code = SerializerGenerator.GenerateCode(settings, typeof(int));
System.Runtime.Serialization.SerializationException: Cannot serialize type 'System.Int32' because it does not have any serializable fields nor properties.

My expected result is do nothing.

@yfakariya yfakariya added enhancement Requires or request to feature enhancement bug Detected as bug and removed enhancement Requires or request to feature enhancement labels Aug 11, 2015
@yfakariya
Copy link
Member

Thank you for suggestion. It is bug of recursive target selection.

yfakariya added a commit that referenced this issue Aug 15, 2015
…es exception. Issue #105.

Change filtering logic from SerializerBuilder to SerializerGenerator, and checks both of root types and dependent types.
@yfakariya
Copy link
Member

Fixed in 0.6.1.

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