You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I try to generate using the typespec-python emitter, I get the following error:
NOTE: I still see this issue with typespec-python 0.36.1.
PS C:\Users\caperal\repos\azure-rest-api-specs\specification\storage\Microsoft.BlobStorage> tsp compile .\client.tsp --emit @azure-tools/typespec-python
TypeSpec compiler v0.61.2
Traceback (most recent call last):
File "C:\Users\caperal\repos\azure-rest-api-specs\node_modules\@typespec\http-client-python/eng/scripts/setup/run_tsp.py", line 40, in <module>
preprocess.PreProcessPlugin(output_folder=args.output_folder, cadl_file=args.cadl_file, **unknown_args).process()
File "C:\Users\caperal\repos\azure-rest-api-specs\node_modules\@typespec\http-client-python\generator\pygen\__init__.py", line 93, in process
self.update_yaml(yaml_data)
File "C:\Users\caperal\repos\azure-rest-api-specs\node_modules\@typespec\http-client-python\generator\pygen\preprocess\__init__.py", line 503, in update_yaml
self.update_operation_groups(yaml_data, client)
File "C:\Users\caperal\repos\azure-rest-api-specs\node_modules\@typespec\http-client-python\generator\pygen\preprocess\__init__.py", line 492, in update_operation_groups
self.get_operation_updater(operation)(code_model, operation)
File "C:\Users\caperal\repos\azure-rest-api-specs\node_modules\@typespec\http-client-python\generator\pygen\preprocess\__init__.py", line 461, in update_paging_operation
item_type = item_type or yaml_data["itemType"]["elementType"]
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
KeyError: 'elementType'
Emitter "@azure-tools/typespec-python" crashed! This is a bug.
Please file an issue at https://github.com/Azure/autorest.python/issues
Error: Command failed: C:\Users\caperal\repos\azure-rest-api-specs\node_modules\@typespec\http-client-python\venv\Scripts\python.exe C:\Users\caperal\repos\azure-rest-api-specs\node_modules\@typespec\http-client-python/eng/scripts/setup/run_tsp.py --output-folder=C:/Users/caperal/repos/azure-rest-api-specs/specification/storage/Microsoft.BlobStorage/tsp-output/@azure-tools/typespec-python --cadl-file=C:/Users/caperal/AppData/Local/Temp/cadl-codegen/python-yaml-pathd263dee7-3893-4099-994b-0134b88c2fc0.yaml --package-version=1.0.0b1 --generate-packaging-files=true --flavor=azure --package-dir=azure-storage-blob --package-name=azure-storage-blob --package-mode=azure-dataplane --models-mode=dpg --emit-cross-language-definition-file=true --from-typespec=true
Traceback (most recent call last):
File "C:\Users\caperal\repos\azure-rest-api-specs\node_modules\@typespec\http-client-python/eng/scripts/setup/run_tsp.py", line 40, in <module>
preprocess.PreProcessPlugin(output_folder=args.output_folder, cadl_file=args.cadl_file, **unknown_args).process()
File "C:\Users\caperal\repos\azure-rest-api-specs\node_modules\@typespec\http-client-python\generator\pygen\__init__.py", line 93, in process
self.update_yaml(yaml_data)
File "C:\Users\caperal\repos\azure-rest-api-specs\node_modules\@typespec\http-client-python\generator\pygen\preprocess\__init__.py", line 503, in update_yaml
self.update_operation_groups(yaml_data, client)
File "C:\Users\caperal\repos\azure-rest-api-specs\node_modules\@typespec\http-client-python\generator\pygen\preprocess\__init__.py", line 492, in update_operation_groups
self.get_operation_updater(operation)(code_model, operation)
File "C:\Users\caperal\repos\azure-rest-api-specs\node_modules\@typespec\http-client-python\generator\pygen\preprocess\__init__.py", line 461, in update_paging_operation
item_type = item_type or yaml_data["itemType"]["elementType"]
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
KeyError: 'elementType'
at checkExecSyncError (node:child_process:890:11)
at execSync (node:child_process:962:15)
at $onEmit (file:///C:/Users/caperal/repos/azure-rest-api-specs/node_modules/@typespec/http-client-python/dist/emitter/emitter.js:101:9)
at async Object.$onEmit [as emitFunction] (file:///C:/Users/caperal/repos/azure-rest-api-specs/node_modules/@azure-tools/typespec-python/dist/src/emitter.js:3:5)
at async runEmitter (file:///C:/Users/caperal/repos/azure-rest-api-specs/node_modules/@typespec/compiler/dist/src/core/program.js:367:13)
at async compile (file:///C:/Users/caperal/repos/azure-rest-api-specs/node_modules/@typespec/compiler/dist/src/core/program.js:119:9)
at async compileOnce (file:///C:/Users/caperal/repos/azure-rest-api-specs/node_modules/@typespec/compiler/dist/src/core/cli/actions/compile/compile.js:36:25)
at async compileAction (file:///C:/Users/caperal/repos/azure-rest-api-specs/node_modules/@typespec/compiler/dist/src/core/cli/actions/compile/compile.js:19:9)
--------------------------------------------------
Library Version 0.35.1
TypeSpec Compiler Version 0.61.2
--------------------------------------------------
Workaround: Had to comment out the @pagedResult decorator in order to be able to get something generated which means the generated code is wrong.
The text was updated successfully, but these errors were encountered:
I have the following typespec specification: https://github.com/Azure/azure-rest-api-specs/tree/feature/blob-tsp/specification/storage/Microsoft.BlobStorage
When I try to generate using the typespec-python emitter, I get the following error:
NOTE: I still see this issue with typespec-python 0.36.1.
Workaround: Had to comment out the
@pagedResult
decorator in order to be able to get something generated which means the generated code is wrong.The text was updated successfully, but these errors were encountered: