Skip to content

Commit

Permalink
Allow additional properties for variables inside jsonschema (projectd…
Browse files Browse the repository at this point in the history
…iscovery#3669)

* Allow additional properties in variables inside jsonschema

* Update variables jsonschema function

* Add tags for archive and mime-type
  • Loading branch information
ShubhamRasal authored May 15, 2023
1 parent 89ed726 commit 2dd13b9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions v2/pkg/protocols/common/variables/variables.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ type Variable struct {
utils.InsertionOrderedStringMap `yaml:"-" json:"-"`
}

func (variables *Variable) JSONSchemaType() *jsonschema.Type {
func (variables Variable) JSONSchemaType() *jsonschema.Type {
gotType := &jsonschema.Type{
Type: "map[string]string",
Title: "variables for the request",
Description: "Additional variables for the request",
Type: "object",
Title: "variables for the request",
Description: "Additional variables for the request",
AdditionalProperties: []byte("true"),
}
return gotType
}
Expand Down
4 changes: 2 additions & 2 deletions v2/pkg/protocols/file/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ type Request struct {

// description: |
// elaborates archives
Archive bool
Archive bool `yaml:"archive,omitempty" json:"archive,omitempty" jsonschema:"title=enable archives,description=Process compressed archives without unpacking"`

// description: |
// enables mime types check
MimeType bool
MimeType bool `yaml:"mime-type,omitempty" json:"mime-type,omitempty" jsonschema:"title=enable filtering by mime-type,description=Filter files by mime-type"`

CompiledOperators *operators.Operators `yaml:"-" json:"-"`

Expand Down

0 comments on commit 2dd13b9

Please sign in to comment.