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

Warning about JSON.NET obsolete in v1.5 #1811

Merged
merged 1 commit into from
Mar 25, 2016

Conversation

Horusiath
Copy link
Contributor

This PR includes information about obsoleting JSON.NET as the default serializer in Akka.NET version 1.5. (see #1695). Warning contains link to manual informing, how to change default serializer to Wire and info about how to suppress this warning message by setting suppress-json-serializer-warning config key to on.

@alexvaluyskiy
Copy link
Contributor

Are you sure that Wire is ready for production use?

For example I have this class and I try to serialize and deserialize it

public class TestSerialization
    {
        public TestSerialization(byte[] document, IReadOnlyList<byte> list, ImmutableArray<byte> immutable)
        {
            Document = document;
            DocumentReadOnly = list;
            DocumentImmutable = immutable;
        }

        public byte[] Document { get; set; }

        public ImmutableArray<byte> DocumentImmutable { get; set; }

        public IReadOnlyList<byte> DocumentReadOnly { get; set;}
    }
    var byte = new byte[] { 2, 6, 8, 9, 3 };
    var list = new ReadOnlyCollection<byte>(byte);
    var immutable = ImmutableArray.Create(byte );
    var expected = new TestSerialization(byte, list, immutable);

I get this result

Document = [5, 0, 0, 0, 3, 0, 0, 0]
DocumentReadOnly = [2, 0, 6, 0, 8]
DocumentImmutable = null

But if I add a string property to TestSerialization class and try again I will get an exception {"Object of type 'System.Byte' cannot be converted to type 'System.String'."}

public string Title { get; } = "Test string";

There is related bug asynkron/Wire#18

@rogeralsing
Copy link
Contributor

The issue have been fixed in Wire.
Also a suggestion, if you have test code as the above, please submit that as a PR to Wire instead.

@Aaronontheweb Aaronontheweb merged commit ad8e5c1 into akkadotnet:dev Mar 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants