Skip to content

ConvertTo-Json Honors JsonPropertyAttribute #6847

@adamdriscoll

Description

@adamdriscoll

In PowerShell v6, Convert(To\From)-Json uses Newtonsoft.Json. ConvertTo-Json acknowledges JsonIgnoreAttributes but does not honor JsonPropertyAttributes. have some objects that are decorated with these attributes and serialize differently between ASP.NET and PowerShell. I've had to make a hacked version of ConvertTo-Json to support these attributes. For me, it results in a difference in casing which causes my JavaScript code to fail.

I propose that the JSON cmdlets honor the JsonPropertyAttributes placed on properties.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Resolution-No ActivityIssue has had no activity for 6 months or moreWG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions