Skip to content

zurborg/libtext-api-blueprint-perl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NAME

Text::API::Blueprint - ...

VERSION

version 0.001

FUNCTIONS

Section

Invokation: Section( CodeRef $coderef, [ Int $offset = 1 ] )

Increments header offset by $offset for everything executed in $coderef.

Meta

Invokation: Meta( [ Str $host ] )

FORMAT: 1A8
HOST: $host

Intro

Invokation: Intro( Str $name, Str $description )

# $name
$description

Concat

Invokation: Concat( Str @blocks )

$block[0]

$block[1]

$block[2]

...

Text

Invokation: Text( Str @strings )

$string[0]
$string[1]
$string[2]
...

Code

Invokation: Code( Str $code, [ Str $lang = '' ], [ Int $delimiters = 3 ] )

```$lang
$code
```

Group

Invokation: Group( Str $identifier, Str|ArrayRef[HashRef|Str] $body, [ Int $indent ] )

If $body is an ArrayRef, every item which is a HashRef will be passed to "Resource".

# Group $identifier

$body

Resource

Invokation: Resource( Str :$method, Str :$uri, Str :$identifier, Str|CodeRef :$body, Int :$indent, Int :$level, HashRef :$parameters, HashRef :$model, ArrayRef :$actions )

With $method and $uri

## $method $uri

$body

With $identifier and $uri

## $identifier [$uri]

$body

With $uri

## $uri

$body

Model

Invokation: Model( Str $media_type, Str|HashRef $payload, [ Int $indent ] )

See "Payload" if $payload is a HashRef.

+ Model ($media_type)

$payload

Schema

Invokation: Schema( Str $body, [ Int $indent ] )

+ Schema

$body

Action

Invokation: Action( Str :$method, Str :$uri, Str :$identifier, Str|CodeRef :$body, Int :$indent, Int :$level, Str :$relation, HashRef :$parameters, ArrayRef :$assets, ArrayRef :$request, ArrayRef :$requests, ArrayRef :$response, ArrayRef :$responses )

With $identifier $method and $uri:

### $identifier [$method $uri]

$body

With $identifier and $method:

### $identifier [$method]

$body

With $method:

### $method

$body

Payload

Invokation: Payload( Str :$description, HashRef :$headers, Str :$body, Str :$code, Str :$lang, AnyRef :$yaml, AnyRef :$json, Str :$schema )

Complete output:

$description

+ Headers
        $key: $value

+ Body

$body

+ Schema

$schema

With $code and $lang:

+ Body

    ```$lang
    $code
    ```

With $yaml:

+ Body

    ```yaml
    $yaml
    ```

With $json:

+ Body

    ```json
    $json
    ```

Asset

Invokation: Asset( Str $keyword, Str $identifier, Str :$type, %payload )

See "Payload" for %payload

# $keyword $identifier ($type)

$payload

Reference

Invokation: Reference( Str $keyword, Str $identifier, Str $reference )

# $keyword $identifier

    [$reference][]

Request

Invokation: Request( @args )

Calls "Asset"( 'Request', @args )

Request_Ref

Invokation: Request_Ref( @args )

Calls "Reference"( 'Request', @args )

Response

Invokation: Response( @args )

Calls "Asset"( 'Response', @args )

Response_Ref

Invokation: Response_Ref( @args )

Calls "Reference"( 'Response', @args )

Parameters

Invokation: Parameters( [ Str $name => HashRef $options ]* )

For every keypair, "Parameter"($name, %$options) will be called

Parameter

Invokation: Parameter( Str $name, Str :$example, Bool :$required, Bool :$optional, Str :$type, Str :$enum, Str :$shortdesc, Str|ArrayRef[Str] :$longdesc, Str :$default, HashRef :$members )

+ $name: `$example` ($type, $required_or_optional) - $shortdesc

    $longdesc

    + Default: `$default`

    + Members
        + `$key` - $value
        + ...

Headers

Invokation: Headers( [ Str $key => Str $value ]* )

+ Headers
    $key: $value
    ...

Body

Invokation: Body( Str $body )

+ Body

        $body

Body_CODE

Invokation: Body_CODE( Str $code, Str $lang )

+ Body

    ```$lang
    $code
    ```

Body_YAML

Invokation: Body_YAML( AnyRef $struct )

+ Body

    ```yaml
    $struct
    ```

Body_JSON

Invokation: Body_JSON( AnyRef $struct )

+ Body

    ```json
    $struct
    ```

Relation

Invokation: Relation( Str $link )

+ Relation: $link

BUGS

Please report any bugs or feature requests on the bugtracker website https://github.com/zurborg/libtext-api-blueprint-perl/issues

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

AUTHOR

David Zurborg zurborg@cpan.org

COPYRIGHT AND LICENSE

This software is Copyright (c) 2015 by David Zurborg.

This is free software, licensed under:

The ISC License

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages