( schemaName: string, projectRoot?: string )
| 30 | * @throws Error if schema is not found |
| 31 | */ |
| 32 | export function validateSchemaName( |
| 33 | schemaName: string, |
| 34 | projectRoot?: string |
| 35 | ): string { |
| 36 | const availableSchemas = listSchemas(projectRoot); |
| 37 | if (!availableSchemas.includes(schemaName)) { |
| 38 | throw new Error( |
| 39 | `Unknown schema '${schemaName}'. Available: ${availableSchemas.join(', ')}` |
| 40 | ); |
| 41 | } |
| 42 | return schemaName; |
| 43 | } |
| 44 | |
| 45 | /** |
| 46 | * Writes change metadata to .openspec.yaml in the change directory. |
no test coverage detected