Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

Commit

Permalink
print json schema for a sample document
Browse files Browse the repository at this point in the history
the document is of the type map[string]interface{}
which is the type when reading a yaml or json file
  • Loading branch information
karuppiah7890 committed Dec 26, 2019
0 parents commit 3be4cc4
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.idea
helm-schema-gen
5 changes: 5 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module github.com/karuppiah7890/helm-schema-gen

go 1.13

require github.com/karuppiah7890/go-jsonschema-generator v0.0.0-20191226170814-3854335796de
7 changes: 7 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/karuppiah7890/go-jsonschema-generator v0.0.0-20191226170814-3854335796de h1:xLPxL9cvp8SMJs4UJntWW+avLLeOjZg4j6znMHmOPac=
github.com/karuppiah7890/go-jsonschema-generator v0.0.0-20191226170814-3854335796de/go.mod h1:SltxBi57U2RnGZlEO3kSfuVQ8gdHdgSEcJFQ5zOnqqk=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
17 changes: 17 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package main

import (
"fmt"
"github.com/karuppiah7890/go-jsonschema-generator"
)

func main() {
data := map[string]interface{}{
"something": map[string]interface{}{
"okay": "dokey",
},
}
s := &jsonschema.Document{}
s.ReadDeep(&data)
fmt.Println(s)
}

0 comments on commit 3be4cc4

Please sign in to comment.