Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forgot to escape JSON string output #4280

Merged
merged 1 commit into from
Aug 12, 2023
Merged

Forgot to escape JSON string output #4280

merged 1 commit into from
Aug 12, 2023

Conversation

geeknoid
Copy link
Member

@geeknoid geeknoid commented Aug 11, 2023

null

Microsoft Reviewers: Open in CodeFlow

@ghost ghost assigned geeknoid Aug 11, 2023
@geeknoid geeknoid enabled auto-merge (squash) August 11, 2023 22:39
@@ -174,6 +174,10 @@ private void OutArray(string name, Action action)

private void OutNameValue(string name, string value)
{
value = value
Copy link
Member

Choose a reason for hiding this comment

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

Why not use JsonSerializer.Serialize(value) ?

Copy link
Contributor

Choose a reason for hiding this comment

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

IIRC Generators can't reference packages (e.g. System.Text.Json). @geeknoid, is that correct?

Copy link
Member

Choose a reason for hiding this comment

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

And they target NS2.0, so that wouldn't be possible, ok.

Copy link
Member Author

Choose a reason for hiding this comment

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

That's what I thought until a few minutes ago. Someone just sent me https://github.com/dotnet/roslyn/blob/main/docs/features/source-generators.cookbook.md#use-functionality-from-nuget-packages which shows the MSBuild magic to make this happen.

I'll create an issue to track upgrading to that approach.

@geeknoid geeknoid merged commit ee5bc2a into main Aug 12, 2023
6 checks passed
@geeknoid geeknoid deleted the geeknoid/audit branch August 12, 2023 00:42
@ghost ghost added this to the 8.0 RC1 milestone Aug 12, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Sep 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants