Skip to content

Commit 87f9cbb

Browse files
UserStory-51 : Added a global variable for RawSchema, to potentially aid in processing definitions
1 parent 5109463 commit 87f9cbb

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

schema/schema.psm1

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@ class schemaDocument {
293293
}
294294
}
295295
}
296+
$Global:RawSchema = $null;
296297
function Get-Document {
297298
[CmdletBinding(
298299
HelpURI = 'https://github.com/SchemaModule/PowerShell/blob/master/docs/Get-SchemaDocument.md#get-schemadocument',
@@ -317,17 +318,19 @@ function Get-Document {
317318
switch ($Schema.Scheme) {
318319
'file' {
319320
Write-Verbose "Incoming Filepath";
320-
Return (ConvertTo-SchemaElement -object (Get-Content -Path $Path | ConvertFrom-Json) -IsRootSchema);
321+
$Global:RawSchema = (Get-Content -Path $Path | ConvertFrom-Json);
322+
321323
}
322324
'https' {
323325
Write-Verbose "Incoming HTTPs path";
324-
Return (ConvertTo-SchemaElement -object (Invoke-WebRequest -UseBasicParsing -Uri $Path | ConvertFrom-Json) -IsRootSchema);
326+
$Global:RawSchema = (Invoke-WebRequest -UseBasicParsing -Uri $Path | ConvertFrom-Json);
325327
}
326328
'http' {
327329
Write-Verbose "Incoming HTTP path";
328-
Return (ConvertTo-SchemaElement -object (Invoke-WebRequest -UseBasicParsing -Uri $Path | ConvertFrom-Json) -IsRootSchema);
330+
$Global:RawSchema = (Invoke-WebRequest -UseBasicParsing -Uri $Path | ConvertFrom-Json);
329331
}
330332
}
333+
Return (ConvertTo-SchemaElement -object $Global:RawSchema -IsRootSchema);
331334
}
332335
catch {
333336
throw $_;

0 commit comments

Comments
 (0)