Koha::REST::V1 - Main v.1 REST api class
Overloaded Mojolicious->startup method. It is called at application startup.
my $xml_string = to_xml( $json_hashref );
Converts a JSON-like hashref into an XML string.
_json_to_xml( $data, $parent_node, $xml_doc );
Internal recursive helper for to_xml to build XML elements from nested Perl structures.
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.
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( $node, $hash, $is_array, $schema_definitions );
Internal recursive helper for parse_xml to populate a Perl hashref from XML elements.