2022-09-17 20:27:08 +02:00
|
|
|
import { Inject, Injectable } from '@nestjs/common';
|
|
|
|
import { Endpoint } from '@/server/api/endpoint-base.js';
|
2022-02-19 06:05:32 +01:00
|
|
|
|
|
|
|
export const meta = {
|
2022-06-10 07:25:20 +02:00
|
|
|
tags: ['non-productive'],
|
|
|
|
|
|
|
|
description: 'Endpoint for testing input validation.',
|
|
|
|
|
2022-02-19 06:05:32 +01:00
|
|
|
requireCredential: false,
|
|
|
|
} as const;
|
|
|
|
|
2022-02-20 05:15:40 +01:00
|
|
|
export const paramDef = {
|
2022-02-19 06:05:32 +01: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;
|
|
|
|
|
|
|
|
// eslint-disable-next-line import/no-default-export
|
2022-09-17 20:27:08 +02:00
|
|
|
@Injectable()
|
|
|
|
export default class extends Endpoint<typeof meta, typeof paramDef> {
|
|
|
|
constructor(
|
|
|
|
) {
|
|
|
|
super(meta, paramDef, async (ps, me) => {
|
|
|
|
return ps;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|