<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">NAME
    Swagger2 - Swagger RESTful API Documentation

VERSION
    0.28

DESCRIPTION
    THIS MODULE IS EXPERIMENTAL! ANY CHANGES CAN HAPPEN!

    Swagger2 is a module for generating, parsing and transforming swagger
    &lt;http://swagger.io/&gt; API documentation. It has support for reading
    swagger specification in JSON notation and it can also read YAML files,
    if a "YAML parser" is installed.

    This distribution comes with a Mojolicious plugin,
    Mojolicious::Plugin::Swagger2, which can set up routes and perform input
    and output validation.

RECOMMENDED MODULES
    *   YAML parser

        A YAML parser is required if you want to read/write spec written in
        the YAML format. Supported modules are YAML::XS, YAML::Syck, YAML
        and YAML::Tiny.

SYNOPSIS
      use Swagger2;
      my $swagger = Swagger2-&gt;new("file:///path/to/api-spec.yaml");

      # Access the raw specification values
      print $swagger-&gt;tree-&gt;get("/swagger");

      # Returns the specification as a POD document
      print $swagger-&gt;pod-&gt;to_string;

ATTRIBUTES
  base_url
      $mojo_url = $self-&gt;base_url;

    Mojo::URL object that holds the location to the API endpoint. Note: This
    might also just be a dummy URL to &lt;http://example.com/&gt;.

  specification
      $pointer = $self-&gt;specification;
      $self = $self-&gt;specification(Mojo::JSON::Pointer-&gt;new({}));

    Holds a Mojo::JSON::Pointer object containing the Swagger 2.0 schema
    &lt;https://github.com/swagger-api/swagger-spec&gt;.

  tree
      $pointer = $self-&gt;tree;
      $self = $self-&gt;tree(Mojo::JSON::Pointer-&gt;new({}));

    Holds a Mojo::JSON::Pointer object containing your API specification.

  ua
      $ua = $self-&gt;ua;
      $self = $self-&gt;ua(Mojo::UserAgent-&gt;new);

    A Mojo::UserAgent used to fetch remote documentation.

  url
      $mojo_url = $self-&gt;url;

    Mojo::URL object that holds the location to the documentation file. This
    can be both a location on disk or an URL to a server. A remote resource
    will be fetched using Mojo::UserAgent.

METHODS
  expand
      $swagger = $self-&gt;expand;

    This method returns a new "Swagger2" object, where all the references
    &lt;https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.28&gt; are
    resolved.

  load
      $self = $self-&gt;load;
      $self = $self-&gt;load($url);

    Used to load the content from $url or "url". This method will try to
    guess the content type (JSON or YAML) by looking at the filename, URL
    path or "Content-Type" header reported by a web server.

  new
      $self = Swagger2-&gt;new($url);
      $self = Swagger2-&gt;new(%attributes);
      $self = Swagger2-&gt;new(\%attributes);

    Object constructor.

  parse
      $self = $self-&gt;parse($text);

    Used to parse $text instead of loading data from "url".

    The type of input text can be either JSON or YAML. It will default to
    YAML, but parse the text as JSON if it starts with "{".

  pod
      $pod_object = $self-&gt;pod;

    Returns a Swagger2::POD object.

  to_string
      $json = $self-&gt;to_string;
      $json = $self-&gt;to_string("json");
      $yaml = $self-&gt;to_string("yaml");

    This method can transform this object into Swagger spec.

  validate
      @errors = $self-&gt;validate;

    Will validate this object against the "specification", and return a list
    with all the errors found. See also "validate" in
    Swagger2::SchemaValidator.

COPYRIGHT AND LICENSE
    Copyright (C) 2014, Jan Henning Thorsen

    This program is free software, you can redistribute it and/or modify it
    under the terms of the Artistic License version 2.0.

AUTHOR
    Jan Henning Thorsen - "jhthorsen@cpan.org"

</pre></body></html>