title: Yii2 rest create - saving to DB
body: <p>I am trying to save data from the form using yii2 rest api controller, standard create action. New line is created in DB, and id is returned, but data from POST is not saved - only zeroes appear in DB, then I overrided create action by my own one, the same situation. But if I directly save to DB, without rest api controller, data is saved successfully.
  What can be a reason of such strange saving to DB? Thanks! 
  By the way, in index I can see post data in the format: {"_csrf":"wergferw","table_name":{"sum":25000,"currency":1}}</p>
  
  <p>Controller is very simple:</p>
  
  <pre><code>namespace frontend\controllers;
  use yii;
  use yii\rest\ActiveController;
  use yii\web\Response;
  
  
  class DemandController extends ActiveController
  {
      public $modelClass = 'frontend\models\Demands';
  
      public function behaviors()
      {
          $behaviors = parent::behaviors();
          $behaviors['contentNegotiator']['formats']['application/json']   
          =   Response::FORMAT_JSON;
  
          return $behaviors;
      }
  }
  </code></pre>
  
  <p>I get reply in rest:</p>
  
  <pre><code>&lt;response&gt;&lt;id&gt;37&lt;/id&gt;&lt;/response&gt;
  </code></pre>
  
  <p>Model is generated by gii</p>
  
  <pre><code>namespace frontend\models;
  
  use Yii;
  
  class Demands extends \yii\db\ActiveRecord
  {
  
      public static function tableName()
      {
          return 'demands';
      }
  
      public function rules()
      {
          return [
              [['sum', 'currency'], 'required'],
          ];
      }
  
      public function attributeLabels()
      {
          return [
              'sum' =&gt; 'Sum',
              'currency' =&gt; 'Currency',
          ];
      }
  }
  </code></pre>