sphinxcontrib.httpdomain — Documenting RESTful HTTP APIs

Directives

PATCH /users/(int: user_id)/posts/(tag)
OPTIONS /users/(int: user_id)/posts/(tag)
GET /users/(int: user_id)/posts/(tag)
HEAD /users/(int: user_id)/posts/(tag)
POST /users/(int: user_id)/posts/(tag)
PUT /users/(int: user_id)/posts/(tag)
DELETE /users/(int: user_id)/posts/(tag)
TRACE /users/(int: user_id)/posts/(tag)
CONNECT /users/(int: user_id)/posts/(tag)
COPY /users/(int: user_id)/posts/(tag)

Sourcecode

GET /users/123/posts/web HTTP/1.1
Host: example.com
Accept: application/json, text/javascript
HTTP/1.1 200 OK
Vary: Accept
Content-Type: text/javascript

[
  {
    "post_id": 12345,
    "author_id": 123,
    "tags": ["server", "web"],
    "subject": "I tried Nginx"
  },
  {
    "post_id": 12346,
    "author_id": 123,
    "tags": ["html5", "standards", "web"],
    "subject": "We go to HTML 5"
  }
]

Resource fields

GET /foo
Query Parameters:
 
  • resource – description for resource
Status Codes:
GET /short-syntax
Request Headers:
 
Request JSON Object:
 
  • foo (string) – Foo key value
  • bar (number) – Bar key value
Response Headers:
 
Response JSON Array of Objects:
 
  • baz (string) – Some baz field
Status Codes:

Options

GET /bar
PUT /baz
POST /baz

Here be Errors!

A request with method foo followed by bar and x-baz headers receives response with 42 Answer status code.

sphinxcontrib.autohttp.flask — Exporting API reference from Flask app

Basic option

GET /

Home page.

GET /(user)/posts/(int: post_id)

User’s post.

Parameters:
  • user – user login name
  • post_id – post unique id
Status Codes:
GET /(user)

User profile page.

Parameters:
  • user – user login name
Status Codes:

Basic option with empty args

GET /

Home page.

GET /(user)/posts/(int: post_id)

User’s post.

Parameters:
  • user – user login name
  • post_id – post unique id
Status Codes:
GET /(user)

User profile page.

Parameters:
  • user – user login name
Status Codes:

Filter some endpoints

GET /(user)

User profile page.

Parameters:
  • user – user login name
Status Codes:
GET /(user)/posts/(int: post_id)

User’s post.

Parameters:
  • user – user login name
  • post_id – post unique id
Status Codes:

Documenting by non-ASCII characters

GET /

홈 페이지.

GET /(user)/posts/(int: post_id)

사용자의 게시물.

Parameters:
  • user – 사용자 접속명
  • post_id – 게시물의 고유 번호
Status Codes:
  • 200 OK – 사용자와 게시물이 존재함
  • 404 Not Found – 사용자 혹은 게시물이 존재하지 않음
GET /(user)

사용자 정보 페이지.

Parameters:
  • user – 사용자 접속명
Status Codes: