[PUP-8976] A hash containing the key __ptype cannot be serialized using the human readable JSON format Created: 2018/06/29  Updated: 2018/09/19  Resolved: 2018/08/03

Status: Closed
Project: Puppet
Component/s: Docs, Language, Type System
Affects Version/s: None
Fix Version/s: PUP 6.0.0

Type: Bug Priority: Normal
Reporter: Henrik Lindberg Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template: PUP Bug Template
Sub-team: Language
Team: Platform Core
Method Found: Needs Assessment
Release Notes: Bug Fix
Release Notes Summary: It was not possible to use a hash key `__pcore_type` in a hash as that would trigger the special handling during serialization. Now in Puppet 6.0.0, the special key has changed to `__ptype` and it is not also possible to use that as a key in a hash and still be able to serialize it (for example use it in a catalog).
QA Risk Assessment: Needs Assessment


Using a Hash with the key __ptype will not serialize correctly as that is a reserved tag.
There is already a mechanism in place to use an alternative representation when a Hash contains non JSON string compliant keys so the fix is simply to treat a hash with the key in question as one that has non-string keys as that will use the alternative encoding.

Comment by Josh Cooper [ 2018/08/03 ]

Merged to puppet#master in https://github.com/puppetlabs/puppet/commit/0b4b32c666cce76bc2c696c97dfffede15541e28

Comment by Josh Cooper [ 2018/08/03 ]

This passed CI awhile ago, resolving

Comment by Kenn Hussey [ 2018/08/28 ]

Henrik Lindberg please add release notes for this issue if needed, thanks!

Generated at Sun Jul 12 23:15:35 PDT 2020 using Jira 8.5.2#805002-sha1:a66f9354b9e12ac788984e5d84669c903a370049.