Skip to content

AppStackTop/phpdraft

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHPDraft Build Status

This is a parser for API Blueprint files in PHP.1

Usage

Requires PHP 5.6+ to run. Unittests require runkit or uopz For direct usage you can run:

$ ./phpdraft.phar -f blueprint-file.apib > blueprint-webpage.html

You can also install it first:

$ cp phpdraft.phar /usr/bin/phpdraft
$ chmod +x /usr/bin/phpdraft
$ phpdraft -f blueprint-file.apib > blueprint-webpage.html

Extra features

We got some fun stuff, check the wiki for more.

Writing API documentation

For writing API documentation using API Blueprint syntax. You can read about its specification.

Here's the example:

FORMAT: 1A
HOST: https://api.example.com/v1

# Hello API

A simple API demo

# Group People

This section describes about the People

## Person [/people/{id}]

Represent particular Person

+ Parameters

    + id (required, string, `123`) ... The id of the Person.

+ Model (application/json)

    ```
    {"name":"Gesang","birthdate":"01-09-1917"}
    ```

### Retrieve Person [GET]

Return the information for the Person

+ Request (application/json)

    + Headers

        ```
        Authorization: Basic AbcdeFg=
        ```

+ Response 200 (application/json)

    [Person][]

Dependencies

PHPDraft requires drafter to be installed. Refer to the drafter page for the installation details.

Building an executable

Install phpab and put it in your path. Run ant phar or ant phar-nightly

Libraries

This app usage the following libraries:

About

An API Blueprint parser in PHP

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 82.0%
  • HTML 8.4%
  • API Blueprint 7.8%
  • Other 1.8%