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

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

Loading…
Cancel
Save