($args{object_hint} = $args{package}) =~ s/::/_/go;
}
- OpenSRF::Utils::JSON->register_class_hint( name => $args{package}, hint => $args{object_hint}, type => "hash" );
+ OpenSRF::Utils::JSON->register_class_hint(
+ strip => ['session'],
+ name => $app,
+ hint => $args{object_hint},
+ type => "hash"
+ );
$_METHODS[$args{api_level}]{$args{api_name}} = bless \%args => $app;
$meth = $self->method_lookup($method,$proto,1);
}
- $meth->session($self->session) if $meth; # Pass the caller's session
+ $meth->session($self->session) if $meth && ref($self); # Pass the caller's session
return $meth;
}
if(UNIVERSAL::isa($obj, 'HASH')) {
$jsonobj = {};
- $jsonobj->{$_} = $pkg->perl2JSONObject($obj->{$_}) for (keys %$obj);
+ for my $k (keys %$obj) {
+ next if (
+ $ref ne 'HASH'
+ and exists $_class_map{classes}{$ref}{strip}
+ and grep { $k eq $_ } @{$_class_map{classes}{$ref}{strip}}
+ );
+ $jsonobj->{$k} = $pkg->perl2JSONObject($obj->{$k});
+ }
} elsif(UNIVERSAL::isa($obj, 'ARRAY')) {
$jsonobj = [];
$jsonobj->[$_] = $pkg->perl2JSONObject($obj->[$_]) for(0..scalar(@$obj) - 1);