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
178
stars
75
forks
source link
Issues #6: CADL Generated Code Issue in EventGrid SDK #1852
While working on the EventGrid SDK, generated from the CADL files, I have noticed the following.
In CADL, we have the following PublishCloudEvent api.
@doc("Publish Single Cloud Event to namespace topic. In case of success, the server responds with an HTTP 200 status code with an empty JSON object in response. Otherwise, the server can return various error codes. For example, 401: which indicates authorization failure, 403: which indicates quota exceeded or message is too large, 410: which indicates that specific topic is not found, 400: for bad request, and 500: for internal server error. ")
@route("/topics/{topicName}:publish", {shared: true})
@post op PublishCloudEvent is Azure.Core.RpcOperation<PublishCloudEventBody, PublishResult>;
@doc("The result of the Publish operation.")
model PublishResult {}
Look at the return type. It is PublishResult and is an empty object. Look at the generated output:
While working on the EventGrid SDK, generated from the CADL files, I have noticed the following.
In CADL, we have the following
PublishCloudEvent
api.Look at the return type. It is
PublishResult
and is an empty object. Look at the generated output:Now, the generated output has no reference to
PublishResult
object. We want the output to be:We need a code change to fix this issue