[tsp-client convert] Error "invalid-ref: Unknown identifier AadOauth2Auth" converting contosowidgetmanager/data-plane
- Dominant language
- TypeSpec
- Stars
- 4.8k
- Forks
- 736
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 1
Description
Using `@azure-tools/typespec-client-generator-cli@0.15.1` and `@autorest/openapi-to-typespec@0.10.6`, converting `contosowidgetmanager/data-plane` fails with an error compiling the generated code:
```
$ mkdir specification/contosowidgetmanager/Test.TspClientConvert
$ npx tsp-client convert --no-prompt --swagger-readme specification/contosowidgetmanager/data-plane/readme.md -o specification/contosowidgetmanager/Test.TspClientConvert
$ npx tsp compile specification/contosowidgetmanager/Test.TspClientConvert
specification/contosowidgetmanager/Test.TspClientConvert/main.tsp:20:10 - error invalid-ref: Unknown identifier AadOauth2Auth
> 20 | @useAuth(AadOauth2Auth<["https://contoso.azure.com/.default"]>)
| ^^^^^^^^^^^^^
```
data-plane test in azure-rest-api-specs is currently disabled due to this issue:
https://github.com/Azure/azure-rest-api-specs/blob/main/eng/tools/tsp-client-tests/test/tsp-client.test.ts#L75
Contributor guide
Assessment
This issue has not been assessed yet.