• Stars
    star
    312
  • Rank 134,133 (Top 3 %)
  • Language
    C#
  • License
    Other
  • Created about 11 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

SharpYaml is a .NET library for YAML compatible with CoreCLR

SharpYaml Build Status NuGet

SharpYaml is a .NET library that provides a YAML parser and serialization engine for .NET objects, compatible with CoreCLR.

NOTICE:

This project is no longer actively maintained since 2016, but it's still accepting Pull-Requests.

Small improvements and fixes are welcome, but big refactoring won't likely be.

Please, open an issue in case you are not sure about the changes you want to bring before working on a PR.

Usage

var serializer = new Serializer();
var text = serializer.Serialize(new { List = new List<int>() { 1, 2, 3 }, Name = "Hello", Value = "World!" });
Console.WriteLine(text);

Output:

List:
  - 1
  - 2
  - 3
Name: Hello
Value: World!

Features

SharpYaml is a fork of YamlDotNet and is adding the following features:

  • Supports for .netstandard2.0
  • Memory allocation and GC pressure improved
  • Completely rewritten serialization/deserialization engine
  • A single interface IYamlSerializable for implementing custom serializers, along IYamlSerializableFactory to allow dynamic creation of serializers. Registration can be done through SerializerSettings.RegisterSerializer and SerializerSettings.RegisterSerializerFactory
    • Can inherit from ScalarSerializerBase to provide custom serialization to/from a Yaml scalar
  • Supports for custom collection that contains user properties to serialize along the collection.
  • Supports for Yaml 1.2 schemas
  • A centralized type system through ITypeDescriptor and IMemberDescriptor
  • Highly configurable serialization using SerializerSettings (see usage)
    • Add supports to register custom attributes on external objects (objects that you can't modify) by using SerializerSettings.Register(memberInfo, attribute)
    • Several options and settings: EmitAlias, IndentLess, SortKeyForMapping, EmitJsonComptible, EmitCapacityForList, LimitPrimitiveFlowSequence, EmitDefaultValues
    • Add supports for overriding the Yaml style of serialization (block or flow) with SerializerSettings.DefaultStyle and SerializerSettings.DynamicStyleFormat
  • Supports for registering an assembly when discovering types to deserialize through SerializerSettings.RegisterAssembly
  • Supports a IObjectSerializerBackend that allows to hook a global rewriting for all YAML serialization types (scalar, sequence, mapping) when serializing/deserializing to/from a .NET type.

Download

SharpYaml is available on NuGet

License

MIT

More Repositories

1

markdig

A fast, powerful, CommonMark compliant, extensible Markdown processor for .NET
C#
4,271
star
2

zio

A cross-platform abstract/virtual filesystem framework with many built-ins filesystems for .NET
C#
707
star
3

dotnet-releaser

Easily build, run tests and coverage, cross-compile, package and publish your .NET library or application to NuGet and GitHub.
C#
615
star
4

UnityNuGet

Provides a service to install NuGet packages into a Unity project via the Unity Package Manager
C#
572
star
5

CppAst.NET

CppAst is a .NET library providing a C/C++ parser for header files powered by Clang/libclang with access to the full AST, comments and macros
C#
352
star
6

Tomlyn

Tomlyn is a TOML parser, validator and authoring library for .NET Framework and .NET Core
C#
290
star
7

kalk

kalk is a powerful command line calculator app for developers.
C#
243
star
8

JitBuddy

Disassemble to x86/x64 ASM listing the native code generated by the JIT of a managed method.
C#
219
star
9

Varena

Varena is a .NET library that provides a fast and lightweight arena allocator using virtual memory.
C#
121
star
10

Blake3.NET

Blake3.NET is a fast managed wrapper around the SIMD Rust implementations of the BLAKE3 cryptographic hash function.
C#
116
star
11

LibObjectFile

LibObjectFile is a .NET library to read, manipulate and write linker and executable object files (e.g ELF, DWARF, ar...)
C#
91
star
12

CppAst.CodeGen

An extensible library providing C# PInvoke codegen from C/C++ files for .NET
C#
91
star
13

git-rocket-filter

Rewrite git branches in a powerful way
C#
82
star
14

gcix

A cross-platform implementation of the Immix Garbage Collector
C++
70
star
15

ManagedJit

Prototype of writing a managed JIT in C# with CoreCLR
C++
68
star
16

NWindows

NWindows is a cross-platform window creation and management library for .NET
C#
67
star
17

grpc-curl

grpc-curl is a command line tool for interacting with gRPC servers
C#
66
star
18

Broslyn

A lightweight utility library to create a Roslyn AdhocWorkspace from an existing solution or a csproj
C#
55
star
19

SharpScss

A portable cross-platform pinvoke .NET wrapper around libsass to convert SCSS to CSS
C#
52
star
20

Antlr4Ast

Antlr4Ast is a .NET library that provides a parser and abstract syntax tree (AST) for ANTLR4/g4 files.
C#
43
star
21

Monocypher.NET

.NET wrapper around the cryptographic library Monocypher https://monocypher.org/
C#
40
star
22

SharpDoc

SharpDoc is a documentation tool to generate HTML documentation for .NET projects
C#
39
star
23

SharpNng

SharpNng is a lightweight low-level managed wrapper around the Lightweight Messaging Library NNG
C#
37
star
24

SuperluminalPerf

SuperluminalPerf is a small .NET managed wrapper around the Superluminal PerformanceAPI.
C#
33
star
25

NPlug

Develop VST3 audio native plugins with .NET
C#
30
star
26

GitLib.NET

GitLib.NET is a bare metal P/Invoke wrapper around libgit2 for .NET
C#
28
star
27

jsonite

A lightweight, fast and compliant JSON serializer/deserializer/validator for .NET
C#
20
star
28

SharpRazor

A lightweight templating system using Razor
C#
19
star
29

smash

Smash provides a collection of non-cryptographic hashes for .NET
C#
15
star
30

XelaBuild

Playground for testing msbuild in a "server" mode
C#
15
star
31

SharpDiff

A fork of https://difflib.codeplex.com/
C#
13
star
32

NTar

A single file C# file to untar file entries from a tar stream.
C#
11
star
33

SharpPdbPatcher

A library/console program to replace source paths stored in a .NET PDB file
C#
9
star
34

AnalyzerPack

Repackage your current project as a Diagnostic Analyzer NuGet package
PowerShell
9
star
35

YamlSerializer

Fork of https://yamlserializer.codeplex.com/
C#
8
star
36

xoofx.github.io

Repository of my blog
HTML
7
star
37

NPlug.Samples

Samples for creating VST3 audio native plugins with NPlug and .NET7+/NativeAOT.
C#
7
star
38

BenchNativeApp

A small suite of micro-benchmarks for testing .NET Native and RyuJIT
C#
4
star
39

MarkdigAutoEmail

C#
3
star
40

dotnet-repo-xoofx

My .NET project/solution template.
C#
3
star
41

draytek-watcher

Daemon to reboot the WAN interface of a DrayTek router if it looks down
C#
2
star
42

scoop-kalk

Scoop repository for https://github.com/xoofx/kalk.
1
star
43

RoslynErrorApp

Repro project failing to run with Roslyn + .NET 5 installed
C#
1
star
44

homebrew-grpc-curl

Homebrew repository for https://github.com/xoofx/grpc-curl
Ruby
1
star
45

SharpDX.Toolkit.Game.Direct2D

Provides Direct2D and DirectWrite to Toolkit's Game class
C#
1
star
46

scoop-grpc-curl

Scoop repository for https://github.com/xoofx/grpc-curl.
1
star
47

atlassian.net-sdk

Fork of atlassian.net-sdk from bitbucket to test the JIRA REST API
C#
1
star