GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
JSON::Validator::Schema::OpenAPIv3(3) User Contributed Perl Documentation JSON::Validator::Schema::OpenAPIv3(3)

JSON::Validator::Schema::OpenAPIv3 - OpenAPI version 3

See "SYNOPSIS" in JSON::Validator::Schema::OpenAPIv2.

This class represents <https://spec.openapis.org/oas/3.0/schema/2019-04-02>.

  my $array_ref = $schema->errors;

See "errors" in JSON::Validator::Schema.

  $str    = $schema->moniker;
  $schema = $schema->moniker("openapiv3");

Used to get/set the moniker for the given schema. Default value is "openapiv3".

  my $str    = $schema->specification;
  my $schema = $schema->specification($str);

Defaults to "<https://spec.openapis.org/oas/3.0/schema/2019-04-02>".

  $schema = $schema->add_default_response(\%params);

See "add_default_response" in JSON::Validator::Schema::OpenAPIv2 for details.

  $url = $schema->base_url;
  $schema = $schema->base_url($url);

Can get or set the default URL for this schema. $url can be either a Mojo::URL object or a plain string.

This method will read or write "/servers/0/url" in "data".

  my $schema   = $schema->coerce({booleans => 1, numbers => 1, strings => 1});
  my $hash_ref = $schema->coerce;

Coercion is enabled by default, since headers, path parts, query parameters, ... are in most cases strings.

  $schema = JSON::Validator::Schema::OpenAPIv2->new(\%attrs);
  $schema = JSON::Validator::Schema::OpenAPIv2->new;

Same as "new" in JSON::Validator::Schema, but will also build L/coerce>.

  $parameters = $schema->parameters_for_request([$method, $path]);

Finds all the request parameters defined in the schema, including inherited parameters. Returns "undef" if the $path and $method cannot be found.

Example return value:

  [
    {in => "query", name => "q"},
    {in => "body", name => "body", accepts => ["application/json"]},
  ]

The return value MUST not be mutated.

  $array_ref = $schema->parameters_for_response([$method, $path, $status]);

Finds the response parameters defined in the schema. Returns "undef" if the $path, $method and $status cannot be found. Will default to the "default" response definition if $status could not be found and "default" exists.

Example return value:

  [
    {in => "header", name => "X-Foo"},
    {in => "body", name => "body", accepts => ["application/json"]},
  ]

The return value MUST not be mutated.

  $collection = $schema->routes;

Shares the same interface as "routes" in JSON::Validator::Schema::OpenAPIv2.

  @errors = $schema->validate_request([$method, $path], \%req);

Shares the same interface as "validate_request" in JSON::Validator::Schema::OpenAPIv2.

  @errors = $schema->validate_response([$method, $path], \%req);

Shares the same interface as "validate_response" in JSON::Validator::Schema::OpenAPIv2.

JSON::Validator::Schema, JSON::Validator::Schema::OpenAPIv2 and and JSON::Validator.
2022-03-22 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.