2023-07-27 05:31:52 +00:00
|
|
|
/*
|
|
|
|
* SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
*/
|
|
|
|
|
2023-02-16 14:09:41 +00:00
|
|
|
import { Injectable } from '@nestjs/common';
|
2022-09-17 18:27:08 +00:00
|
|
|
import { Endpoint } from '@/server/api/endpoint-base.js';
|
2022-02-19 05:05:32 +00:00
|
|
|
|
|
|
|
export const meta = {
|
2022-06-10 05:25:20 +00:00
|
|
|
tags: ['non-productive'],
|
|
|
|
|
|
|
|
description: 'Endpoint for testing input validation.',
|
|
|
|
|
2022-02-19 05:05:32 +00:00
|
|
|
requireCredential: false,
|
|
|
|
} as const;
|
|
|
|
|
2022-02-20 04:15:40 +00:00
|
|
|
export const paramDef = {
|
2022-02-19 05:05:32 +00:00
|
|
|
type: 'object',
|
|
|
|
properties: {
|
|
|
|
required: { type: 'boolean' },
|
|
|
|
string: { type: 'string' },
|
|
|
|
default: { type: 'string', default: 'hello' },
|
|
|
|
nullableDefault: { type: 'string', nullable: true, default: 'hello' },
|
|
|
|
id: { type: 'string', format: 'misskey:id' },
|
|
|
|
},
|
|
|
|
required: ['required'],
|
|
|
|
} as const;
|
|
|
|
|
2022-09-17 18:27:08 +00:00
|
|
|
@Injectable()
|
2023-08-17 12:20:58 +00:00
|
|
|
export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-disable-line import/no-default-export
|
2022-09-17 18:27:08 +00:00
|
|
|
constructor(
|
|
|
|
) {
|
|
|
|
super(meta, paramDef, async (ps, me) => {
|
|
|
|
return ps;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|