runtime icon indicating copy to clipboard operation
runtime copied to clipboard

Proposal: YAML support

Open nxtn opened this issue 7 years ago • 16 comments

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.

nxtn avatar Jan 14 '19 06:01 nxtn

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.

ichensky avatar Jan 15 '19 09:01 ichensky

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

nxtn avatar Jan 15 '19 13:01 nxtn

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.

ichensky avatar Jan 15 '19 14:01 ichensky

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)

karelz avatar Jan 15 '19 17:01 karelz

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.

am11 avatar Jan 15 '19 17:01 am11

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 avatar Jan 15 '19 18:01 karelz

@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 avatar Jan 24 '19 07:01 iSazonov

@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 avatar Jan 24 '19 07:01 karelz

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

dotnet/runtime#27761

nxtn avatar Jan 24 '19 07:01 nxtn

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

karelz avatar Jan 24 '19 07:01 karelz

@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 avatar Jan 24 '19 07:01 iSazonov

@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 avatar Jan 24 '19 07:01 karelz

@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 avatar Jan 24 '19 07:01 iSazonov

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

karelz avatar Jan 24 '19 15:01 karelz

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

nxtn avatar Jul 25 '19 04:07 nxtn

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

karelz avatar Jul 25 '19 08:07 karelz