ui: problemconfig: add compilableFile schema

This commit is contained in:
undefined committed 2025-02-09 15:17:10 +00:00
1 parent d6287b15b1
commit ae24d3952f
1 file changed
+18 -4
@@ -48,6 +48,20 @@ const problemConfigSchema: JSONSchema7 = {
},
},
},
compilableFile: {
oneOf: [
{ type: 'string', pattern: '\\.' },
{
type: 'object',
properties: {
file: { type: 'string', pattern: '\\.' },
lang: { type: 'string' },
},
required: ['file', 'lang'],
additionalProperties: false,
},
],
},
},
properties: {
redirect: { type: 'string', pattern: '[0-9a-zA-Z_-]+\\/[0-9]+' },
@@ -59,14 +73,14 @@ const problemConfigSchema: JSONSchema7 = {
checker_type: { enum: ['default', 'lemon', 'syzoj', 'hustoj', 'testlib', 'strict', 'qduoj'] },
checker: {
oneOf: [
{ type: 'string', pattern: '\\.' },
{ type: 'string', enum: testlibCheckers },
{ $ref: '#/definitions/compilableFile' },
],
},
interactor: { type: 'string', pattern: '\\.' },
manager: { type: 'string', pattern: '\\.' },
interactor: { $ref: '#/definitions/compilableFile' },
manager: { $ref: '#/definitions/compilableFile' },
num_processes: { type: 'number', minimum: 1, maximum: 5 },
validator: { type: 'string', pattern: '\\.' },
validator: { $ref: '#/definitions/compilableFile' },
user_extra_files: { type: 'array', items: { type: 'string' } },
judge_extra_files: { type: 'array', items: { type: 'string' } },
cases: { $ref: '#/definitions/cases' },