def read_attribute (field, context)
      if field.multivalued?
        arr = json_attributes[field.name]
        unless arr
          arr = EmbeddedDocumentArray.new(field.type, context)
          json_attributes[field.name] = arr
        end
        return arr
      else
        val = json_attributes[field.name]
        if val.nil? and !field.default.nil?
          val = field.default.dup rescue field.default
          json_attributes[field.name] = val
        end
        return val
      end
    end
def read_attribute (field, context)
      if field.multivalued?
        arr = json_attributes[field.name]
        unless arr
          arr = EmbeddedDocumentArray.new(field.type, context)
          json_attributes[field.name] = arr
        end
        return arr
      else
        val = json_attributes[field.name]
        if val.nil? and !field.default.nil?
          val = field.default.dup rescue field.default
          json_attributes[field.name] = val
        end
        return val
      end
    end
Read a field. The field param must be a FieldDefinition and the context should be the record
 which is being read from.