autorest icon indicating copy to clipboard operation
autorest copied to clipboard

ServiceClient ApiVersion should default to "version" element from Swagger

Open matt-gibbs opened this issue 11 years ago • 2 comments

Gen using the Azure.CSharp generator. Create an instance of the generated client. Call a method on it.

Expected: Version from swagger is used as the default for ServiceClient.ApiVersion Actual: exception that ApiVersion must not be null.

matt-gibbs avatar Oct 27 '15 23:10 matt-gibbs

was specifying -Generator instead of -CodeGenerator so it was using generic C#. Why doesn't the generic C# generator provide the same convenience?

matt-gibbs avatar Oct 28 '15 02:10 matt-gibbs

There is no way to tell whether an operation property with name "apiVersion" should default to API version from the swagger document. Currently we follow the convention that in Azure the parameter name is "api-version" and it's location is in query. This is not always true for generic clients.

stankovski avatar Feb 10 '16 00:02 stankovski