title: sharepoint 2013 _api/$metadata error 'A nonnullable DataProperty cannot have a null defaultValue. Name: undefined'
body: <p>I try to use sharepoint 2013 rest api with breezejs.
  I get <strong>error</strong> </p>
  
  <pre><code>A nonnullable DataProperty cannot have a null defaultValue. Name: undefined
  </code></pre>
  
  <p>when breezejs validates  returned metadata (_api/$metadata). 
  With breeze.EntityManager("/_vti_bin/listdata.svc/") all works.</p>
  
  <p>What are the ways to fix it?</p>
  
  <pre><code>&lt;script src="/_layouts/15/SharePointProject7/scripts/angular.min.js"&gt;&lt;/script&gt;
  &lt;script src="/_layouts/15/SharePointProject7/scripts/q.min.js"&gt;&lt;/script&gt;
  &lt;script src="/_layouts/15/SharePointProject7/scripts/datajs-1.1.1.min.js"&gt;&lt;/script&gt;
  &lt;script src="/_layouts/15/SharePointProject7/scripts/breeze.min.js"&gt;&lt;/script&gt;
  &lt;script src="/_layouts/15/SharePointProject7/scripts/breeze.toq.js"&gt;&lt;/script&gt;
  &lt;script src="/_layouts/15/SharePointProject7/scripts/app.js"&gt;&lt;/script&gt;
  
  
  &lt;div data-ng-app="app"&gt;
      &lt;div data-ng-controller="Ctrl2"&gt;
          &lt;ul&gt;
             &lt;li data-ng-repeat="c in customers"&gt;&lt;input type="text" data-ng-model="c.Title" /&gt;&lt;/li&gt;
          &lt;/ul&gt;
      &lt;button type="button" data-ng-click="save()"&gt;Save&lt;/button&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  
  var app = angular.module('app', []);
  
  app.run(['$q', '$rootScope', function ($q, $rootScope) {
      breeze.core.extendQ($rootScope, $q);
  }]);
  
  app.service('listData', function () {
  
      breeze.config.initializeAdapterInstances({ dataService: "OData" });
      var manager = new breeze.EntityManager("/_api/");
  
      var changes;
      this.getItems = function () {
          var query = breeze.EntityQuery.from("Lists");
          return manager.executeQuery(query).to$q();
      };
  
      this.saveItems = function () {
  
          if (manager.hasChanges()) {
  
  
              changes = manager.getChanges();
  
              manager.saveChanges().to$q(saveSucceeded, saveFailed);
          }
          else {
              alert("Nothing to save");
          };
  
      };
  
  
      function saveSucceeded() {
  
          alert("OK");
      };
  
      function saveFailed(error) {
          alert(error.message);
      };
  });
  
  app.controller('Ctrl2', function ($scope, listData) {
      function initialize() {
          listData.getItems().then(querySucceeded, _queryFailed);
  
      };
  
      function querySucceeded(data) {
          $scope.customers = data.results;
  
      }
  
      function _queryFailed(error) {
          alert(error.message);
      }
  
      $scope.save = function () {
  
          listData.saveItems();
  
  
      };
      initialize();
  });
  </code></pre>