Skip to content

ConvertTo-Json Honors JsonPropertyAttribute #6847

Description

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.

Activity

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

    Resolution-No ActivityIssue has had no activity for 6 months or moreWG-Cmdletsgeneral cmdlet issues

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions