Improve API doc

Fix #4825
This commit is contained in:
syuilo 2019-05-01 04:44:46 +09:00
parent e6cdf1b995
commit 1903aaf351
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69
3 changed files with 51 additions and 1 deletions

View file

@ -84,5 +84,51 @@ export const packedPageSchema = {
type: types.object,
optional: bool.false, nullable: bool.false,
properties: {
id: {
type: types.string,
optional: bool.false, nullable: bool.false,
format: 'id',
example: 'xxxxxxxxxx',
},
createdAt: {
type: types.string,
optional: bool.false, nullable: bool.false,
format: 'date-time',
},
updatedAt: {
type: types.string,
optional: bool.false, nullable: bool.false,
format: 'date-time',
},
title: {
type: types.string,
optional: bool.false, nullable: bool.false,
},
name: {
type: types.string,
optional: bool.false, nullable: bool.false,
},
summary: {
type: types.string,
optional: bool.false, nullable: bool.true,
},
content: {
type: types.array,
optional: bool.false, nullable: bool.false,
},
variables: {
type: types.array,
optional: bool.false, nullable: bool.false,
},
userId: {
type: types.string,
optional: bool.false, nullable: bool.false,
format: 'id',
},
user: {
type: types.object,
ref: 'User',
optional: bool.false, nullable: bool.false,
},
}
};

View file

@ -18,5 +18,7 @@ export const kinds = [
'write:notifications',
'read:reactions',
'write:reactions',
'write:votes'
'write:votes',
'read:pages',
'write:pages',
];

View file

@ -12,6 +12,7 @@ import { packedMutingSchema } from '../../../models/repositories/muting';
import { packedBlockingSchema } from '../../../models/repositories/blocking';
import { packedNoteReactionSchema } from '../../../models/repositories/note-reaction';
import { packedHashtagSchema } from '../../../models/repositories/hashtag';
import { packedPageSchema } from '../../../models/repositories/page';
export function convertSchemaToOpenApiSchema(schema: Schema) {
const res: any = schema;
@ -76,4 +77,5 @@ export const schemas = {
Blocking: convertSchemaToOpenApiSchema(packedBlockingSchema),
NoteReaction: convertSchemaToOpenApiSchema(packedNoteReactionSchema),
Hashtag: convertSchemaToOpenApiSchema(packedHashtagSchema),
Page: convertSchemaToOpenApiSchema(packedPageSchema),
};