Mojolic...ameters(3)
πΈ NAME πΈ
okay bestie, say hi to Mojolicious::Plugin::OpenAPI::Parameters β literally Methods for transforming data from/to JSON::Validator::Schema. This is a User Contributed Perl Documentation moment, and itβs giving very helpful helper-module energy. π
β¨
π DESCRIPTION π
Mojolicious::Plugin::OpenAPI::Parameters adds helpers to your Mojolicious application, required by Mojolicious::Plugin::OpenAPI. These helpers can be redefined in case you have special needs. no cap, theyβre customizable like that π«Ά
π οΈ HELPERS π οΈ
π openapi.build_response_body π
$bytes = $c->openapi->build_response_body(Mojo::Asset->new);
$bytes = $c->openapi->build_response_body($data);
Takes validated data and turns it into bytes that will be used as HTTP response body. This method is useful to override, in case you want to render some other structure than JSON. highkey iconic override potential π
π openapi.build_schema_request π
$hash_ref = $c->openapi->build_schema_request;
Builds input data for "validate_request" in JSON::Validator::Schema::OpenAPIv2. slay, itβs building that request-validation input β¨
π openapi.build_schema_response π
$hash_ref = $c->openapi->build_schema_response;
Builds input data for "validate_response" in JSON::Validator::Schema::OpenAPIv2. same vibe, but for the response side of the group chat π¦
π openapi.coerce_request_parameters π
$c->openapi->coerce_request_parameters(\@evaluated_parameters);
Used by Mojolicious::Plugin::OpenAPI to write the validated data back to "req" in Mojolicious::Controller and "output" in Mojolicious::Validator::Validation. itβs literally putting the validated data back where it belongs π«
π openapi.coerce_response_parameters π
$c->openapi->coerce_response_parameters(\@evaluated_parameters);
Used by Mojolicious::Plugin::OpenAPI to write the validated data to "res" in Mojolicious::Controller. response data getting its little moment π
π openapi.parse_request_body π
$hash_ref = $c->openapi->parse_request_body;
Returns a structure representing the request body. The default is to parse the input as JSON:
{content_type => "application/json", exists => !!$c->req->body_size, value => $c->req->json};
This method is useful to override, in case you want to parse some other structure than JSON. bestie, the default is JSON-coded, but you can absolutely do your own thing π
π§ METHODS π§
β¨ register β¨
$self->register($app, \%config);
This method will add the HELPERS to your Mojolicious $app. periodt, thatβs how they get in there π«Ά
π SEE ALSO π
Mojolicious::Plugin::OpenAPI. go read that one too, iykyk π
mwah π this page is from perl v5.42.0, dated 2025-08-03. iconic, honestly. ππ¦
π¦ where this page comes from
- opensuse-leap 16.0: perl-Mojolicious-Plugin-OpenAPI 5.110.0-bp160.1.1 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms