typespec
typespec copied to clipboard
Need a helper for determining the logical rpc-style response type for http operations
- Add a new property to HttpOperation and HttpOperationResponse
- Update
getHttpOperationto populate these properties- if a request/response type has a property decorated with
@body(@bodyRoot) use its type as logicalRequest/logicalResponse - Otherwise, determine the parameterVisibility for the request and the returnTypeVisibility for the response
- Use resolved parameter visisbility to call metadata.getEffectiveModelType() for the logicalRequestType
- Use resolved returnTypeVisibility to call metdata.getEffectiveModelType() for the logicalResponseType
- provide a separate property or method to return the set of properties that represent the payload (request or response)
- if a request/response type has a property decorated with
export interface HttpOperation {
/** The request payload */
logicalRequest: Type;
}
export interface HttpOperationResponse {
/** The logical RPC-style response */
logicalResponse: Type;
}
est: 8
@markcowl does the 8 estimate include the time it will take to refactor the OpenAPI (and possibly Autorest?) emitter to use this new helper?