Skip to content

Commit

Permalink
Extract comments
Browse files Browse the repository at this point in the history
  • Loading branch information
K-Phoen committed Feb 8, 2024
1 parent b7d18c0 commit 5bac2ee
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
5 changes: 5 additions & 0 deletions cmd/generate-jsonschema/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ func main() {
return key
},
}

if err := reflector.AddGoComments("github.com/K-Phoen/grabana", "./decoder"); err != nil {
panic(fmt.Errorf("could not add Go comments to reflector: %w", err))
}

schema := reflector.Reflect(t.input)
schema.ID = jsonschema.ID(fmt.Sprintf("https://raw.githubusercontent.com/K-Phoen/grabana/master/schemas/%s.json", t.name))

Expand Down
12 changes: 8 additions & 4 deletions schemas/dashboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@
"type": "string"
},
"avg": {
"type": "string"
"type": "string",
"description": "Query reducers, only one should be used"
},
"sum": {
"type": "string"
Expand Down Expand Up @@ -437,7 +438,8 @@
}
},
"additionalProperties": false,
"type": "object"
"type": "object",
"description": "DashboardHeatmap represents a heatmap panel."
},
"DashboardInternalLink": {
"properties": {
Expand Down Expand Up @@ -655,7 +657,8 @@
}
},
"additionalProperties": false,
"type": "object"
"type": "object",
"description": "DashboardRow represents a dashboard row."
},
"DashboardSingleStat": {
"properties": {
Expand Down Expand Up @@ -863,7 +866,8 @@
}
},
"additionalProperties": false,
"type": "object"
"type": "object",
"description": "DashboardTable represents a table panel."
},
"DashboardText": {
"properties": {
Expand Down

0 comments on commit 5bac2ee

Please sign in to comment.