<<

NAME

Koha::REST::V1 - Main v.1 REST api class

API

Class Methods

startup

Overloaded Mojolicious->startup method. It is called at application startup.

to_xml

    my $xml_string = to_xml( $json_hashref );

Converts a JSON-like hashref into an XML string.

_json_to_xml

    _json_to_xml( $data, $parent_node, $xml_doc );

Internal recursive helper for to_xml to build XML elements from nested Perl structures.

validate_json_payload

    my $is_valid = $self->validate_json_payload( $c, $payload );

Validates a JSON payload against the REST API OpenAPI/Swagger schema. Returns 1 if valid, 0 if there are errors.

parse_xml

    my $hashref = parse_xml( $xml_node, $spec_file );

Converts an XML::LibXML::Node into a Perl hashref, using the OpenAPI schema definitions to correctly identify and cast array properties.

_parse_node

    _parse_node( $node, $hash, $is_array, $schema_definitions );

Internal recursive helper for parse_xml to populate a Perl hashref from XML elements.

<<