Skip to content

Commit 2c225a7

Browse files
committed
api.yaml syntax fixes
1 parent bda612c commit 2c225a7

File tree

1 file changed

+68
-65
lines changed

1 file changed

+68
-65
lines changed

api.yaml

Lines changed: 68 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ tags:
2424
description: Endpoint for submitting a batch of requests at once.
2525
- name: Users
2626
description: Management of users and user-related info.
27-
- name: Onion:
27+
- name: Onion
2828
description: Submitting an onion request
2929
security:
3030
- pubkey: []
@@ -438,7 +438,7 @@ paths:
438438
schema:
439439
type: object
440440
403:
441-
description: permission denied: the calling user does not have room admin permission
441+
description: "permission denied: the calling user does not have room admin permission"
442442
404:
443443
description: >
444444
The given post was not found in this room or is ineligible for pinning (e.g. a whisper,
@@ -465,7 +465,7 @@ paths:
465465
schema:
466466
type: object
467467
403:
468-
description: permission denied: the calling user does not have room admin permission
468+
description: "permission denied: the calling user does not have room admin permission"
469469

470470
/room/{roomToken}/unpin/all:
471471
post:
@@ -480,13 +480,13 @@ paths:
480480
- $ref: "#/components/parameters/pathRoomToken"
481481
responses:
482482
200:
483-
description: successful operation: the room now has no pinned messages.
483+
description: "successful operation: the room now has no pinned messages."
484484
content:
485485
application/json:
486486
schema:
487487
type: object
488488
403:
489-
description: permission denied: the calling user does not have room admin permission
489+
description: "permission denied: the calling user does not have room admin permission"
490490

491491
/room/{roomToken}/file:
492492
post:
@@ -1163,7 +1163,7 @@ paths:
11631163
format: byte
11641164
bytes:
11651165
description: "Optional binary body, as raw octets. Exclusive of `b64` and `json`. Not recommended when using json unless the data happens to be mostly safe ascii"
1166-
trype: string
1166+
type: string
11671167
format: binary
11681168
responses:
11691169
200:
@@ -1231,48 +1231,51 @@ paths:
12311231
schema:
12321232
type: object
12331233
required: [endpoint, method, headers]
1234-
properties:
1235-
method:
1236-
type: string
1237-
description: "The request method type as a string, i.e. `GET`, `POST`, `PUT`, `DELETE`."
1238-
endpoint:
1239-
type: string
1240-
description: >
1241-
The request path, e.g. `/room/123/messages/since/45678`. This name should be
1242-
the full path beginning with a `/`; methods without a leading / are
1243-
interpreted as legacy endpoints for older versions of Session and should not
1244-
be used.
1245-
headers:
1246-
type: object
1247-
description: >
1248-
HTTP headers for the request; should usually include the pubkey, nonce,
1249-
timestamp, and signature headers (`X-SOGS-Pubkey`, etc.), and sometimes a
1250-
`Content-Type` header (the latter, if omitted, defaults to `application/json`
1251-
if using `body`, and `application/octet-stream` if using `body_binary`).
1252-
body:
1253-
description: >
1254-
Request body of the onion request. This is typically used for text-based
1255-
values (such as JSON requests). Exclusive of `body_binary`. Not accepted for
1256-
`GET` requests.
1257-
type: string
1258-
body_binary:
1259-
description: >
1260-
Request body for a onion request to a binary endpoint, with the body encoded
1261-
in base64. Exclusive of `body`. Not accepted for `GET` requests.
1262-
1263-
The endpoint will be called with the *decoded* byte value as its body, thus
1264-
allowing you to POST to endpoints that require binary data (such as file
1265-
uploads). Note that when using the Content-Type header defaults to
1266-
`application/octet-stream`.
1267-
1268-
Note that when including a signature in the `X-SOGS-Signature` header, the
1269-
signature must use the decoded byte value of the body, *not* the encoded
1270-
base64 value.
1271-
1272-
This is somewhat wasteful because of the overhead of base64-encoding, but is a
1273-
limitation of onion requests.
1274-
type: string
1275-
format: byte
1234+
properties:
1235+
method:
1236+
type: string
1237+
description: "The request method type as a string, i.e. `GET`, `POST`, `PUT`, `DELETE`."
1238+
endpoint:
1239+
type: string
1240+
description: >
1241+
The request path, e.g. `/room/123/messages/since/45678`. This name should be
1242+
the full path beginning with a `/`; methods without a leading / are
1243+
interpreted as legacy endpoints for older versions of Session and should not
1244+
be used.
1245+
headers:
1246+
type: object
1247+
description: >
1248+
HTTP headers for the request; should usually include the pubkey, nonce,
1249+
timestamp, and signature headers (`X-SOGS-Pubkey`, etc.), and sometimes a
1250+
`Content-Type` header (the latter, if omitted, defaults to `application/json`
1251+
if using `body`, and `application/octet-stream` if using `body_binary`).
1252+
body:
1253+
description: >
1254+
Request body of the onion request. This is typically used for text-based
1255+
values (such as JSON requests). Exclusive of `body_binary`. Not accepted for
1256+
`GET` requests.
1257+
type: string
1258+
body_binary:
1259+
description: >
1260+
Request body for a onion request to a binary endpoint, with the body encoded
1261+
in base64. Exclusive of `body`. Not accepted for `GET` requests.
1262+
1263+
1264+
The endpoint will be called with the *decoded* byte value as its body, thus
1265+
allowing you to POST to endpoints that require binary data (such as file
1266+
uploads). Note that when using the Content-Type header defaults to
1267+
`application/octet-stream`.
1268+
1269+
1270+
Note that when including a signature in the `X-SOGS-Signature` header, the
1271+
signature must use the decoded byte value of the body, *not* the encoded
1272+
base64 value.
1273+
1274+
1275+
This is somewhat wasteful because of the overhead of base64-encoding, but is a
1276+
limitation of onion requests.
1277+
type: string
1278+
format: byte
12761279
responses:
12771280
200:
12781281
description: >
@@ -1360,23 +1363,23 @@ components:
13601363
pinned_messages:
13611364
type: array
13621365
items:
1363-
type: object
1364-
properties:
1365-
id:
1366-
type: integer
1367-
format: int64
1368-
description: The numeric message id.
1369-
pinned_at:
1370-
type: number
1371-
format: double
1372-
description: >
1373-
Unix timestamp of when the message was pinned.
1374-
pinned_by:
1375-
allOf:
1376-
- $ref: "#/components/schemas/SessionID"
1377-
- type: object
1378-
description: >
1379-
The session ID of the moderator who pinned this message.
1366+
type: object
1367+
properties:
1368+
id:
1369+
type: integer
1370+
format: int64
1371+
description: The numeric message id.
1372+
pinned_at:
1373+
type: number
1374+
format: double
1375+
description: >
1376+
Unix timestamp of when the message was pinned.
1377+
pinned_by:
1378+
allOf:
1379+
- $ref: "#/components/schemas/SessionID"
1380+
- type: object
1381+
description: >
1382+
The session ID of the moderator who pinned this message.
13801383
description: >
13811384
This room's pinned messages, in order of when they were pinned. Omitted entirely if
13821385
there are no pinned messages.

0 commit comments

Comments
 (0)