Skip to content

Commit

Permalink
Merge pull request #27 from awakenetworks/yanfali-validator-documenta…
Browse files Browse the repository at this point in the history
…tion

Issue #26 Improve Field::Validator documentation
  • Loading branch information
rs authored Aug 1, 2016
2 parents f3cb071 + d949831 commit ce3f699
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion schema/field.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ type Field struct {
// Handler is the piece of logic modifying the field value based on passed parameters.
// This handler is only called if at least on parameter is provided.
Handler FieldHandler
// Validator is used to validate the field's format.
// Validator is used to validate the field's format. Please note you *must* pass in pointers to
// FieldValidator instances otherwise `schema` will not be able to discover other interfaces,
// such as `Compiler`, and *will* prevent schema from initializing specific FieldValidators
// correctly causing unexpected runtime errors.
// @see http://research.swtch.com/interfaces for more details.
Validator FieldValidator
// Dependency rejects the field if the schema query doesn't match the document.
// Use schema.Q(`{"field": "value"}`) to populate this field.
Expand Down

0 comments on commit ce3f699

Please sign in to comment.