# NAME Swagger2::Markdown - convert a Swagger2 spec to various markdown formats
# VERSION 0.04 # DESCRIPTION This module allows you to convert a swagger specification file to API Blueprint markdown and basic markdown. Note that this module is EXPERIMENTAL and a work in progress. You may also need to add `x-` values to your swagger config file to get better markdown output. # SYNOPSIS use strict; use warnings; use Swagger2; use Swagger2::Markdown; my $s2md = Swagger2::Markdown->new( swagger2 => Swagger2->new->load( $path_to_swagger_spec ) ); my $api_blueprint_string = $s2md->api_blueprint; my $basic_markdown = $s2md->markdown( %pod_markdown_opts ); # ATTRIBUTES ## swagger2 The [Swagger2](https://metacpan.org/pod/Swagger2) object, required at instantiation # METHODS ## markdown Returns a string of markdown using the [Pod::Markdown](https://metacpan.org/pod/Pod::Markdown) parser - the pod string is retrieved from the ->pod method of [Swagger2](https://metacpan.org/pod/Swagger2). As the parser is [Pod::Markdown](https://metacpan.org/pod/Pod::Markdown) you can pass in a hash of arguments that will be passed on to the [Pod::Markdown](https://metacpan.org/pod/Pod::Markdown) instantiation call: my $markdown = $s2md->markdown( %pod_markdown_opts ); ## api\_blueprint Returns a string of markdown in API Blueprint format. Because API Blueprint is more of a documentation orientated approach there are some sections that it contains that are not present in the swagger2 spec. Refer to the API Blueprint specification for the following terms: [https://github.com/apiaryio/api-blueprint/blob/master/API%20Blueprint%20Specification.md](https://github.com/apiaryio/api-blueprint/blob/master/API%20Blueprint%20Specification.md) You should add `x-api-blueprint` sections to the swagger2 config to define which format of API Blueprint output you want and to add extra summary and method documentation. The main layout of the API Blueprint file is defined as so in the top level of the swagger config file (YAML example here with defaults shown): x-api-blueprint: resource_section: method_uri action_section: method_uri attributes: false simple: false data_structures: false Possible values for resource\_section are: uri - #