sub process()

in build/parse_spec_base.pl [66:106]


sub process {
#===================================
    my ( $name, $defn ) = @_;
    my %spec;

    # body
    if ( my $body = $defn->{body} ) {
        $spec{body}
            = $body->{required}
            ? { required => 1 }
            : {};
        if ( $body->{serialize} && $body->{serialize} eq 'bulk' ) {
            $spec{serialize} = 'bulk';
        }
    }
    
    # method
    my $method = $spec{method} = $defn->{methods}[0];
    delete $spec{method} if $method eq 'GET';
    
    # paths
    my $url = $defn->{url};
    $spec{paths} = process_paths( $name, $method, $url );

    # parts
    my $parts = $spec{parts} = process_parts( $url->{parts} );

    # filter path
    my %qs = ( %Common, process_qs( $url->{params} ) );
    for ( keys %$parts ) {
        delete $qs{$_};
    }

    $spec{qs} = \%qs;

    # doc
    if ( $defn->{documentation} ) {
        $spec{doc} = $defn->{documentation} =~ m{/([^/]+)\.html$} ? $1 : '';
    }
    return \%spec;
}