Describe the bug
Running autorest --powershell throws an error when a freeform object is defined in the specification.
debug | [4.67 s] detecting high level commands...
PLUGIN FAILURE: Cannot read properties of null (reading 'language'), TypeError: Cannot read properties of null (reading 'language')
at C:\Users\user\.autorest\@autorest_powershell@3.0.493\node_modules\@autorest\powershell\plugins\create-commands-v2.ts:437:149
at Object.<anonymous> (C:\Users\user\.autorest\@autorest_powershell@3.0.493\node_modules\@azure-tools\linq\new-linq.ts:280:11)
at Generator.next (<anonymous>)
at Generator.toArray (C:\Users\user\.autorest\@autorest_powershell@3.0.493\node_modules\@azure-tools\linq\new-linq.ts:336:14)
at Inferrer.addVariants (C:\Users\user\.autorest\@autorest_powershell@3.0.493\node_modules\@autorest\powershell\plugins\create-commands-v2.ts:437:176)
at Inferrer.createCommands (C:\Users\user\.autorest\@autorest_powershell@3.0.493\node_modules\@autorest\powershell\plugins\create-commands-v2.ts:167:22)
at createCommandsV2 (C:\Users\user\.autorest\@autorest_powershell@3.0.493\node_modules\@autorest\powershell\plugins\create-commands-v2.ts:502:77)
at C:\Users\user\.autorest\@autorest_powershell@3.0.493\node_modules\@azure-tools\autorest-extension-base\extension-base.ts:68:9, {}
fatal | TypeError: Cannot read properties of null (reading 'language')
fatal | Process() cancelled due to exception : Plugin create-commands-v2 reported failure. / Error: Plugin create-commands-v2 reported failure.
at C:\Users\user\.autorest\@autorestcore@3.9.0\node_modules\@autorest\core\dist\src_lib_autorest-corets.js:2817:19
at ScheduleNode (C:\Users\user\.autorest\@autorestcore@3.9.0\node_modules\@autorest\core\dist\src_lib_autorest-corets.js:1351:29)
error | Error: Plugin create-commands-v2 reported failure.
error | Autorest completed with an error. If you think the error message is unclear, or is a bug, please declare an issues at https://github.com/Azure/autorest/issues with the error message you are seeing.
debug | [4.73 s] Shutting Down.
debug | [4.73 s] Exiting.
OpenAPI method
requestBody:
required: true
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/Authorization"
- type: object
properties:
id:
readOnly: true
authorizers:
readOnly: true
status:
readOnly: true
authorizationData:
readOnly: true
- required:
- approvalResult
responses:
'200':
description: OK
'404':
description: A request with the specified ID or authorization with the specified ID was not found.
Before filling a bug
Describe the bug Running autorest --powershell throws an error when a freeform object is defined in the specification.
OpenAPI method
Schema:
Expected behavior Generation with support for freeform object.