-
-
Save bielawb/c5074b344012864f27c6c95b84b3fbd4 to your computer and use it in GitHub Desktop.
Praca ze schematem pliku JSON - prosty obiekt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$schema = @' | |
{ | |
"$schema": "http://json-schema.org/draft-07/schema", | |
"type": "object", | |
"properties": { | |
"foo": { | |
"type": "string", | |
"pattern": "^.{3}$" | |
} | |
}, | |
"required": ["foo"] | |
} | |
'@ | |
'{ "foo": "bar" }' | Test-Json -Schema $schema | |
# True | |
'{ "bar": "foo" }' | Test-Json -Schema $schema | |
# PropertyRequired: #/foo | |
# False | |
'{ "foo": "baaaar" }' | Test-Json -Schema $schema | |
# PatternMismatch: #/foo | |
# False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment