Skip to content

Commit

Permalink
made schema null marshalling consistent (#719)
Browse files Browse the repository at this point in the history
  • Loading branch information
brennanjl authored May 10, 2024
1 parent d7ffcba commit 8ccb37e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions core/types/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ func (s *Schema) DBID() string {
type Table struct {
Name string `json:"name"`
Columns []*Column `json:"columns"`
Indexes []*Index `json:"indexes,omitempty"`
Indexes []*Index `json:"indexes"`
ForeignKeys []*ForeignKey `json:"foreign_keys"`
}

Expand Down Expand Up @@ -295,7 +295,7 @@ func (t *Table) FindColumn(name string) (column *Column, found bool) {
type Column struct {
Name string `json:"name"`
Type *DataType `json:"type"`
Attributes []*Attribute `json:"attributes,omitempty"`
Attributes []*Attribute `json:"attributes"`
}

func (c *Column) Clean() error {
Expand Down Expand Up @@ -338,7 +338,7 @@ func (c *Column) hasPrimary() bool {
// These are constraints and default values.
type Attribute struct {
Type AttributeType `json:"type"`
Value string `json:"value,omitempty"`
Value string `json:"value"`
}

// Clean validates rules about the data in the struct (naming conventions, syntax, etc.).
Expand Down Expand Up @@ -798,7 +798,7 @@ func (a *AttributeType) Clean() error {
// These are defined by Kuneiform's `action` keyword.
type Action struct {
Name string `json:"name"`
Annotations []string `json:"annotations,omitempty"`
Annotations []string `json:"annotations"`
Parameters []string `json:"parameters"`
Public bool `json:"public"`
Modifiers []Modifier `json:"modifiers"`
Expand Down Expand Up @@ -900,7 +900,7 @@ type Procedure struct {
// Returns is the return type of the procedure.
Returns *ProcedureReturn `json:"return_types"`
// Annotations are the annotations of the procedure.
Annotations []string `json:"annotations,omitempty"`
Annotations []string `json:"annotations"`
}

func (p *Procedure) Clean() error {
Expand Down

0 comments on commit 8ccb37e

Please sign in to comment.