Skip to content

Commit

Permalink
Install go-bindata and yaml2json
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinjqiu committed Jun 19, 2018
1 parent 202294b commit 4a3f3ae
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 56 deletions.
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 6,14 @@ test: generate
build: generate
go build -o pat

generate: schema
generate: bindata schema
cd pkg && go-bindata -pkg pkg schema

schema:
schema: yaml2json
cd pkg/schema && yaml2json < schema.yaml | jq . > schema.json

bindata:
go get -u github.com/jteeuwen/go-bindata

yaml2json:
go get -u github.com/bronze1man/yaml2json
31 changes: 4 additions & 27 deletions pkg/bindata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 0 additions & 25 deletions pkg/schema/pat.json

This file was deleted.

26 changes: 25 additions & 1 deletion pkg/schema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 2,25 @@
"$schema": "http://json-schema.org/draft-04/schema#",
"additionalProperties": false,
"definitions": {
"Fixture": {
"properties": {
"duration": {
"pattern": "^\\d (ns|us|ms|s|m|h)$",
"type": "string"
},
"metrics": {
"items": {
"type": "string"
},
"type": "array"
}
},
"required": [
"duration",
"metrics"
],
"type": "object"
},
"Rules": {
"oneOf": [
{
Expand Down Expand Up @@ -30,7 49,12 @@
},
"properties": {
"assertions": {},
"fixtures": {},
"fixtures": {
"items": {
"$ref": "#/definitions/Fixture"
},
"type": "array"
},
"name": {
"type": "string"
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/schema/schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 35,7 @@ definitions:
properties:
duration:
type: string
pattern: "^\d (ns|us|ms|s|m|h)$"
pattern: "^\\d (ns|us|ms|s|m|h)$"
metrics:
type: array
items:
Expand Down

0 comments on commit 4a3f3ae

Please sign in to comment.