Skip to content

Commit

Permalink
Do not need check property availability if nextLinkName is null (Azur…
Browse files Browse the repository at this point in the history
  • Loading branch information
xingwu1 authored and tbombach committed Jun 17, 2016
1 parent 89bf350 commit 64a7b86
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ private string GetPagingSetting(CompositeType body, Dictionary<string, object> e
{
var ext = extensions[AzureExtensions.PageableExtension] as Newtonsoft.Json.Linq.JContainer;

bool ignoreNextLink = false;
if (ext["nextLinkName"] != null && ext["nextLinkName"].Type == Newtonsoft.Json.Linq.JTokenType.Null)
{
ignoreNextLink = true;
}
string nextLinkName = (string)ext["nextLinkName"] ?? "nextLink";
string itemName = (string)ext["itemName"] ?? "value";

Expand All @@ -111,7 +116,7 @@ private string GetPagingSetting(CompositeType body, Dictionary<string, object> e
}
}

if (!findNextLink)
if (!ignoreNextLink && !findNextLink)
{
throw new KeyNotFoundException("Couldn't find the nextLink property specified by extension");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ var util = require('util');
* @member {array} [value] Gets the list of storage accounts and their
* properties.
*
* @member {string} [nextLink]
*
*/
function StorageAccountListResult() {
}
Expand Down
2 changes: 0 additions & 2 deletions Samples/azure-storage/Azure.NodeJS/models/usageListResult.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ var util = require('util');
* The List Usages operation response.
* @member {array} [value] Gets or sets the list Storage Resource Usages.
*
* @member {string} [nextLink]
*
*/
function UsageListResult() {
}
Expand Down
6 changes: 0 additions & 6 deletions Samples/azure-storage/azure-storage.json
Original file line number Diff line number Diff line change
Expand Up @@ -657,9 +657,6 @@
"$ref": "#/definitions/StorageAccount"
},
"description": "Gets the list of storage accounts and their properties."
},
"nextLink": {
"type": "string"
}
},
"description": "The list storage accounts operation response."
Expand Down Expand Up @@ -775,9 +772,6 @@
"$ref": "#/definitions/Usage"
},
"description": "Gets or sets the list Storage Resource Usages."
},
"nextLink": {
"type": "string"
}
},
"description": "The List Usages operation response."
Expand Down

0 comments on commit 64a7b86

Please sign in to comment.