8000 Don't serialize to json ETS properties for DateTime and string types by SteveL-MSFT · Pull Request #15665 · PowerShell/PowerShell · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@SteveL-MSFT
Copy link
Member
@SteveL-MSFT SteveL-MSFT commented Jun 24, 2021

PR Summary

PowerShell automatically adds extended properties to DateTime (specifically DisplayHint) objects that is used with formatting. This is intended to be "internal", but when converted to JSON, those extra properties turn what should be a json datetime to a complex object. For string types, if the user has added extended properties, this can result in recursive serialization behavior.

The @PowerShell/powershell-committee agreed to special case both DateTime and string types to not serialize any extended properties when converting to JSON.

PR Context

Fix #5797

PR Checklist

@ghost ghost assigned rjmholt Jun 24, 2021
@SteveL-MSFT SteveL-MSFT requested a review from daxian-dbw June 24, 2021 23:03
…Cmdlet/JsonObject.cs

Co-authored-by: Ilya <darpa@yandex.ru>
@iSazonov iSazonov added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Jul 2, 2021
@ghost ghost added the Review - Needed The PR is being reviewed label Jul 10, 2021
@ghost
Copy link
ghost commented Jul 10, 2021

This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days.
Maintainer, please provide feedback and/or mark it as Waiting on Author

@rjmholt rjmholt merged commit adc236c into PowerShell:master Jul 12, 2021
@ghost ghost removed the Review - Needed The PR is being reviewed label Jul 12, 2021
@SteveL-MSFT SteveL-MSFT deleted the json-ets branch July 13, 2021 02:28
@iSazonov iSazonov added this to the 7.2.0-preview.8 milestone Jul 13, 2021
@ghost
Copy link
ghost commented Jul 22, 2021

🎉v7.2.0-preview.8 has been released which incorporates this pull request.:tada:

Handy links:

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

Labels

CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ConvertTo-Json: unexpected behavior with objects that have ETS properties (NoteProperty, ScriptProperty)

3 participants

0