Auto Generate Syntax Docs + JSONSchema [Thu Dec 16 11:39:23 UTC 2021] 🤖

This commit is contained in:
GitHub Action
2021-12-16 11:39:23 +00:00
parent 5200bcd94f
commit 4c70e4976b
3 changed files with 234 additions and 12 deletions

View File

@@ -247,6 +247,19 @@ Websocket contains the Websocket request to make in the template.
<div class="dd">
<code>whois</code> <i>[]<a href="#whoisrequest">whois.Request</a></i>
</div>
<div class="dt">
WHOIS contains the WHOIS request to make in the template.
</div>
<hr />
<div class="dd">
<code>workflows</code> <i>[]<a href="#workflowsworkflowtemplate">workflows.WorkflowTemplate</a></i>
</div>
@@ -1320,6 +1333,8 @@ Appears in:
- <code><a href="#websocketrequest">websocket.Request</a>.matchers</code>
- <code><a href="#whoisrequest">whois.Request</a>.matchers</code>
@@ -1713,6 +1728,8 @@ Appears in:
- <code><a href="#websocketrequest">websocket.Request</a>.extractors</code>
- <code><a href="#whoisrequest">whois.Request</a>.extractors</code>
@@ -3599,6 +3616,106 @@ name: prefix
## whois.Request
Request is a request for the WHOIS protocol
Appears in:
- <code><a href="#template">Template</a>.whois</code>
<hr />
<div class="dd">
<code>matchers</code> <i>[]<a href="#matchersmatcher">matchers.Matcher</a></i>
</div>
<div class="dt">
Matchers contains the detection mechanism for the request to identify
whether the request was successful by doing pattern matching
on request/responses.
Multiple matchers can be combined with `matcher-condition` flag
which accepts either `and` or `or` as argument.
</div>
<hr />
<div class="dd">
<code>extractors</code> <i>[]<a href="#extractorsextractor">extractors.Extractor</a></i>
</div>
<div class="dt">
Extractors contains the extraction mechanism for the request to identify
and extract parts of the response.
</div>
<hr />
<div class="dd">
<code>matchers-condition</code> <i>string</i>
</div>
<div class="dt">
MatchersCondition is the condition between the matchers. Default is OR.
Valid values:
- <code>and</code>
- <code>or</code>
</div>
<hr />
<div class="dd">
<code>query</code> <i>string</i>
</div>
<div class="dt">
Query contains query for the request
</div>
<hr />
<div class="dd">
<code>server</code> <i>string</i>
</div>
<div class="dt">
description: |
Optional WHOIS server URL.
If present, specifies the WHOIS server to execute the Request on.
Otherwise, nil enables bootstrapping
</div>
<hr />
## workflows.WorkflowTemplate
Appears in:

View File

