Skip to content

Commit

Permalink
Add type for definitions in SMD
Browse files Browse the repository at this point in the history
  • Loading branch information
green13 committed Oct 3, 2017
1 parent e27db9e commit 2c26d4d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions smd/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ type Property struct {
}

type Definition struct {
Type string `json:"type,omitempty"`
Properties map[string]Property `json:"properties,omitempty"`
}

Expand Down
7 changes: 7 additions & 0 deletions testdata/testdata_zenrpc.go

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

1 change: 1 addition & 0 deletions zenrpc/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ var (
Definitions: map[string]smd.Definition{
{{- range .}}
"{{ .Name }}": {
Type: "object",
{{ template "properties" .Properties}}
},
{{- end }}
Expand Down

0 comments on commit 2c26d4d

Please sign in to comment.