Skip to content

Commit 789fc84

Browse files
authored
Merge pull request #11 from gdt-dev/json
use `path-formats` for JSON Expect
2 parents 0d8a00e + b0f1c1d commit 789fc84

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

.github/workflows/gate-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
disable-sudo: true
2525
allowed-endpoints: >
2626
github.com:443
27+
proxy.golang.org:443
2728
- name: checkout code
2829
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
2930
- name: setup go

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ tests:
409409
paths:
410410
$.author.name: Ernest Hemingway
411411
$.publisher.address.state: New York
412-
path_formats:
412+
path-formats:
413413
$.id: uuid4
414414
```
415415

assertion/json/json.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ type Expect struct {
3636
Paths map[string]string `yaml:"paths,omitempty"`
3737
// PathFormats is a map, keyed by JSONPath expression, of expected formats
3838
// that values found at the expression should have.
39-
PathFormats map[string]string `yaml:"path_formats,omitempty"`
39+
PathFormats map[string]string `yaml:"path-formats,omitempty"`
4040
// Schema is a file path to the JSONSchema that the JSON should validate
4141
// against.
4242
Schema string `yaml:"schema,omitempty"`
@@ -112,7 +112,7 @@ func (e *Expect) UnmarshalYAML(node *yaml.Node) error {
112112
}
113113
}
114114
e.Paths = paths
115-
case "path_formats":
115+
case "path_formats", "path-formats":
116116
if valNode.Kind != yaml.MappingNode {
117117
return gdterrors.ExpectedMapAt(valNode)
118118
}

0 commit comments

Comments
 (0)