[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

 Description   

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.



 Comments   
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 Wed Oct 16 02:53:59 PDT 2019 using JIRA 7.7.1#77002-sha1:e75ca93d5574d9409c0630b81c894d9065296414.