Improve doc

This commit is contained in:
syuilo 2019-02-24 19:42:26 +09:00
parent 02e4929a97
commit b67f3438e9
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69
10 changed files with 133 additions and 6 deletions

View file

@ -30,7 +30,14 @@ export const meta = {
validator: $.optional.type(ID),
transform: transform,
},
},
res: {
type: 'array',
items: {
type: 'Blocking',
}
},
};
export default define(meta, async (ps, me) => {

View file

@ -30,7 +30,14 @@ export const meta = {
validator: $.optional.type(ID),
transform: transform,
},
},
res: {
type: 'array',
items: {
type: 'Muting',
}
},
};
export default define(meta, async (ps, me) => {

View file

@ -67,7 +67,14 @@ export const meta = {
validator: $.optional.type(ID),
transform: transform,
},
},
res: {
type: 'array',
items: {
type: 'Note',
}
},
};
export default define(meta, async (ps) => {

View file

@ -53,7 +53,14 @@ export const meta = {
]),
default: 'local'
}
},
res: {
type: 'array',
items: {
type: 'User',
}
},
};
const state: any = { // < https://github.com/Microsoft/TypeScript/issues/1863

View file

@ -52,6 +52,23 @@ export const meta = {
}
},
res: {
type: 'object',
properties: {
users: {
type: 'array',
items: {
type: 'User',
}
},
next: {
type: 'string',
format: 'id',
nullable: true
}
}
},
errors: {
noSuchUser: {
message: 'No such user.',

View file

@ -52,6 +52,23 @@ export const meta = {
}
},
res: {
type: 'object',
properties: {
users: {
type: 'array',
items: {
type: 'User',
}
},
next: {
type: 'string',
format: 'id',
nullable: true
}
}
},
errors: {
noSuchUser: {
message: 'No such user.',

View file

@ -29,6 +29,13 @@ export const meta = {
},
},
res: {
type: 'array',
items: {
type: 'User',
}
},
errors: {
noSuchUser: {
message: 'No such user.',

View file

@ -31,7 +31,14 @@ export const meta = {
validator: $.optional.num.min(0),
default: 0
}
},
res: {
type: 'array',
items: {
type: 'User',
}
},
};
export default define(meta, async (ps, me) => {

View file

@ -52,6 +52,13 @@ export const meta = {
}
},
},
res: {
type: 'array',
items: {
type: 'User',
}
},
};
export default define(meta, async (ps, me) => {

View file

@ -221,5 +221,49 @@ export const schemas = {
},
},
required: ['id', 'createdAt', 'name', 'type', 'datasize', 'md5']
}
},
Muting: {
type: 'object',
properties: {
id: {
type: 'string',
format: 'id',
description: 'The unique identifier for this mute.',
example: 'xxxxxxxxxxxxxxxxxxxxxxxx',
},
createdAt: {
type: 'string',
format: 'date-time',
description: 'The date that the mute was created.'
},
mutee: {
$ref: '#/components/schemas/User',
description: 'The mutee.'
},
},
required: ['id', 'createdAt', 'mutee']
},
Blocking: {
type: 'object',
properties: {
id: {
type: 'string',
format: 'id',
description: 'The unique identifier for this block.',
example: 'xxxxxxxxxxxxxxxxxxxxxxxx',
},
createdAt: {
type: 'string',
format: 'date-time',
description: 'The date that the block was created.'
},
blockee: {
$ref: '#/components/schemas/User',
description: 'The blockee.'
},
},
required: ['id', 'createdAt', 'blockee']
},
};