microsoft / microsoft/typespec
Docs: interface.sourceInterfaces is empty at the time of applyDecoratorToType for a decorated operation
- Dominant language
- Java
- Stars
- 5.9k
- Forks
- 394
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 104
Description
Compare the state of interface.sourceInterfaces for the $graphRoute function for the @graphRoute decorator
```
@graphRoute("users/{userId}/children/{childId}")
@test interface interface1 extends TypeSpec.MsGraph.CollectionNavigationSource {
@test @get op get(graphRouteParams: string): entity[];
}
```
vs
```
interface interface1 extends TypeSpec.MsGraph.CollectionNavigationSource {
@graphRoute("users/{userId}/children/{childId}")
@test @get op get(graphRouteParams: string): entity[];
}
```
In the former case, in the call to $graphRoute, the interface's sourceInterfaces collection contains the extended type.
In the latter case, the operation's operation.interface.sourceInterfaces is an empty array.
To be able to write code that depends on that extended interface that follows the usual pattern of applying at either level, we need sourceInterfaces to be populated consistently before the decorators are applied.
Contributor guide
Assessment
This issue has not been assessed yet.