| { |
| "system": "Examples", |
| "find": { |
| "arg": { |
| "pattern": { |
| "when": { "hasAll": ["fileExists"]}, |
| "type": "string", |
| "values": { |
| "empty": { |
| "const": "", |
| "properties": ["patternEmpty"] |
| }, |
| "unquotedSingle": { |
| "pattern": "^[^\\s\"]$" |
| }, |
| "unquotedMany": { |
| "pattern": "^[^\\s\"]+$", |
| "minLength": 2, |
| "maxLength": 16, |
| "properties": ["patternMany"] |
| }, |
| "quoted": { |
| "pattern": "^\"[^\\s\"]+\"$", |
| "minLength": 2, |
| "maxLength": 16, |
| "properties": ["patternMany"] |
| }, |
| "quotedEmpty": { |
| "const": "\"\"", |
| "properties": ["patternEmpty"] |
| }, |
| "quotedBlanks": { |
| "pattern": "^\"[^\\s\"]*( +[^\\s\"]*)+\"$", |
| "minLength": 2, |
| "maxLength": 16, |
| "properties": ["patternMany"] |
| }, |
| "quotedQuotes": { |
| "pattern": "^\"[^\\s\"]*(\"{2}[^\\s\"]*)+\"$", |
| "minLength": 2, |
| "maxLength": 16, |
| "properties": ["patternMany"] |
| } |
| } |
| }, |
| "fileName": { |
| "type": "string", |
| "values": { |
| "defined": { |
| "properties": ["fileName"] |
| }, |
| "missing": { |
| "failure": true |
| } |
| } |
| } |
| }, |
| "env": { |
| "file": { |
| "when": { "hasAll": ["fileName"]}, |
| "members": { |
| "exists": { |
| "type": "boolean", |
| "values": { |
| "true": { |
| "properties": ["fileExists"] |
| }, |
| "false": { |
| "failure": true |
| } |
| } |
| }, |
| "contents": { |
| "when": { "allOf": [ { "hasAll": ["fileExists"]}, { "hasNone": ["patternEmpty"]}]}, |
| "members": { |
| "linesLongerThanPattern": { |
| "type": "integer", |
| "format": "int32", |
| "values": { |
| "1": { |
| "properties": ["matchable"], |
| "once": true |
| }, |
| "many": { |
| "minimum": 2, |
| "maximum": 32, |
| "properties": ["matchable"] |
| }, |
| "0": { |
| "when": { "hasAll": ["patternMany"]}, |
| "failure": true |
| } |
| } |
| }, |
| "patternMatches": { |
| "when": { "hasAll": ["matchable"]}, |
| "type": "integer", |
| "format": "int32", |
| "values": { |
| "0": { |
| "once": true |
| }, |
| "1": { |
| "properties": ["match"] |
| }, |
| "many": { |
| "minimum": 2, |
| "maximum": 16, |
| "properties": ["match", "matchMany"] |
| } |
| } |
| }, |
| "patternsInLine": { |
| "when": { "hasAll": ["match"]}, |
| "type": "integer", |
| "format": "int32", |
| "values": { |
| "1": {}, |
| "many": { |
| "when": { "hasAll": ["matchMany"]}, |
| "minimum": 2, |
| "maximum": 4 |
| } |
| } |
| } |
| } |
| } |
| } |
| } |
| } |
| } |
| } |
|
|