parameters: (ctxt, ast_field)
docstring: Validate field specific rules.
docstring_summary: Validate field specific rules.
docstring_tokens: Validate field specific rules .
function: def _validate_field_properties(ctxt, ast_field):
      # type: (errors.ParserContext, ast.Field) -> None
      """Validate field specific rules."""
  
      if ast_field.default:
          if ast_field.optional:
              ctxt.add_bad_field_default_and_optional(ast_field, ast_field.name)
  
          if ast_field.type.bson_serialization_type == ['bindata']:
              ctxt.add_bindata_no_default(ast_field, ast_field.type.name, ast_field.name)
  
      if ast_field.always_serialize and not ast_field.optional:
          ctxt.add_bad_field_always_serialize_not_optional(ast_field, ast_field.name)
  
      # A "chain" type should never appear as a field.
      if ast_field.type.bson_serialization_type == ['chain']:
          ctxt.add_bad_array_of_chain(ast_field, ast_field.name)
function_tokens: def _validate_field_properties ( ctxt , ast_field ) : # type: (errors.ParserContext, ast.Field) -> None if ast_field . default : if ast_field . optional : ctxt . add_bad_field_default_and_optional ( ast_field , ast_field . name ) if ast_field . type . bson_serialization_type == [ 'bindata' ] : ctxt . add_bindata_no_default ( ast_field , ast_field . type . name , ast_field . name ) if ast_field . always_serialize and not ast_field . optional : ctxt . add_bad_field_always_serialize_not_optional ( ast_field , ast_field . name ) # A "chain" type should never appear as a field. if ast_field . type . bson_serialization_type == [ 'chain' ] : ctxt . add_bad_array_of_chain ( ast_field , ast_field . name )