DisciplineAPI - MikeAWilliams/white_card GitHub Wiki

Note, the apis listed do not include authentication or authorization.

Discipline record

A discipline record consists of some basic public information about them as well as the authorizations they have for one or more diciplines

Example

{
  "id": "rapier",
  "name": "Rapier",
  "authorizations": ["offensive secondary", "defensive secondary"]
}

Schema

{
  "title": "Discipline Record",
  "type": "object",
  "required": ["id", "name", "authorizations"],
  "properties": {
    "id": {
      "type": "string",
      "description": "unique url friendly name of the dicipline"
    },
    "name": {
      "type": "string",
      "description": "the name of the dicipline"
    },
    "authorizations": {
      "type": "array",
      "description": "the authorizations availible in the dicipline",
      "items":{
        "type":"string"
      }       
    },
  }
}

API

GET /api/v1/disciplines

Description

retrieve all discipline data

Request Body

none

Response

200 Successful

{
   "diciplines": [ {"All Dicipline Records as above"}]
}

GET /api/v1/disciplines/id

Description

retrieve discipline data for discipline with id

Request Body

none

Response

200 Successful, 404 Not found

Successful response Body

{
"A discipline data as above"
}

POST /api/v1/disciplines/id

Description

Create a new discipline data with the provided id card number

Request Body

{
"A discipline data as above"
}

Response

200 Successful, 403 Discipline already exists

Error response Body

{
"The existing discipline data as above"
}

PUT /api/v1/disciplines/id

Description

Replace an existing discipline data with the one in the body for the given id

Request Body

{
"A discipline data as above"
}

Response

200 Successful, 404 Discipline not found

Successful response body

{
"old":"The previous existing discipline data as above",
"new":"The discipline data as in the body of the request as above"
}

DELETE /api/v1/disciplines/id

Description

Delete the discipline associated with the id

Request Body

none

### Response
200 Successful, 404 Discipline not found
### Successful response body
```json
{
"The discipline record that was deleted as above",
}