-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTest-Json-Validation.ps1
More file actions
30 lines (26 loc) · 1.42 KB
/
Test-Json-Validation.ps1
File metadata and controls
30 lines (26 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
###############################################################################################
#
# EndpointPilot Schema Validation Test Script
# Test-Validation.PS1
#
# Description
# This script tests the JSON schema validation by validating the example JSON files
# against their corresponding schemas.
#
# Written by Julian West April 2025
#
###############################################################################################
# Create a copy of the example file for testing
Copy-Item -Path "EXAMPLE-FILE-OPS.json" -Destination "TEST-FILE-OPS.json" -Force
Write-Host "Created test file: TEST-FILE-OPS.json" -ForegroundColor Cyan
# Test the validation script with the test file
Write-Host "Testing validation script with TEST-FILE-OPS.json..." -ForegroundColor Yellow
& .\Validate-JsonSchema.ps1 -JsonFilePath "TEST-FILE-OPS.json" -SchemaFilePath "FILE-OPS.schema.json"
Write-Host "`nTest completed. You can examine the results above." -ForegroundColor Cyan
Write-Host "To test validation with all example files, run:" -ForegroundColor Yellow
Write-Host " Copy-Item -Path 'EXAMPLE-*.json' -Destination { `$_.Name -replace 'EXAMPLE-', '' } -Force" -ForegroundColor Gray
Write-Host " .\Validate-JsonSchema.ps1 -ValidateAll" -ForegroundColor Gray
# Clean up
Write-Host "`nCleaning up test file..." -ForegroundColor Cyan
Remove-Item -Path "TEST-FILE-OPS.json" -Force
Write-Host "Test file removed." -ForegroundColor Green