Skip to content

Rhino Json schema validator library #1466

Answered by StSchnell
dapiced asked this question in Q&A
Discussion options

You must be logged in to vote

Hello Dominic (@dapiced),

in the VMware Aria Orchestrator you have also the possibility to use different runtime environments. Beside JavaScript is PowerShell available. PowerShell contains a cmdlet call Test-Json. With this cmdlet it is very easy to realize a JSON schema validator. Here the PowerShell action:

function Handler($context, $inputs) {
    $result = Test-Json -Json $inputs.in_jsonContent -Schema $inputs.in_jsonSchema;
    $output=@{status = 'done'; result = $result};
    return $output
}

Now you can call this action from your JavaScript environment. Here I use the Microsoft example from the Test-Json description. Here the JavaScript action:

var jsonContent = '{"name": "Ashley…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@dapiced
Comment options

Answer selected by p-bakker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants