mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-18 15:35:28 +00:00
adding json schema for extractor (#3240)
* adding json schema for extractor * adding argument validation
This commit is contained in:
parent
1e5358b1fa
commit
1fbd2c069a
@ -21,6 +21,11 @@ func main() {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("Could not encode docs: %s\n", err)
|
log.Fatalf("Could not encode docs: %s\n", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(os.Args) < 3 {
|
||||||
|
log.Fatalf("syntax: %s md-docs-file jsonschema-file\n", os.Args[0])
|
||||||
|
}
|
||||||
|
|
||||||
err = os.WriteFile(os.Args[1], data, 0644)
|
err = os.WriteFile(os.Args[1], data, 0644)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("Could not write docs: %s\n", err)
|
log.Fatalf("Could not write docs: %s\n", err)
|
||||||
|
|||||||
@ -90,7 +90,7 @@ type Extractor struct {
|
|||||||
|
|
||||||
// description: |
|
// description: |
|
||||||
// Extracts using DSL expressions.
|
// Extracts using DSL expressions.
|
||||||
DSL []string
|
DSL []string `yaml:"dsl,omitempty" jsonschema:"title=dsl expressions to extract,description=Optional attribute to extract from response dsl"`
|
||||||
dslCompiled []*govaluate.EvaluableExpression
|
dslCompiled []*govaluate.EvaluableExpression
|
||||||
|
|
||||||
// description: |
|
// description: |
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user