adding json schema for extractor (#3240)

* adding json schema for extractor

* adding argument validation
dev
Mzack9999 2023-02-07 09:31:34 +01:00 committed by GitHub
parent 1e5358b1fa
commit 1fbd2c069a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -21,6 +21,11 @@ func main() {
if err != nil {
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)
if err != nil {
log.Fatalf("Could not write docs: %s\n", err)

View File

@ -90,7 +90,7 @@ type Extractor struct {
// description: |
// 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
// description: |