Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-8976

A hash containing the key __ptype cannot be serialized using the human readable JSON format

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • None
    • PUP 6.0.0
    • Docs, Language, Type System
    • None
    • Platform Core
    • Needs Assessment
    • Bug Fix
    • Hide
      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).
      Show
      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).
    • 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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            henrik.lindberg Henrik Lindberg
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Zendesk Support