diff --git a/Functions/Setup/Support/Get-NetboxAPIDefinition.ps1 b/Functions/Setup/Support/Get-NetboxAPIDefinition.ps1 index 1e42f7a..5c8095a 100644 --- a/Functions/Setup/Support/Get-NetboxAPIDefinition.ps1 +++ b/Functions/Setup/Support/Get-NetboxAPIDefinition.ps1 @@ -1,15 +1,21 @@  function Get-NetboxAPIDefinition { [CmdletBinding()] - param () - - #$URI = "https://netbox.neonet.org/api/docs/?format=openapi" - - $Segments = [System.Collections.ArrayList]::new(@('docs')) - - $URIComponents = BuildURIComponents -URISegments $Segments -ParametersDictionary @{'format' = 'openapi' } - + param + ( + [ValidateSet('json', 'yaml', IgnoreCase = $true)] + [string]$Format = 'json' + ) + + #$URI = "https://netbox.neonet.org/api/schema/?format=json" + + $Segments = [System.Collections.ArrayList]::new(@('schema')) + + $URIComponents = BuildURIComponents -URISegments $Segments -ParametersDictionary @{ + 'format' = $Format.ToLower() + } + $URI = BuildNewURI -Segments $URIComponents.Segments -Parameters $URIComponents.Parameters -SkipConnectedCheck - + InvokeNetboxRequest -URI $URI }