microsoft / microsoft/typespec

Poor operation template documentation

Open
#1,972 4 comments 0 reactions 1 assignee Claimed by @tjprescott View on GitHub
design:needed
Dominant language
Java
Stars
5.9k
Forks
394
Avg merge
1d 23h
Merged PRs (30d)
104

Description

`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:
```
interface ResourceOperations<
InterfaceTraits,
TErrorResponse = Azure.Core.Foundations.ErrorResponse
> {
/**
* Create or replace operation template.
* @template TResource Resource type.
* @template Traits Object describing the traits of the operation.
*/
@createsOrReplacesResource(TResource)
ResourceCreateOrReplace<
TResource extends object,
Traits extends object = {}
> is Foundations.ResourceOperation<
TResource,
Foundations.ResourceBody &
TraitProperties<
Traits & InterfaceTraits,
TraitLocation.Parameters,
TraitContext.Create | TraitContext.Update
>,
Foundations.ResourceCreatedOrOkResponse>,
Traits & InterfaceTraits,
TErrorResponse
>;
```

Presumably the two anonymous models are the `ResourceCreated` and `OkResponse` models.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.