hendrikmaus/spas

View on GitHub
example/api-description-altered--spas.apib

Summary

Maintainability
Test Coverage
FORMAT: 1A

# Branda Test Case
This file is ought to be used as input to spas.

# Camera Collection [/cameras]

## Get All cameras [GET]
Test case for the text/plain validator.
The api output must match exactly when it is used.

+ Response 200 (text/plain)
Simulate a rather long text/plain error
    
    + Body
    
        ```
        - Canon 80D
        - Panasonic GH4
        - Something
        - Other
        - to
        - repeat
        - Canon 80D
        - Panasonic GH4
        - Something
        - Other
        - to
        - repeat
        - Canon 80D
        - Panasonic GH4
        - Something
        - Other
        - to
        - repeat
        - Canon 80D
        - Panasonic GH4
        - Something
        - Other
        - to
        - repeat
        - Canon 80D
        - Panasonic GH4
        - Something
        - Other
        - to
        - repeat
        - Canon 80D
        - Panasonic GH4
        - Something
        - Other
        - to
        - repeat
        - Canon 80D
        - Panasonic GH4
        - Something
        - Other
        ```

## Add Camera [POST]
Test case for the no content validator.

+ Request Add Camera (application/json)
    + Attributes (Camera)

+ Response 201 (application/json)
    + Attributes (Camera)
    
# GET /cameras/{id}
Test case for json schema validator.

+ Parameters
    + id: `5645s` (string, required)

+ Response 200 (application/json)
    + Attributes (Camera)

# GET /exception
Spas thinks this has to return a 200, but it will return a 500 

+ Response 200 (application/json)
    
    ```
    {
      "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html",
      "title": "Bad Request",
      "detail": "Example exception",
      "code": "EXCEPTION_EXAMPLE"
    }
    ```

# GET /exception/pass

+ Response 500 (application/json)
    + Attributes (Exception)

# GET /system/health

+ Response 200 (application/json)
    + Attributes (Health)
    
# GET /polling

+ Response 202 (application/json)
    + Headers
    
            Retry-After: 1
    
    + Attributes (Poll)
        
+ Response 200 (application/json)
    + Attributes (Poll)
    
# GET /polling/unsupported

+ Response 202 (application/json)
    + Headers
    
            Retry-After: 2016-11-02T14:51:53+01:00
    
    + Attributes (Poll)
    
+ Response 200 (application/json)
    + Attributes (Poll)

# Data Structures

## Camera
+ id: `cf4536` (string, required)
+ model: `80D` (string, required)
+ vendor: `Canon` (string, required)

## Exception
+ type: `http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html` (string, required)
+ title: `Bad Request` (string, required)
+ detail: `Example exception` (string, required)
+ code: `EXCEPTION_EXAMPLE` (string, required)

## Health
+ version: `324cbh` (string, required)

## Poll
+ msg: `I am a polling set` (string, required)