GithubHelp home page GithubHelp logo

Comments (8)

rogeralsing avatar rogeralsing commented on June 10, 2024

This is probably a code gen bug, will look Into it

from wire.

ShamsulAmry avatar ShamsulAmry commented on June 10, 2024

Thanks

from wire.

ShamsulAmry avatar ShamsulAmry commented on June 10, 2024

My bad, actually the error happened because Wire can't deserialize the properties without setters.

I was actually testing this, which can be deserialized without error:

public class ClassWithNonDefaultCtor
{
    public ClassWithNonDefaultCtor(string prop1, int prop2)
    {
        Prop1 = prop1;
        Prop2 = prop2;
    }

    public string Prop1 { get; }
    public int Prop2 { get; }
}

Then tried changing it to struct, which failed:

public class StructValueWithNonDefaultCtor
{
    public StructValueWithNonDefaultCtor(string prop1, int prop2)
    {
        Prop1 = prop1;
        Prop2 = prop2;
    }

    public string Prop1 { get; }
    public int Prop2 { get; }
}

from wire.

mellinoe avatar mellinoe commented on June 10, 2024

I'm seeing this as well, assuming you meant for your second example to be

public struct StructValueWithNonDefaultCtor
{
    ...
}

I also have some structures with public readonly fields, rather than readonly properties.

from wire.

ShamsulAmry avatar ShamsulAmry commented on June 10, 2024

@mellinoe, thanks for the correction. Wrongly copy-paste-edited.

I think it make sense for the deserializer to fail since it can't write to read-only fields and properties.

from wire.

ShamsulAmry avatar ShamsulAmry commented on June 10, 2024

@rogeralsing, I'm still looking to make NodaTime workable across Akka nodes. However, due to the issue above, NodaTime won't naturally serialize on its own and I'm thinking of using Wire's surrogate feature to make it happen. But I'm not sure how to do that with Akka-Wire implementation. Any hint?

from wire.

ia64mail avatar ia64mail commented on June 10, 2024

@rogeralsing Hi! Do you have any updated regarding this issue? I run into the same problem when serializing a structure with non-default constructor. This ticket has been closed a month ago but final resolution is unknown.

from wire.

Horusiath avatar Horusiath commented on June 10, 2024

@ia64mail AFAIK this issue remains unresolved on Wire, but it has been fixed on Hyperion (akka.net fork of Wire) as of akkadotnet/Hyperion#9

from wire.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.