Add profile API examples and extract examples for template usage.

pull/977/head
Kegan Dougal 10 years ago
parent fe7ffafc15
commit 5795e1ceda

@ -42,6 +42,9 @@ paths:
responses: responses:
200: 200:
description: The display name was set. description: The display name was set.
examples:
application/json: |-
{}
schema: schema:
type: object # empty json object type: object # empty json object
429: 429:
@ -59,6 +62,11 @@ paths:
responses: responses:
200: 200:
description: The display name for this user. description: The display name for this user.
examples:
application/json: |-
{
"displayname": "Alice Margatroid"
}
schema: schema:
type: object type: object
properties: properties:
@ -91,6 +99,9 @@ paths:
responses: responses:
200: 200:
description: The avatar URL was set. description: The avatar URL was set.
examples:
application/json: |-
{}
schema: schema:
type: object # empty json object type: object # empty json object
429: 429:
@ -108,6 +119,11 @@ paths:
responses: responses:
200: 200:
description: The avatar URL for this user. description: The avatar URL for this user.
examples:
application/json: |-
{
"avatar_url": "mxc://matrix.org/SDGdghriugerRg"
}
schema: schema:
type: object type: object
properties: properties:

@ -184,7 +184,10 @@ class MatrixUnits(Units):
"code": 200, "code": 200,
"http": "200 OK", "http": "200 OK",
"desc": res200["description"], "desc": res200["description"],
"params": res200params "params": res200params,
"example": res200.get("examples", {}).get(
"application/json", ""
)
} }
endpoint["responses"].append(ok_res) endpoint["responses"].append(ok_res)

Loading…
Cancel
Save