Open tjprescott opened 1 year ago
This is due to how ResourceCreatedOrOkResponse
and its related types are defined:
alias ResourceCreatedResponse<T extends object> = TypeSpec.Http.Response<201> & T;
alias ResourceOkResponse<T> = TypeSpec.Http.Response<200> & T;
alias ResourceCreatedOrOkResponse<T extends object> = ResourceCreatedResponse<T> | ResourceOkResponse<T>;
Because they're all aliases and the only real named type involved (Response
) is a metadata-only type, the resulting type will always come out anonymous. Not sure how easy it will be to fix this.
I feel like for the docs we should be able to trace back if a type was declared in an alias and expose that to the user.
@markcowl find issue on template docs
This is the issue on template documentation that is similar: https://github.com/Azure/typespec-azure-pr/issues/2923
op Azure.Core.ResourceOperations.ResourceCreateOrReplace(apiVersion: string, resource: TResource): (anonymous model) | (anonymous model) | TErrorResponse
Note the two instances of
(anonymous model)
. This isn't helpful for users.Here is the actual source:
Presumably the two anonymous models are the
ResourceCreated
andOkResponse
models.