Giter Club home page Giter Club logo

Comments (5)

bdovaz avatar bdovaz commented on July 30, 2024 1

I see that it has to do with the EmitAlias value that by default is true, if I set it to false, it does not pass.

I don't understand the use of EmitAlias, what is it for?

from sharpyaml.

xoofx avatar xoofx commented on July 30, 2024 1

But is there a way to make a change (and create a PR) to be able to reuse the instance with EmitAlias to true?

Oh sorry, yes, the dictionary are in the AnchorSerializer:

private readonly Dictionary<string, object?> aliasToObject;
private readonly Dictionary<object, string> objectToAlias;

so in the SerializerSettings you could add a bool in that says e.g "ResetAlias", and in the Serializer class, clear the AnchorSerializer if necessary after a Serialize/Deserialize call. (The AnchorSerializer is embedded in a RoutingSerializer, you will figure this out).

from sharpyaml.

xoofx avatar xoofx commented on July 30, 2024

I see that it has to do with the EmitAlias value that by default is true, if I set it to false, it does not pass.

Yes, afair, EmitAlias is the only thing that makes the Serializer not reusable by default as it is storing references. Emit Alias is the feature of YAML where if you emit an object multiple times, it will use anchor/reference instead of duplicating the object in the output YAML.

The default has been like this since ages. It's probably not great, but well, you can turn it off, so let's keep it that way.

from sharpyaml.

bdovaz avatar bdovaz commented on July 30, 2024

But is there a way to make a change (and create a PR) to be able to reuse the instance with EmitAlias to true?

If you guide me a bit where to look I can try, otherwise it would be to make a PR of the Readme.md indicating it so at least that whoever uses it knows it.

from sharpyaml.

bdovaz avatar bdovaz commented on July 30, 2024

PR created!

from sharpyaml.

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.