Runtime: Proposal: YAML support

Created on 14 Jan 2019  路  16Comments  路  Source: dotnet/runtime

YAML has become a popular language, even adopted in widely used Microsoft's products such as Azure Pipelines and DocFX. However, .NET hasn't had built-in APIs or great third-party libraries (like Json.NET) to deal with YAML.

I suggest a System.Yaml namespace (like System.Xml) which supports YAML serialization.

api-suggestion area-Meta

Most helpful comment

think JSon.NET

馃挕 YamlDotNet is an actively-maintained, community-driven alternative which implements v1.1 spec of YAML (language that syntactically belongs to the family of off-side rule languages). YDN is written purely in C#, provides package that supports .NET Framework 2.0+ and .NET Standard1.3+ and is also Unity[3d] compatible.

All 16 comments

Yaml - ugly data serialization language, where you need format text by spaces, so it is not human easy editable language. It is better if yaml would live in any other lib out of NET Framework.

When it comes to formats, we always indent the codes in any language with spaces, so this may not be the main problem?

Yaml has very big problem with spaces, when you creating yaml file, you should always count number of spaces at each line and keep in mind whole structure of yaml file, and if yaml file is big this task really hard. In languages like json, xml, C# it dosen't matter how do you write your code, compiler always can parse it. And if you mistakenly add space somewhere in the code at the beginning of line (in C# for ex.) it will not influence on the result.

I would be hesitant to add it to the platform itself, unless it is truly needed.
This can easily live as independent NuGet package - not even owned by MS (think JSon.NET)

think JSon.NET

馃挕 YamlDotNet is an actively-maintained, community-driven alternative which implements v1.1 spec of YAML (language that syntactically belongs to the family of off-side rule languages). YDN is written purely in C#, provides package that supports .NET Framework 2.0+ and .NET Standard1.3+ and is also Unity[3d] compatible.

In that case I would suggest to close this issue, unless there is some very compelling reason to have YAML support in the platform itself.

@karelz Is https://github.com/aaubry/YamlDotNet a _trusted_ repository that can be used in Microsoft projects (like PowerShell Core)?

Related issue in PowerShell Core repo https://github.com/PowerShell/PowerShell/issues/3607

/cc @SteveL-MSFT

@iSazonov that is decision of each project which dependencies to trust / support, etc. For example, ASP.NET Core decided to built on top of JSon.NET.

@karelz They plan on removing dependency from ASP.NET Core to Json.NET now.

dotnet/runtime#27761

@NextTurn sure, I know. From various reasons. But the dependency shipped in multiple versions - 1.0, 1.1, 2.0 and 2.2.

@karelz I guess that the security policy is common for all Microsoft projects. It may not be acceptable to distribute PowerShel Core with YamlDotNet on Windows systems that can require servicing by WindowsUpdate.

@iSazonov this is not only about security policy, much more is involved. Either way, it is PowerShell Core team decision to take the dependency, or find alternatives (e.g. its own implemented, etc.).

@karelz Thanks!

@SteveL-MSFT Could you please comment? Could we use YamlDotNet or we need more trusted API for https://github.com/PowerShell/PowerShell/issues/3607?

@iSazonov I think that discussion would be best in PowerShell repo where it is most relevant.

Reopening due to milestone changes. :) Is this under consideration now?

No, milestone was set to reflect WHEN it was closed. Closing again.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Timovzl picture Timovzl  路  3Comments

yahorsi picture yahorsi  路  3Comments

btecu picture btecu  路  3Comments

chunseoklee picture chunseoklee  路  3Comments

omariom picture omariom  路  3Comments