Azure / autorest.typescript

Extension for AutoRest (https://github.com/Azure/autorest) that generates TypeScript code. The transpiled javascript code is isomorphic. It can be run in browser and in node.js environment.
MIT License
177 stars 75 forks source link

Operation spec missing `contentType` field when `"consumes" = [ "application/json" ]` override is specified #500

Open jeremymeng opened 4 years ago

jeremymeng commented 4 years ago

(more detailed discussion at https://github.com/Azure/azure-sdk-for-js/pull/5980#discussion_r348009598)

Short summary

It looks like autorest typescript plugin should generate correct contentType field when "consumes" = [ "application/json" ] is specified.

The same swagger file has another consumes override to application/octa-stream

https://github.com/Azure/azure-rest-api-specs/blob/7fd37fcd3c54742d07bd70435f75ef46ec99d9e3/specification/storage/data-plane/Microsoft.FileStorage/preview/2019-02-02/file.json#L2797

and it generates operation spec with expected contentType field:

https://github.com/Azure/azure-sdk-for-js/blob/cf0c4bc079f5890d520124aad92af6630e5a1966/sdk/storage/storage-file-share/src/generated/src/operations/file.ts#L717

jeremymeng commented 4 years ago

@sarangan12 @daviwil

joheredi commented 4 years ago

We need to verify if this also happens in v6