Loading ...
Sorry, an error occurred while loading the content.

6473Serializing blessed hash ref changed from 0.710.8 to 0.711?

Expand Messages
  • jcroall
    Apr 19, 2010
    • 0 Attachment

      I have written some (perhaps too clever) code that attempts to enforce a strict API when calling a web service. Users must pass in blessed hashrefs and these hashrefs may only have specific fields filled in. The idea was to avoid headaches caused by typos and the resulting blank fields.

      When moving from 0.710.8 to 0.711 this suddenly stopped working. For an array of these blessed hashrefs, the resulting XML includes the name of the object!

      For example, this raw data:

      $VAR1 = bless( {
      'name' => 'TestProject22669',
      'streams' => [
      bless( {
      'language' => 'CXX',
      'name' => 'TestProject22669',
      'type' => 'SOURCE',
      'description' => 'Source code stream'
      }, 'Coverity::WS::ProjectService::streamSpecDataObj' ),
      bless( {
      'language' => 'CXX',
      'name' => 'TestProject22669',
      'type' => 'STATIC',
      'description' => 'Static Analysis Stream'
      }, 'Coverity::WS::ProjectService::streamSpecDataObj' )
      'description' => 'Description of TestProject22669'
      }, 'Coverity::WS::ProjectService::projectSpecDataObj' );

      Ends up looking like this:

      <soap:Body><ws:createProject><projectSpec><name>TestProject22669</name><streams><Coverity__WS__ProjectService__streamSpecDataObj><language>CXX</language><name>TestProject22669</name><type>SOURCE</type><description>Source code stream</description></Coverity__WS__ProjectService__streamSpecDataObj><Coverity__WS__ProjectService__streamSpecDataObj><language>CXX</language><name>TestProject22669</name><type>STATIC</type><description>Static Analysis Stream</description></Coverity__WS__ProjectService__streamSpecDataObj></streams><description>Description of TestProject22669</description></projectSpec></ws:createProject></soap:Body>

      Note the <Coverity__WS__ProjectService__streamSpecDataObj> tags.

      What am I missing?


      - James