.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "JSON::Validator::Schema::OpenAPIv3 3pm" .TH JSON::Validator::Schema::OpenAPIv3 3pm "2023-03-06" "perl v5.36.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" JSON::Validator::Schema::OpenAPIv3 \- OpenAPI version 3 .SH "SYNOPSIS" .IX Header "SYNOPSIS" See \*(L"\s-1SYNOPSIS\*(R"\s0 in JSON::Validator::Schema::OpenAPIv2. .SH "DESCRIPTION" .IX Header "DESCRIPTION" This class represents . .SH "ATTRIBUTES" .IX Header "ATTRIBUTES" .SS "errors" .IX Subsection "errors" .Vb 1 \& my $array_ref = $schema\->errors; .Ve .PP See \*(L"errors\*(R" in JSON::Validator::Schema. .SS "moniker" .IX Subsection "moniker" .Vb 2 \& $str = $schema\->moniker; \& $schema = $schema\->moniker("openapiv3"); .Ve .PP Used to get/set the moniker for the given schema. Default value is \*(L"openapiv3\*(R". .SS "specification" .IX Subsection "specification" .Vb 2 \& my $str = $schema\->specification; \& my $schema = $schema\->specification($str); .Ve .PP Defaults to "". .SH "METHODS" .IX Header "METHODS" .SS "add_default_response" .IX Subsection "add_default_response" .Vb 1 \& $schema = $schema\->add_default_response(\e%params); .Ve .PP See \*(L"add_default_response\*(R" in JSON::Validator::Schema::OpenAPIv2 for details. .SS "base_url" .IX Subsection "base_url" .Vb 2 \& $url = $schema\->base_url; \& $schema = $schema\->base_url($url); .Ve .PP Can get or set the default \s-1URL\s0 for this schema. \f(CW$url\fR can be either a Mojo::URL object or a plain string. .PP This method will read or write \*(L"/servers/0/url\*(R" in \*(L"data\*(R". .SS "coerce" .IX Subsection "coerce" .Vb 2 \& my $schema = $schema\->coerce({booleans => 1, numbers => 1, strings => 1}); \& my $hash_ref = $schema\->coerce; .Ve .PP Coercion is enabled by default, since headers, path parts, query parameters, \&... are in most cases strings. .SS "new" .IX Subsection "new" .Vb 2 \& $schema = JSON::Validator::Schema::OpenAPIv2\->new(\e%attrs); \& $schema = JSON::Validator::Schema::OpenAPIv2\->new; .Ve .PP Same as \*(L"new\*(R" in JSON::Validator::Schema, but will also build L/coerce>. .SS "parameters_for_request" .IX Subsection "parameters_for_request" .Vb 1 \& $parameters = $schema\->parameters_for_request([$method, $path]); .Ve .PP Finds all the request parameters defined in the schema, including inherited parameters. Returns \f(CW\*(C`undef\*(C'\fR if the \f(CW$path\fR and \f(CW$method\fR cannot be found. .PP Example return value: .PP .Vb 4 \& [ \& {in => "query", name => "q"}, \& {in => "body", name => "body", accepts => ["application/json"]}, \& ] .Ve .PP The return value \s-1MUST\s0 not be mutated. .SS "parameters_for_response" .IX Subsection "parameters_for_response" .Vb 1 \& $array_ref = $schema\->parameters_for_response([$method, $path, $status]); .Ve .PP Finds the response parameters defined in the schema. Returns \f(CW\*(C`undef\*(C'\fR if the \&\f(CW$path\fR, \f(CW$method\fR and \f(CW$status\fR cannot be found. Will default to the \&\*(L"default\*(R" response definition if \f(CW$status\fR could not be found and \*(L"default\*(R" exists. .PP Example return value: .PP .Vb 4 \& [ \& {in => "header", name => "X\-Foo"}, \& {in => "body", name => "body", accepts => ["application/json"]}, \& ] .Ve .PP The return value \s-1MUST\s0 not be mutated. .SS "routes" .IX Subsection "routes" .Vb 1 \& $collection = $schema\->routes; .Ve .PP Shares the same interface as \*(L"routes\*(R" in JSON::Validator::Schema::OpenAPIv2. .SS "validate_request" .IX Subsection "validate_request" .Vb 1 \& @errors = $schema\->validate_request([$method, $path], \e%req); .Ve .PP Shares the same interface as \*(L"validate_request\*(R" in JSON::Validator::Schema::OpenAPIv2. .SS "validate_response" .IX Subsection "validate_response" .Vb 1 \& @errors = $schema\->validate_response([$method, $path], \e%req); .Ve .PP Shares the same interface as \*(L"validate_response\*(R" in JSON::Validator::Schema::OpenAPIv2. .SH "SEE ALSO" .IX Header "SEE ALSO" JSON::Validator::Schema, JSON::Validator::Schema::OpenAPIv2 and and JSON::Validator.