Azure / Azure/typespec-azure

[typespec/azure-resource-manager] logical result path is undefined in ArmResourceActionAsync

Open
#1,894 3 comments 0 reactions 0 assignees View on GitHub
design:needed lib:azure-resource-manager
Dominant language
TypeScript
Stars
27
Forks
90
Avg merge
1d 22h
Merged PRs (30d)
156

Description

When an async operation is performed using Azure-AsyncOperation, the final result of the operation is returned in the `properties` property in the `ArmOperationStatus` model, see the standards on ARM RPCs [here](https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#azure-asyncoperation-resource-format)

For example, when I write:
```typespec
model Employee is TrackedResource {
...ResourceNameParameter;
}

model EmployeeProperties {
/** Age of employee */
age?: int32;
}

model Result {
/** Result of the action */
result: string;
}

op actionAsync is ArmResourceActionAsync;
```
it now gives us:
```
finalResult: Result
finalEnvelopeResult: Result
envelopeResult: ArmOperationStatus
finalResultPath: undefined
```

Should we have `finalResultPath` as `properties` here?

Contributor guide

Open the contributing guide

Research direction

Start with the ArmResourceActionAsync and ArmOperationStatus definitions, then compare their result handling with the linked ARM asynchronous-operation standard. Done means the generated action metadata sets finalResultPath to properties and matches the reported result shape.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, backend-api-design
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.