Azure / autorest-clientruntime-for-java

The runtime libraries for AutoRest generated Java clients.
MIT License
20 stars 59 forks source link

handling of x-ms-pageable.nextLinkName = null is incorrect #497

Open anuchandy opened 6 years ago

anuchandy commented 6 years ago
        "x-ms-pageable": {
          "nextLinkName": null
        }

The above convention tell codegen that - The API is not pagable. Return type of the API is a model with composed list and when receiving such a response from service, client should extract the composed list and return the list instead of the model that composes the list.

But this is not happening for this API.

The generated method signature is correct but when receiving following response from service

{
  "value": [
     { 
         "id": "someid1",
         "name": "eastasia",
         "displayname": "East Asia"
     },
     { 
         "id": "someid2",
         "name": "easus",
         "displayname": "East US"
     }
  ]
}

Proxy returns a list with 1 element of type Location with all properties set to null.

anuchandy commented 6 years ago

This can be repro-ed by running the test AzureTests.listLocations.