Commit 394b7c3a authored by Nigel Kukard's avatar Nigel Kukard
Browse files

Merge branch 'introspection4' into 'master'

Example updates

See merge request !21
parents b0a25202 bb5eca0c
......@@ -264,7 +264,7 @@ See the 'status' field definition above for examples.
### API information using /
Using the PROPFIND method request to http://www.example.com may look like this...
Using the PROPFIND method response to http://www.example.com may look like this...
```jsonnet
{
"status": "success",
......@@ -284,7 +284,7 @@ Using the PROPFIND method request to http://www.example.com may look like this..
### Collection list using path /*
An OPTIONS method request to http://www.example.com/\* may look like this...
An OPTIONS method response to http://www.example.com/\* may look like this...
```jsonnet
{
"status": "success",
......@@ -300,140 +300,302 @@ An OPTIONS method request to http://www.example.com/\* may look like this...
### Collection information
A OPTIONS method request to http://www.example.com/issues may look like this...
A OPTIONS method response to http://www.example.com/issues may look like this...
```jsonnet
{
"POST": {
"description": "Create an issue",
"path": "/issues",
"parameters": {
"title": {
"type": "string"
"description": "Issue title.",
"required": true
},
"body": {
"type": "string",
"description": "Issue body.",
},
"assignee": {
"type": "string",
"description" "Login for the user that this issue should be assigned to."
},
"milestone": {
"type": "number",
"description": "Milestone to associate this issue with."
},
"labels": {
"type": "array/string"
"description": "Labels to associate with this issue."
}
},
"returns": {
"status": {
"type": "status",
"description": "Result of request"
},
"data": {
"type": "hash",
"description": "Data hash containing record details, returned only on success",
"children": {
"record_id": {
"type": "integer",
"description": "ID of the created record"
"status": "success",
"data": {
"result": {
"methods": {
"POST": {
"description": "Create an issue",
"path": "/issues",
"payload": {
"title": {
"type": "string",
"description": "Issue title.",
"required": true
},
"body": {
"type": "string",
"description": "Issue body."
},
"assignee": {
"type": "string",
"description" "Login for the user that this issue should be assigned to."
},
"milestone": {
"type": "number",
"description": "Milestone to associate this issue with."
},
"labels": {
"type": ["array","string"],
"description": "Labels to associate with this issue."
}
},
"returns": {
"status": {
"type": "status",
"description": "Result of request"
},
"data": {
"type": "hash",
"description": "Hash containing result of action, returned only on success",
"children": {
"result": {
"type": "hash",
"description": "Hash containing created record details",
"children": {
"record": {
"type": "hash",
"description": "Record hash"
}
}
}
}
}
},
"example": {
"title": "Found a bug",
"body": "I'm having a problem with this.",
"assignee": "octocat",
"milestone": 1,
"labels": [
"Label1",
"Label2"
]
}
},
"GET": {
"description": "Retrieve issue(s)",
"path": ["/issues","/issues/:record_id"],
"url": {
":record_id": {
"type": "integer",
"description": "Record ID",
}
},
"returns": {
"status": {
"type": "status",
"description": "Result of request"
},
"data": {
"type": "hash",
"description": "Hash containing result of action, returned only on success",
"children": {
"result": {
"type": "hash",
"description": "Hash containing record details",
"children": {
"record": {
"type": "hash",
"description": "Record hash, returned for a single record request only"
},
"records": {
"type": "array",
"description": "Array of records, returned for a multi-record request only"
}
}
}
}
}
}
},
"DELETE": {
"description": "Delete an item",
"path": "/issues/:record_id",
"url": {
":record_id": {
"type": "integer",
"description": "Record ID",
"required": true
}
},
"returns": {
"status": {
"type": "status",
"description": "Result of request"
}
}
},
"PATCH": {
"description": "Change an issue",
"path": "/issues/:record_id",
"url": {
":record_id": {
"type": "integer",
"description": "Record ID",
"required": true
}
},
"payload": {
"title": {
"type": "string",
"description": "Issue title.",
"required": true
},
"body": {
"type": "string",
"description": "Issue body."
},
"assignee": {
"type": "string",
"description" "Login for the user that this issue should be assigned to."
},
"milestone": {
"type": "number",
"description": "Milestone to associate this issue with."
},
"labels": {
"type": ["array","string"],
"description": "Labels to associate with this issue."
}
},
"returns": {
"status": {
"type": "status",
"description": "Result of request"
},
"data": {
"type": "hash",
"description": "Hash containing result of action, returned only on success",
"children": {
"result": {
"type": "hash",
"description": "Hash containing changed record details",
"children": {
"record": {
"type": "hash",
"description": "Record hash"
}
}
}
}
}
}
},
"PUT": {
"description": "Replace an issue",
"path": "/issues/:record_id",
"url": {
":record_id": {
"type": "integer",
"description": "Record ID",
"required": true
}
},
"payload": {
"title": {
"type": "string",
"description": "Issue title.",
"required": true
},
"body": {
"type": "string",
"description": "Issue body."
},
"assignee": {
"type": "string",
"description" "Login for the user that this issue should be assigned to."
},
"milestone": {
"type": "number",
"description": "Milestone to associate this issue with."
},
"labels": {
"type": ["array","string"],
"description": "Labels to associate with this issue."
}
},
"returns": {
"status": {
"type": "status",
"description": "Result of request"
},
"data": {
"type": "hash",
"description": "Hash containing result of action, returned only on success",
"children": {
"result": {
"type": "hash",
"description": "Hash containing replaced record details",
"children": {
"record": {
"type": "hash",
"description": "Record hash"
}
}
}
}
}
}
},
"OPTIONS": {
"description": "Issue information",
"path": "/issues/:record_id",
"url": {
":record_id": {
"type": "string",
"description": "This is a string literal ':record_id'",
"required": true
}
},
"returns": {
"status": {
"type": "status",
"description": "Result of request"
},
"data": {
"type": "hash",
"description": "Hash containing result of action, returned only on success",
"children": {
"result": {
"type": "hash",
"description": "Hash containing record properties",
"children": {
"properties": {
"type": "hash",
"description": "Record properties hash"
}
}
}
}
}
}
},
"PROPFIND": {
"description": "Collection information",
"path": "/issues",
"returns": {
"status": {
"type": "status",
"description": "Result of request"
},
"data": {
"type": "hash",
"description": "Hash containing result of action, returned only on success",
"children": {
"result": {
"type": "hash",
"description": "Hash containing collection information",
"children": {
"definition": {
"type": "hash",
"description": "Record definition hash"
},
"records": {
"type": "integer",
"description": "Number of items in collection"
}
}
}
}
}
}
}
}
}
"example": {
"title": "Found a bug",
"body": "I'm having a problem with this.",
"assignee": "octocat",
"milestone": 1,
"labels": [
"Label1",
"Label2"
]
}
}
"DELETE": {
"description": "Delete an item",
"path": "/issues/:record_id",
"parameters": {
"record_id": {
"type": "integer"
"description": "Record ID",
"required": true
},
},
"returns": {
"status": {
"type": "status",
"description": "Result of request"
},
}
}
"PATCH": {
"description": "Change an item",
"path": "/issues/:record_id",
"parameters": {
"record_id": {
"type": "integer"
"description": "Record ID",
"required": true
},
},
"returns": {
"status": {
"type": "status",
"description": "Result of request"
},
}
}
"PUT": {
"description": "Replace an item",
"path": "/issues/:record_id",
"parameters": {
"record_id": {
"type": "integer"
"description": "Record ID",
"required": true
},
},
"returns": {
"status": {
"type": "status",
"description": "Result of request"
},
}
},
"OPTIONS": {
"description": "Record information",
"path": "/issues/:record_id",
"parmaeters": {
":record_id": {
"type": "string",
"description": "This is a string literal ':record_id'",
"required": true,
}
},
"returns": {
"status": {
"type": "status",
"description": "Result of request"
},
}
},
"PROPFIND": {
"description": "Collection information",
"path": "/issues",
"parameters": { },
"returns": {
"records": {
"type": "integer",
"description": "Number of items in collection",
}
}
}
}
```
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment