Some checks failed
		
		
	
	Docs CI / lint-and-preview (push) Has been cancelled
				
			- Implemented PolicyDslValidator with command-line options for strict mode and JSON output. - Created PolicySchemaExporter to generate JSON schemas for policy-related models. - Developed PolicySimulationSmoke tool to validate policy simulations against expected outcomes. - Added project files and necessary dependencies for each tool. - Ensured proper error handling and usage instructions across tools.
		
			
				
	
	
		
			23 lines
		
	
	
		
			518 B
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
		
			518 B
		
	
	
	
		
			C#
		
	
	
	
	
	
| using System.Text.Json;
 | |
| 
 | |
| namespace StellaOps.Aoc;
 | |
| 
 | |
| public static class AocGuardExtensions
 | |
| {
 | |
|     public static AocGuardResult ValidateOrThrow(this IAocGuard guard, JsonElement document, AocGuardOptions? options = null)
 | |
|     {
 | |
|         if (guard is null)
 | |
|         {
 | |
|             throw new ArgumentNullException(nameof(guard));
 | |
|         }
 | |
| 
 | |
|         var result = guard.Validate(document, options);
 | |
|         if (!result.IsValid)
 | |
|         {
 | |
|             throw new AocGuardException(result);
 | |
|         }
 | |
| 
 | |
|         return result;
 | |
|     }
 | |
| }
 |