Fixed jsonschema for matchertype missing String()

This commit is contained in:
Ice3man543 2021-11-20 19:50:18 +05:30
parent 66dacccfb4
commit bdf1c2010b
3 changed files with 15 additions and 15 deletions

View File

@ -87,15 +87,15 @@ Examples:
```yaml ```yaml
requests: requests:
matchers: matchers:
- type: 1 - type: word
words: words:
- '[core]' - '[core]'
- type: 6 - type: dsl
condition: and condition: and
dsl: dsl:
- '!contains(tolower(body), ''<html'')' - '!contains(tolower(body), ''<html'')'
- '!contains(tolower(body), ''<body'')' - '!contains(tolower(body), ''<body'')'
- type: 4 - type: status
status: status:
- 200 - 200
matchers-condition: and matchers-condition: and
@ -194,7 +194,7 @@ network:
- data: "envi\r\nquit\r\n" - data: "envi\r\nquit\r\n"
read-size: 2048 read-size: 2048
matchers: matchers:
- type: 1 - type: word
words: words:
- zookeeper.version - zookeeper.version
``` ```
@ -688,15 +688,15 @@ Appears in:
```yaml ```yaml
matchers: matchers:
- type: 1 - type: word
words: words:
- '[core]' - '[core]'
- type: 6 - type: dsl
condition: and condition: and
dsl: dsl:
- '!contains(tolower(body), ''<html'')' - '!contains(tolower(body), ''<html'')'
- '!contains(tolower(body), ''<body'')' - '!contains(tolower(body), ''<body'')'
- type: 4 - type: status
status: status:
- 200 - 200
matchers-condition: and matchers-condition: and
@ -2396,7 +2396,7 @@ inputs:
- data: "envi\r\nquit\r\n" - data: "envi\r\nquit\r\n"
read-size: 2048 read-size: 2048
matchers: matchers:
- type: 1 - type: word
words: words:
- zookeeper.version - zookeeper.version
``` ```

View File

@ -307,12 +307,12 @@
}, },
"matchers.MatcherTypeHolder": { "matchers.MatcherTypeHolder": {
"enum": [ "enum": [
1, "word",
2, "regex",
3, "binary",
4, "status",
5, "size",
6 "dsl"
], ],
"type": "string", "type": "string",
"title": "type of the matcher", "title": "type of the matcher",

View File

@ -86,7 +86,7 @@ func (holder MatcherTypeHolder) JSONSchemaType() *jsonschema.Type {
Description: "Type of the matcher,enum=status,enum=size,enum=word,enum=regex,enum=binary,enum=dsl", Description: "Type of the matcher,enum=status,enum=size,enum=word,enum=regex,enum=binary,enum=dsl",
} }
for _, types := range GetSupportedMatcherTypes() { for _, types := range GetSupportedMatcherTypes() {
gotType.Enum = append(gotType.Enum, types) gotType.Enum = append(gotType.Enum, types.String())
} }
return gotType return gotType
} }