Comments (5)
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.
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:
SharpYaml/src/SharpYaml/Serialization/Serializers/AnchorSerializer.cs
Lines 57 to 58 in a8fcaa5
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.
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.
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.
PR created!
from sharpyaml.
Related Issues (20)
- The string "null" should be deserialized as a string, not as null
- Question: Plans to support NRT? HOT 2
- Custom naming convention attribute
- Unable to find package SharpYaml with version (>= 2.1.0)
- [Question] Is there a way to make nested data block style and rest flow style using the serializer?
- Serialization of private properties HOT 2
- Usage samples are lacking information HOT 1
- Custom converter for generic types
- Support for System Immutable collection types HOT 1
- When is the support dimension [2]?
- Preserving comments HOT 2
- Exception was of type 'FileNotFoundException' HOT 1
- Ignore unmapped properties in YAML HOT 4
- No longer can set Alias for property like this: [YamlMember(Alias = "$ref")] HOT 1
- SemanticErrorException when path key exceeds 1023 characters HOT 3
- Quotation marks are need for string like `"1e3"`, otherwise it will be regard as number `1000` HOT 2
- Anchor missing for sibling nested objects HOT 2
- Multiline strings are not emitted in the literal/folded style
- License Confusion HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sharpyaml.