mirror of
				https://codeberg.org/yeentown/barkey.git
				synced 2025-10-31 05:24:13 +00:00 
			
		
		
		
	* fix(server): notes/createのバリデーションが効いていない Fix #10079 Co-Authored-By: mei23 <m@m544.net> * anyOf内にバリデーションを書いても最初の一つしかチェックされない * ✌️ * wip * wip * ✌️ * RequiredProp * Revert "RequiredProp" This reverts commit 74693900119a590263106fa3adefd008d69ce80c. * add api:notes/create * fix lint * text * ✌️ * improve readability --------- Co-authored-by: mei23 <m@m544.net> Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
		
			
				
	
	
		
			11 lines
		
	
	
	
		
			267 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			11 lines
		
	
	
	
		
			267 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| import { Schema } from '@/misc/schema';
 | |
| import Ajv from 'ajv';
 | |
| 
 | |
| export const getValidator = (paramDef: Schema) => {
 | |
|     const ajv = new Ajv({
 | |
|         useDefaults: true,
 | |
|     });
 | |
|     ajv.addFormat('misskey:id', /^[a-zA-Z0-9]+$/);		
 | |
| 
 | |
|     return ajv.compile(paramDef);
 | |
| }
 |