@@ -1026,6 +1026,47 @@
"additionalProperties": false,
"type": "object"
},
"whois.Request": {
"properties": {
"matchers": {
"items": {
"$ref": "#/definitions/matchers.Matcher"
},
"type": "array",
"title": "matchers to run on response",
"description": "Detection mechanism to identify whether the request was successful by doing pattern matching"
},
"extractors": {
"items": {
"$ref": "#/definitions/extractors.Extractor"
},
"type": "array",
"title": "extractors to run on response",
"description": "Extractors contains the extraction mechanism for the request to identify and extract parts of the response"
},
"matchers-condition": {
"enum": [
"and",
"or"
],
"type": "string",
"title": "condition between the matchers",
"description": "Conditions between the matchers"
},
"query": {
"type": "string",
"title": "query for the WHOIS request",
"description": "Query contains query for the request"
},
"server": {
"type": "string",
"title": "server url to execute the WHOIS request on",
"description": "Server contains the server url to execute the WHOIS request on"
}
},
"additionalProperties": false,
"type": "object"
},
"templates.Template": {
"required": [
"id",
@@ -1110,6 +1151,15 @@
"title": "websocket requests to make",
"description": "Websocket requests to make for the template"
},
"whois": {
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"$ref": "#/definitions/whois.Request"
},
"type": "array",
"title": "whois requests to make",
"description": "WHOIS requests to make for the template"
},
"workflows": {
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",

View File

@@ -33,6 +33,7 @@ var (
SSLRequestDoc encoder.Doc
WEBSOCKETRequestDoc encoder.Doc
WEBSOCKETInputDoc encoder.Doc
WHOISRequestDoc encoder.Doc
WORKFLOWSWorkflowTemplateDoc encoder.Doc
WORKFLOWSMatcherDoc encoder.Doc
)
@@ -41,7 +42,7 @@ func init() {
TemplateDoc.Type = "Template"
TemplateDoc.Comments[encoder.LineComment] = " Template is a YAML input file which defines all the requests and"
TemplateDoc.Description = "Template is a YAML input file which defines all the requests and\n other metadata for a template."
TemplateDoc.Fields = make([]encoder.Doc, 12)
TemplateDoc.Fields = make([]encoder.Doc, 13)
TemplateDoc.Fields[0].Name = "id"
TemplateDoc.Fields[0].Type = "string"
TemplateDoc.Fields[0].Note = ""
@@ -99,21 +100,26 @@ func init() {
TemplateDoc.Fields[8].Note = ""
TemplateDoc.Fields[8].Description = "Websocket contains the Websocket request to make in the template."
TemplateDoc.Fields[8].Comments[encoder.LineComment] = "Websocket contains the Websocket request to make in the template."
TemplateDoc.Fields[9].Name = "workflows"
TemplateDoc.Fields[9].Type = "[]workflows.WorkflowTemplate"
TemplateDoc.Fields[9].Name = "whois"
TemplateDoc.Fields[9].Type = "[]whois.Request"
TemplateDoc.Fields[9].Note = ""
TemplateDoc.Fields[9].Description = "Workflows is a list of workflows to execute for a template."
TemplateDoc.Fields[9].Comments[encoder.LineComment] = "Workflows is a list of workflows to execute for a template."
TemplateDoc.Fields[10].Name = "self-contained"
TemplateDoc.Fields[10].Type = "bool"
TemplateDoc.Fields[9].Description = "WHOIS contains the WHOIS request to make in the template."
TemplateDoc.Fields[9].Comments[encoder.LineComment] = "WHOIS contains the WHOIS request to make in the template."
TemplateDoc.Fields[10].Name = "workflows"
TemplateDoc.Fields[10].Type = "[]workflows.WorkflowTemplate"
TemplateDoc.Fields[10].Note = ""
TemplateDoc.Fields[10].Description = "Self Contained marks Requests for the template as self-contained"
TemplateDoc.Fields[10].Comments[encoder.LineComment] = "Self Contained marks Requests for the template as self-contained"
TemplateDoc.Fields[11].Name = "stop-at-first-match"
TemplateDoc.Fields[10].Description = "Workflows is a list of workflows to execute for a template."
TemplateDoc.Fields[10].Comments[encoder.LineComment] = "Workflows is a list of workflows to execute for a template."
TemplateDoc.Fields[11].Name = "self-contained"
TemplateDoc.Fields[11].Type = "bool"
TemplateDoc.Fields[11].Note = ""
TemplateDoc.Fields[11].Description = "Stop execution once first match is found"
TemplateDoc.Fields[11].Comments[encoder.LineComment] = "Stop execution once first match is found"
TemplateDoc.Fields[11].Description = "Self Contained marks Requests for the template as self-contained"
TemplateDoc.Fields[11].Comments[encoder.LineComment] = "Self Contained marks Requests for the template as self-contained"
TemplateDoc.Fields[12].Name = "stop-at-first-match"
TemplateDoc.Fields[12].Type = "bool"
TemplateDoc.Fields[12].Note = ""
TemplateDoc.Fields[12].Description = "Stop execution once first match is found"
TemplateDoc.Fields[12].Comments[encoder.LineComment] = "Stop execution once first match is found"
MODELInfoDoc.Type = "model.Info"
MODELInfoDoc.Comments[encoder.LineComment] = " Info contains metadata information about a template"
@@ -570,6 +576,10 @@ func init() {
TypeName: "websocket.Request",
FieldName: "matchers",
},
{
TypeName: "whois.Request",
FieldName: "matchers",
},
}
MATCHERSMatcherDoc.Fields = make([]encoder.Doc, 13)
MATCHERSMatcherDoc.Fields[0].Name = "type"
@@ -731,6 +741,10 @@ func init() {
TypeName: "websocket.Request",
FieldName: "extractors",
},
{
TypeName: "whois.Request",
FieldName: "extractors",
},
}
EXTRACTORSExtractorDoc.Fields = make([]encoder.Doc, 11)
EXTRACTORSExtractorDoc.Fields[0].Name = "name"
@@ -1645,6 +1659,46 @@ func init() {
WEBSOCKETInputDoc.Fields[1].AddExample("", "prefix")
WHOISRequestDoc.Type = "whois.Request"
WHOISRequestDoc.Comments[encoder.LineComment] = " Request is a request for the WHOIS protocol"
WHOISRequestDoc.Description = "Request is a request for the WHOIS protocol"
WHOISRequestDoc.AppearsIn = []encoder.Appearance{
{
TypeName: "Template",
FieldName: "whois",
},
}
WHOISRequestDoc.Fields = make([]encoder.Doc, 5)
WHOISRequestDoc.Fields[0].Name = "matchers"
WHOISRequestDoc.Fields[0].Type = "[]matchers.Matcher"
WHOISRequestDoc.Fields[0].Note = ""
WHOISRequestDoc.Fields[0].Description = "Matchers contains the detection mechanism for the request to identify\nwhether the request was successful by doing pattern matching\non request/responses.\n\nMultiple matchers can be combined with `matcher-condition` flag\nwhich accepts either `and` or `or` as argument."
WHOISRequestDoc.Fields[0].Comments[encoder.LineComment] = "Matchers contains the detection mechanism for the request to identify"
WHOISRequestDoc.Fields[1].Name = "extractors"
WHOISRequestDoc.Fields[1].Type = "[]extractors.Extractor"
WHOISRequestDoc.Fields[1].Note = ""
WHOISRequestDoc.Fields[1].Description = "Extractors contains the extraction mechanism for the request to identify\nand extract parts of the response."
WHOISRequestDoc.Fields[1].Comments[encoder.LineComment] = "Extractors contains the extraction mechanism for the request to identify"
WHOISRequestDoc.Fields[2].Name = "matchers-condition"
WHOISRequestDoc.Fields[2].Type = "string"
WHOISRequestDoc.Fields[2].Note = ""
WHOISRequestDoc.Fields[2].Description = "MatchersCondition is the condition between the matchers. Default is OR."
WHOISRequestDoc.Fields[2].Comments[encoder.LineComment] = "MatchersCondition is the condition between the matchers. Default is OR."
WHOISRequestDoc.Fields[2].Values = []string{
"and",
"or",
}
WHOISRequestDoc.Fields[3].Name = "query"
WHOISRequestDoc.Fields[3].Type = "string"
WHOISRequestDoc.Fields[3].Note = ""
WHOISRequestDoc.Fields[3].Description = "Query contains query for the request"
WHOISRequestDoc.Fields[3].Comments[encoder.LineComment] = "Query contains query for the request"
WHOISRequestDoc.Fields[4].Name = "server"
WHOISRequestDoc.Fields[4].Type = "string"
WHOISRequestDoc.Fields[4].Note = ""
WHOISRequestDoc.Fields[4].Description = "description: |\n Optional WHOIS server URL.\n\n If present, specifies the WHOIS server to execute the Request on.\n Otherwise, nil enables bootstrapping"
WHOISRequestDoc.Fields[4].Comments[encoder.LineComment] = " description: |"
WORKFLOWSWorkflowTemplateDoc.Type = "workflows.WorkflowTemplate"
WORKFLOWSWorkflowTemplateDoc.Comments[encoder.LineComment] = ""
WORKFLOWSWorkflowTemplateDoc.Description = ""
@@ -1740,6 +1794,7 @@ func GetTemplateDoc() *encoder.FileDoc {
&SSLRequestDoc,
&WEBSOCKETRequestDoc,
&WEBSOCKETInputDoc,
&WHOISRequestDoc,
&WORKFLOWSWorkflowTemplateDoc,
&WORKFLOWSMatcherDoc,
},