Skip to content

Add YAML support to the source generator#659

Open
jing8956 wants to merge 3 commits intocorvus-dotnet:mainfrom
jing8956:main
Open

Add YAML support to the source generator#659
jing8956 wants to merge 3 commits intocorvus-dotnet:mainfrom
jing8956:main

Conversation

@jing8956
Copy link

Add YAML support to the Corvus.Json.SourceGenerator

@CLAassistant
Copy link

CLAassistant commented Aug 20, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@mwadams mwadams left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks really good.

One performance related comment.

if (string.Equals(extensions, ".yaml", StringComparison.InvariantCultureIgnoreCase)
|| string.Equals(extensions, ".yml", StringComparison.InvariantCultureIgnoreCase))
{
YamlDotNet.Serialization.IDeserializer deserializer =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is important to minimize the amount of work done in the source generator.

We should build the serializer and deserializer instances once and use static instances, rather than creating them on the fly every time we generate source.

Copy link
Author

@jing8956 jing8956 Jan 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mwadams Done. jing8956@50d2e88
Rebased onto the latest commit.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants