code: func (s *Field) MarshalJSON() ([]byte, error) {
  	m := make(map[string]interface{})
  	if s.Type != nil {
  		m["type"] = s.Type
  	}
  	if len(s.Name) > 0 {
  		m["name"] = s.Name
  	}
  
  	if s.Type.Type() == gv.Null || (s.Type.Type() == gv.Union && s.Type.(*gv.UnionSchema).Types[0].Type() == gv.Null) || s.Default != nil {
  		m["default"] = s.Default
  	}
  	if len(s.Doc) > 0 {
  		m["doc"] = s.Doc
  	}
  
  	for k, v := range s.Properties {
  		m[k] = v
  	}
  	return json.Marshal(m)
  }
docs: // MarshalJSON serializes the given schema field as JSON.