Skip to content

Commit

Permalink
schema: Omit null fields from being encoded to JSON
Browse files Browse the repository at this point in the history
This patch disables encoding the `Fields` field of `JSONSchemaItemType`
if its `nil`. This avoids producing a bunch of noise in the schema
generated by tool/parquet-tools.
  • Loading branch information
rajiv-k committed Jun 10, 2021
1 parent 471272a commit e461e21
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions schema/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
)

type JSONSchemaItemType struct {
Tag string
Fields []*JSONSchemaItemType
Tag string `json:"Tag"`
Fields []*JSONSchemaItemType `json:"Fields,omitempty"`
}

func NewJSONSchemaItem() *JSONSchemaItemType {
Expand Down

0 comments on commit e461e21

Please sign in to comment.