Skip to content

Commit 4ed5aa6

Browse files
authored
fix: jsonschema (#60)
* fix: jsonschema * docs: update changelog
1 parent 557cd7e commit 4ed5aa6

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ Types of changes
1414
- `Fixed` for any bug fixes.
1515
- `Security` in case of vulnerabilities.
1616

17+
## [1.9.1]
18+
19+
- `Fixed` JSON Schema validation for `masks` property (only required if `mask` is not set).
20+
1721
## [1.9.0]
1822

1923
- `Added` possibility to use a template string with `randomChoiceInUri` mask

pkg/model/model.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ type MaskType struct {
154154

155155
type Masking struct {
156156
Selector SelectorType `yaml:"selector"`
157-
Mask MaskType `yaml:"mask" jsonschema:"oneof_required=Mask"`
158-
Masks []MaskType `yaml:"masks" jsonschema:"oneof_required=Masks"`
157+
Mask MaskType `yaml:"mask,omitempty" jsonschema:"oneof_required=Mask"`
158+
Masks []MaskType `yaml:"masks,omitempty" jsonschema:"oneof_required=Masks"`
159159
Cache string `yaml:"cache,omitempty"`
160160
}
161161

schema/v1/pimo.schema.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -364,9 +364,7 @@
364364
},
365365
"Masking": {
366366
"required": [
367-
"selector",
368-
"mask",
369-
"masks"
367+
"selector"
370368
],
371369
"properties": {
372370
"selector": {

0 commit comments

Comments
 (0)