Skip to content

Commit 56768ac

Browse files
authored
fix(jsonschema): add missing name definitions (#133)
* fix(jsonschema): add missing name definitions * fix(jsonschema): update changelog
1 parent 88620b6 commit 56768ac

File tree

3 files changed

+16
-15
lines changed

3 files changed

+16
-15
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Types of changes
2121
- `Added` loading screen when JS is loading on PIMO Play website
2222
- `Added` loading spinner when refreshing output on PIMO Play website
2323
- `Added` a refresh button on PIMO Play website
24+
- `Fixed` jsonschema for `randomDecimal` and `randomDuration` masks
2425

2526
## [1.13.0]
2627

pkg/model/model.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,14 @@ type WeightedChoiceType struct {
9292
}
9393

9494
type RandomDurationType struct {
95-
Min string `jsonschema_description:"Lower bound of the duration range (ISO 8601 notation)"`
96-
Max string `jsonschema_description:"Higher bound of the duration range (ISO 8601 notation)"`
95+
Min string `yaml:"min" jsonschema_description:"Lower bound of the duration range (ISO 8601 notation)"`
96+
Max string `yaml:"max" jsonschema_description:"Higher bound of the duration range (ISO 8601 notation)"`
9797
}
9898

9999
type RandomDecimalType struct {
100-
Min float64 `jsonschema_description:"Lower bound of the decimal range"`
101-
Max float64 `jsonschema_description:"Lower bound of the decimal range"`
102-
Precision int `jsonschema_description:"Precision of the generated value"`
100+
Min float64 `yaml:"min" jsonschema_description:"Lower bound of the decimal range"`
101+
Max float64 `yaml:"max" jsonschema_description:"Lower bound of the decimal range"`
102+
Precision int `yaml:"precision" jsonschema_description:"Precision of the generated value"`
103103
}
104104

105105
type DateParserType struct {

schema/v1/pimo.schema.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -638,43 +638,43 @@
638638
},
639639
"RandomDecimalType": {
640640
"properties": {
641-
"Min": {
641+
"min": {
642642
"type": "number",
643643
"description": "Lower bound of the decimal range"
644644
},
645-
"Max": {
645+
"max": {
646646
"type": "number",
647647
"description": "Lower bound of the decimal range"
648648
},
649-
"Precision": {
649+
"precision": {
650650
"type": "integer",
651651
"description": "Precision of the generated value"
652652
}
653653
},
654654
"additionalProperties": false,
655655
"type": "object",
656656
"required": [
657-
"Min",
658-
"Max",
659-
"Precision"
657+
"min",
658+
"max",
659+
"precision"
660660
]
661661
},
662662
"RandomDurationType": {
663663
"properties": {
664-
"Min": {
664+
"min": {
665665
"type": "string",
666666
"description": "Lower bound of the duration range (ISO 8601 notation)"
667667
},
668-
"Max": {
668+
"max": {
669669
"type": "string",
670670
"description": "Higher bound of the duration range (ISO 8601 notation)"
671671
}
672672
},
673673
"additionalProperties": false,
674674
"type": "object",
675675
"required": [
676-
"Min",
677-
"Max"
676+
"min",
677+
"max"
678678
]
679679
},
680680
"SeedType": {

0 commit comments

Comments
 (0)