Skip to content

Feature Request: Provide a base serializer for YAML #83313

Open

Description

@MrPippin66

This has been requested multiple times, and I see no progress.

In the end, this boils down to PowerShell not supporting YAML conversion, like XML and JSON currently is.

The response is always "We don't support YAML, becuase the .Net runtime doesn't support YAML.

YAML is a base format in Linux based systems, etc, and a common format supported in a major language, like Python.

I don't understand why YAML isn't natively supported in .Net, and thus eliminate the reason why PowerShell doesn't natively support YAML.

Activity

  1. ghost added
    untriaged
    on Mar 12, 2023
  2. MrPippin66 commented on Mar 12, 2023

    @MrPippin66
    Author

    Should be 'area-Serialization'

  3. teo-tsirpanis commented on Mar 12, 2023

    @teo-tsirpanis
    Contributor

    area-Serialization refers to the older Data Contract and XML serializers; assigning to area-Meta.

  4. davidfowl commented on Mar 12, 2023

    @davidfowl
    Member

    YAML is a base format in Linux based systems, etc, and a common format supported in a major language, like Python.

    Is YAML suppoted natively by python? What other languages come with YAML support in the standard library?

  5. MrPippin66 commented on Mar 12, 2023

    @MrPippin66
    Author

    Apologies. It's not a standard part of Python.

    PyYAML has become ubiquitous, but is not a part of the standard distribution.

  6. MrPippin66 commented on Mar 12, 2023

    @MrPippin66
    Author

    But the desire to have this function natively within PowerShell is still desirable due the native use of YAML within container and Ansible envioronments.

  7. stephentoub commented on Mar 12, 2023

    @stephentoub
    Member
  8. MrPippin66 commented on Mar 13, 2023

    @MrPippin66
    Author

    My desire to have this supplied as a standard part of .Net (and thus resolving a reason PowerShell doesn't support it, natively) is primarily a support issue.

    This isn't a niche solution, but a major infrastructure piece used by many mainstream products/solutions (beyond just Ansible and container solutions).

    Y, PyYaml isn't s standard module in Python. But it is a solution Red Hat provides support for. (at least as a solution for other Red Hat products that also leverage this).

    And it's not like Microsoft isn't internally using YAML for their own products (Azure Pipelines being one).

    Lastly, yaml is a formal specification.

    I would think all of the above would merit this being a technology provided within the core framework.

  9. davidfowl commented on Mar 14, 2023

    @davidfowl
    Member

    I don't think I've seen a YAML serializer built into any language's standard library. YAML certainly is ubiquitous in the cloud native space and https://www.nuget.org/packages/YamlDotNet is the defacto YAML implementation for .NET. I don't see a super strong argument for why it needs to go into the standard library (nothing in the standard library or anything that ships with .NET depends on it).

  10. added
    api-suggestion
    and removed
    untriaged
    on Mar 29, 2023
  11. 5 remaining items

  12. davidfowl commented on Dec 11, 2024

    @davidfowl
    Member

    Over time certain formats may become more and more ubiquitous and there may be a point in the future where yaml is a given. The cloud native world certainly has adopted it but it hasn't made it over the threshold of importance to spend the time building a new serializer from scratch to put into the core libraries. System.Text.Json is enough work as it is already and that's without the newly added support for JSON schema etc.

    TL;DR at some point there may be enough motivation for this to tip over from nice to have to must have but it's not there yet. It's a mixture of science (data gathering), art (do we as maintainers think it's the right thing for the runtime) and capacity (do we have the resources to do a good job and maintain thing forever).

  13. iSazonov commented on Jan 16, 2025

    @iSazonov
    Contributor

    From MSFT PowerShell team

    We understand and agree that YAML is used heavily in the industry and would also like to see it supported natively within PS7. Adding a new dependency on an external assembly will introduce dependency collisions. We've already experienced such issues in the past. We also recognize that the popularity of the YAML modules on PSGallery means that YAML support is needed, but also that many folks are ok using 3rd party modules for YAML. If YAML support shows up in .NET runtime, we would certainly approve of builtin YAML cmdlets in PS7.

    The circle never ends. 😃

  14. StephenHodgson commented on Jan 16, 2025

    @StephenHodgson

    The circle never ends. 😃

    Circle of life 😂 Just grateful to see some traction and movement. Especially with all the API specs and DevOps platforms all requiring YAML serialization these days.

  15. kilasuit commented on Jan 18, 2025

    @kilasuit

    TL;DR at some point there may be enough motivation for this to tip over from nice to have to must have but it's not there yet. It's a mixture of science (data gathering), art (do we as maintainers think it's the right thing for the runtime) and capacity (do we have the resources to do a good job and maintain thing forever).

    TL;DR - are we likely to see this happen in 2025 at all? (expand for a fuller reply)

    The longer version

    This I can fully understand, and that will only come when Microsoft & others start doing more to get those in the community more better onboarded with helping in maintaining projects, and not doing so just on goodwill alone because they want to see things improve. Discussing these things is great but doing so is taxing on us, especially those of us doing so without proper financial support behind us to properly maintain and sustain ourselves & all our downstream dependencies.

    This will only truly change when there is a stronger process at governmental levels as well as organisational and individual levels to help those that are passionate, build out software like dotnet and others and not only are willing to provide constructive criticism, but recieve it too.

    In respect to YAML, I'd like to see this in dotnet by the end of the year so that downstream in PowerShell we could add this functionality in, which I don't feel is an unreasonable ask in the grand scheme of things & would allow us to move on from this conversation onto other more interesting ones.

    If that means Microsoft has to go and buy licenses or support contracts or shell out the development on a multi-year contract or even look to aquire businesses to do so, then that that's what I feel is what needs to start happening to get some of these things moving. That then changes the dynamic of these conversations somewhat, and overall I feel would help the community for the better. As someone that understands business, it's a big thing to say Hey I have backing and support from the likes of Microsoft whether that be via investment from Microsoft as a whole or from just a smaller segment of the organisation, like in my case the PowerShell Team. Investment doesn't always need to be finanical, but it sure helps those that could do with it. It also would go far in saying how you support those both in your partner network and out of it too.

    We have a lot of interwoven trusts in the community, and trusts of different types, and I know that the We can't do this right now, due to resource constraints frustrates us all much more than it should & is definitely more visible with open source discussions like this. I am glad we can have these discussions, as are so many of us in the community too.

    Taking dotnet Open Source was the right thing to do to allow more open discussions like this, but only gets the full benefits when the community behind it is properly supported & can access the required tools & tooling they need to be able to do so. We certainly are getting there, even if there is more that we could do.

    Some are in better positions to sustain themselves than others, and have better supporting infrastructure and systems behind them (especially when you think internationally) and can continue to engage because those systems exist. If the UK didn't have the support processes & systems that we have, even though they need improvement, I'm not sure if I'd be here right now & able to type this after some rough times in recent years, but who knows, I'm still here. Moving forward, I know there is more that we as a collective can do to progress & keeping true to Microsoft's mission statement, which resonates with many in and outside of Microsoft, myself included.

    So a simple ask @davidfowl, could we see built-in yaml support, whether built from scratch and directly maintained by Microsoft or via one of the 3rd party packages already out there that you then ship as part of the runtime by the end of this year? Or is the bar for inclusion in dotnet so high, that it can only be a 1st party solution, because it certainly isn't for Windows.

    We can always revist whether or not if we go down the 3rd party package then requires a rebuild as a Microsoft 1st party solution at a later date. I know theres a number of other elements like risk when it's a 3rd party solution that come into consideration, like the Edgio issue recently, so just an indication of yes/no/maybe right now would be great & would help us downstream in projects like PowerShell to either give a timeline for inclusion, or a recommendation where we take dependencies on ourselves, which is what many are looking for here. Those that aren't willing to wait for this to happen & are willing to take the risks that come with that, can already make use of the 3rd party solutions available to us, so it's not for what I can see mission critical as such, at least not right now, however others are already seeing it that way.

    From a Configuration Management perspective, which PowerShell, DSC, winget and other products in the market already require a way to work with yaml & is certainly something we could have done with as far back as 2016 as that was when it started being more used in those areas & would be really really nice for loads of us to not to be going into 2026 without it in dotnet in one way or another.

  16. davidfowl commented on Jan 18, 2025

    @davidfowl
    Member

    So a simple ask @davidfowl, could we see built-in yaml support, whether built from scratch and directly maintained by Microsoft or via one of the 3rd party packages already out there that you then ship as part of the runtime by the end of this year? Or is the bar for inclusion in dotnet so high, that it can only be a 1st party solution, because it certainly isn't for Windows.

    No, I doubt we will ever do this again (like we did with JSON.NET in the early days of .NET Core).

    From a Configuration Management perspective, which PowerShell, DSC, winget and other products in the market already require a way to work with yaml & is certainly something we could have done with as far back as 2016 as that was when it started being more used in those areas & would be really really nice for loads of us to not to be going into 2026 without it in dotnet in one way or another.

    I have no doubt that somethings might push us in this direction like I said, but it's definitely not happening in .NET 10. As you know building a serializer is a HUGE undertaking, even for a big company like Microsoft.

  17. kilasuit commented on Jan 18, 2025

    @kilasuit

    but it's definitely not happening in .NET 10.

    Thanks for adding this additional bit of clarity @davidfowl - this certainly helps us with messaging to others when asked in downstream projects like PowerShell where we regularly get asked for support to be built in. I know I and others will look forward to it when it does end up making it into a future dotnet release.

    As you know building a serializer is a HUGE undertaking, even for a big company like Microsoft.

    Yeah, I & many others certainly do not doubt the scale of the task to bring this kind of functionality natively into DotNet. Though, perhaps we may have hoped that with the help provided via AI tooling that something as big as this may have been feasible for it to make the bar for inclusion in DotNet 10 and then could be available for downstream projects like PowerShell to make use of.

  18. StephenHodgson commented on Jan 18, 2025

    @StephenHodgson

    As you know building a serializer is a HUGE undertaking, even for a big company like Microsoft.

    So instead we push the effort to the community to maintain such a critical part of so much of our DevOps and automated workflows? There is also precedent for Microsoft to just incorporate the community projects into their own first party while working with those authors on integration.

    Though, perhaps we may have hoped that with the help provided via AI tooling

    💯 This. With source generators and the like it really shouldn't be that big a lift.

    There are a few oddities and edge cases in yaml but it is a superset of json.

  19. davidfowl commented on Jan 18, 2025

    @davidfowl
    Member

    AFAIK YamlDotNot is a pretty high quality yaml implementation maintained by the community.

    Image
  20. StephenHodgson commented on Jan 18, 2025

    @StephenHodgson

    AFAIK YamlDotNot is a pretty high quality yaml implementation maintained by the community.

    It's exactly the point I'm trying to make. Why isn't it too hard for people to do this in their spare time, but you guys push back about wanting to do a first party support?

    Which is it? It's hard to do? Or you just don't want to do it?

  21. MihaZupan commented on Jan 18, 2025

    @MihaZupan
    Member

    Two things can be true at the same time.
    A community maintained project being of high quality does not imply that the problem it's solving is trivial.

  22. davidfowl commented on Jan 18, 2025

    @davidfowl
    Member

    Our JSON implementation took about 4 versions (aka years) to get to a decent place, trying to support features that JSON.NET supported, taking security and async into consideration, AOT support etc. etc. I do think building the next one means we can go in with LOTS of experience, and yes, we can use AI to help write the code, but writing code is not shipping and maintaining professional production quality software in 20+ year old ecosystem.

  23. am11 commented on Jan 18, 2025

    @am11
    Member

    AFAIK YamlDotNet is a pretty high-quality YAML implementation maintained by the community.

    Yup, YDN is currently garnering around 62K downloads per day and ranks #49 top package on nuget.org https://www.nuget.org/stats/packages. With platforms like GitHub Actions and Azure Pipelines utilizing YDN for configuration, it shows even first party platforms depend on open-source tools and libraries that are NIH where it makes sense.

    There are a few oddities and edge cases in YAML, but it is a superset of JSON.

    If parsing JSON is (famously dubbed as) navigating a minefield, parsing YAML can be twice as tricky (to put it lightly 😅). Thankfully, there are tools available to help streamline the process; sourcegen from specs to programming languages or validate implementations against the official YAML spec test suite. Using these tools, developers can quickly deliver implementations with high confidence (e.g., 100% spec-suite compliance). However, as @davidfowl pointed out, designing an intuitive and robust API experience on top of it, gathering real-world use cases from the community and maturing the implementation has its own set of challenges.

  24. rosieks commented on Sep 16, 2025

    @rosieks

    Not sure if YDN is still actively maintained by the community. The last commit was 8 months ago. I opened a PR almost a year ago to fix a bug, and although there are people interested in having it merged, there has been no feedback from any maintainer.

  25. StephenHodgson commented on Sep 16, 2025

    @StephenHodgson

    Exactly, these community lead "solutions" aren't going to maintain themselves which is why a trusted partner needs to take up the mantle.

  26. kilasuit commented on Nov 19, 2026

    @kilasuit

    Are ya still standing by this @davidfowl 😜

    Our JSON implementation took about 4 versions (aka years) to get to a decent place, trying to support features that JSON.NET supported, taking security and async into consideration, AOT support etc. etc. I do think building the next one means we can go in with LOTS of experience, and yes, we can use AI to help write the code, but writing code is not shipping and maintaining professional production quality software in 20+ year old ecosystem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    api-suggestionarea-Metafeature-request

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions