func (s Fields) ValidationSchema() (schema.Fields, schema.Defaults, error) {
	fields := make(schema.Fields)
	defaults := make(schema.Defaults)
	for name, attr := range s {
		path := []string{name}
		checker, err := attr.Checker()
		if err != nil {
			return nil, nil, errgo.Notef(err, "%s", mkPath(path))
		}
		if !attr.Mandatory {
			defaults[name] = schema.Omit
		}
		fields[name] = checker
	}
	return fields, defaults, nil
}
// ValidationSchema returns values suitable for passing to
// schema.FieldMap to create a schema.Checker that will validate the given fields.
// It will return an error if the fields are invalid.
//
// The Defaults return value will contain entries for all non-mandatory
// attributes set to schema.Omit. It is the responsibility of the
// client to set any actual default values as required.
ValidationSchema returns values suitable for passing to
schema.FieldMap to create a schema.Checker that will validate the given fields.
It will return an error if the fields are invalid.

The Defaults return value will contain entries for all non-mandatory
attributes set to schema.Omit. It is the responsibility of the
client to set any actual default values as required.
// ValidationSchema returns values suitable for passing to // schema . FieldMap to create a schema . Checker that will validate the given fields . // It will return an error if the fields are invalid . // // The Defaults return value will contain entries for all non - mandatory // attributes set to schema . Omit . It is the responsibility of the // client to set any actual default values as required .
func (s Fields) ValidationSchema() (schema.Fields, schema.Defaults, error) {
	fields := make(schema.Fields)
	defaults := make(schema.Defaults)
	for name, attr := range s {
		path := []string{name}
		checker, err := attr.Checker()
		if err != nil {
			return nil, nil, errgo.Notef(err, "%s", mkPath(path))
		}
		if !attr.Mandatory {
			defaults[name] = schema.Omit
		}
		fields[name] = checker
	}
	return fields, defaults, nil
}
func ( s Fields ) ValidationSchema ( ) ( schema . Fields , schema . Defaults , error ) { fields := make ( schema . Fields ) defaults := make ( schema . Defaults ) for name , attr := range s { path := [ ] string { name } checker , err := attr . Checker ( ) if err != nil { return nil , nil , errgo . Notef ( err , " " , mkPath ( path ) ) } if ! attr . Mandatory { defaults [ name ] = schema . Omit } fields [ name ] = checker } return fields , defaults , nil }
ValidationSchema returns values suitable for passing to
schema.FieldMap to create a schema.Checker that will validate the given fields.
ValidationSchema returns values suitable for passing to schema . FieldMap to create a schema . Checker that will validate the given fields .