@@ -4,10 +4,10 @@ import (
44 "encoding/base64"
55 "encoding/json"
66 "fmt"
7+ "github.com/qri-io/jsonschema"
78 "io/ioutil"
89 "os"
910 "strings"
10- "github.com/qri-io/jsonschema"
1111)
1212
1313//go:generate go run generate-static-schema.go ../mof.schema.json
@@ -88,8 +88,7 @@ func SummarizeSchema() (string, error) {
8888 return "" , err
8989 }
9090 operators , leaves := summarizeNonlinear (data )
91- summary :=
92- "## Sets\n \n " +
91+ summary := "## Sets\n \n " +
9392 "### Scalar Sets\n \n " +
9493 summarize (data , "scalar_sets" ) + "\n " +
9594 "### Vector Sets\n \n " +
@@ -145,8 +144,7 @@ func oneOfToObject(data map[string]interface{}) []Object {
145144}
146145
147146func summarize (data map [string ]interface {}, key string ) string {
148- summary :=
149- "| Name | Description | Example |\n " +
147+ summary := "| Name | Description | Example |\n " +
150148 "| ---- | ----------- | ------- |\n "
151149 definitions := data ["definitions" ].(map [string ]interface {})
152150 keyData := definitions [key ].(map [string ]interface {})
@@ -162,14 +160,10 @@ func summarize(data map[string]interface{}, key string) string {
162160func summarizeNonlinear (data map [string ]interface {}) (string , string ) {
163161 definitions := data ["definitions" ].(map [string ]interface {})
164162 nonlinearTerm := definitions ["NonlinearTerm" ].(map [string ]interface {})
165- operators :=
166- "| Name | Arity |\n " +
163+ operators := "| Name | Arity |\n " +
167164 "| ---- | ----- |\n "
168-
169- leaves :=
170- "| Name | Description | Example |\n " +
165+ leaves := "| Name | Description | Example |\n " +
171166 "| ---- | ----------- | ------- |\n "
172-
173167 for _ , term := range nonlinearTerm ["oneOf" ].([]interface {}) {
174168 oneOf := term .(map [string ]interface {})
175169 objects := oneOfToObject (oneOf )
0 commit comments