Attempt to use AutoRest to generate PowerShell Module fails
See original GitHub issueReferencing issue: https://github.com/Azure/autorest.powershell/issues/385
Was hoping Okta et al. could have a quick look to make sure its not something in the yaml. Thank you for your time in advance.
Attempting to generate PowerShell module with spec: https://github.com/okta/okta-sdk-java/blob/master/src/swagger/api.yaml
PS C:\Scripts> autorest --reset
AutoRest code generation utility [version: 3.0.5221; node: v10.16.0, max-memory: 8192 gb]
(C) 2018 Microsoft Corporation.
https://aka.ms/autorest
Cleared the AutoRest extension folder.
On the next run, extensions will be reacquired from the repository.
autorest --powershell --input-file:./okta.yaml --clear-output-folder
AutoRest code generation utility [version: 3.0.5221; node: v10.16.0, max-memory: 8192 gb]
(C) 2018 Microsoft Corporation.
https://aka.ms/autorest
Loading AutoRest core 'C:\Users\kevin.blumenfeld\.autorest\@microsoft.azure_autorest-core@3.0.5504\node_modules\@microsoft.azure\autorest-core\dist' (3.0.5504)
Installing AutoRest extension '@microsoft.azure/autorest.powershell' (beta)
Installed AutoRest extension '@microsoft.azure/autorest.powershell' (beta->2.0.547)
Installing AutoRest extension '@microsoft.azure/autorest.remodeler' (beta)
Installed AutoRest extension '@microsoft.azure/autorest.remodeler' (beta->2.0.317)
Installing AutoRest extension '@microsoft.azure/autorest.csharp-v2' (beta)
Installed AutoRest extension '@microsoft.azure/autorest.csharp-v2' (beta->2.0.350)
WARNING (): Operation forgot/password is inferred without finding action.
- code-model-v3-tweakcodemodel.yaml:1:1
WARNING (): Operation expire/password is inferred without finding action.
- code-model-v3-tweakcodemodel.yaml:1:1
WARNING (): Operation unsuspend/user is inferred without finding action.
- code-model-v3-tweakcodemodel.yaml:1:1
ERROR (UnknownJsonType/LLCS2000): Schema 'BasicAuthApplicationName' is declared with invalid type 'undefined'
- code-model-v3-modifiers.yaml:1:1
C:\Users\kevin.blumenfeld\.autorest\@microsoft.azure_autorest.csharp-v2@2.0.350\node_modules\@microsoft.azure\autorest.csharp-v2\dist\plugin-llcsharp.js - Error: Unknown Model. Fatal.
at SchemaDefinitionResolver.resolveTypeDeclaration (C:\Users\kevin.blumenfeld\.autorest\@microsoft.azure_autorest.csharp-v2@2.0.350\node_modules\@microsoft.azure\autorest.csharp-v2\schema\schema-resolver.ts:145:11)
at ModelsNamespace.resolveTypeDeclaration (C:\Users\kevin.blumenfeld\.autorest\@microsoft.azure_autorest.csharp-v2@2.0.350\node_modules\@microsoft.azure\autorest.csharp-v2\model\namespace.ts:69:30)
at ModelInterface.init (C:\Users\kevin.blumenfeld\.autorest\@microsoft.azure_autorest.csharp-v2@2.0.350\node_modules\@microsoft.azure\autorest.csharp-v2\model\interface.ts:111:58)
at new ModelClass (C:\Users\kevin.blumenfeld\.autorest\@microsoft.azure_autorest.csharp-v2@2.0.350\node_modules\@microsoft.azure\autorest.csharp-v2\model\model-class.ts:113:198)
at ModelsNamespace.resolveTypeDeclaration (C:\Users\kevin.blumenfeld\.autorest\@microsoft.azure_autorest.csharp-v2@2.0.350\node_modules\@microsoft.azure\autorest.csharp-v2\model\namespace.ts:80:65)
at new ModelsNamespace (C:\Users\kevin.blumenfeld\.autorest\@microsoft.azure_autorest.csharp-v2@2.0.350\node_modules\@microsoft.azure\autorest.csharp-v2\model\namespace.ts:56:12)
at Project.init (C:\Users\kevin.blumenfeld\.autorest\@microsoft.azure_autorest.csharp-v2@2.0.350\node_modules\@microsoft.azure\autorest.csharp-v2\project.ts:69:46)/Unknown Model. Fatal.
PLUGIN FAILURE: Unknown Model. Fatal., Error: Unknown Model. Fatal.
at SchemaDefinitionResolver.resolveTypeDeclaration (C:\Users\kevin.blumenfeld\.autorest\@microsoft.azure_autorest.csharp-v2@2.0.350\node_modules\@microsoft.azure\autorest.csharp-v2\schema\schema-resolver.ts:145:11)
at ModelsNamespace.resolveTypeDeclaration (C:\Users\kevin.blumenfeld\.autorest\@microsoft.azure_autorest.csharp-v2@2.0.350\node_modules\@microsoft.azure\autorest.csharp-v2\model\namespace.ts:69:30)
at ModelInterface.init (C:\Users\kevin.blumenfeld\.autorest\@microsoft.azure_autorest.csharp-v2@2.0.350\node_modules\@microsoft.azure\autorest.csharp-v2\model\interface.ts:111:58)
at new ModelClass (C:\Users\kevin.blumenfeld\.autorest\@microsoft.azure_autorest.csharp-v2@2.0.350\node_modules\@microsoft.azure\autorest.csharp-v2\model\model-class.ts:113:198)
at ModelsNamespace.resolveTypeDeclaration (C:\Users\kevin.blumenfeld\.autorest\@microsoft.azure_autorest.csharp-v2@2.0.350\node_modules\@microsoft.azure\autorest.csharp-v2\model\namespace.ts:80:65)
at new ModelsNamespace (C:\Users\kevin.blumenfeld\.autorest\@microsoft.azure_autorest.csharp-v2@2.0.350\node_modules\@microsoft.azure\autorest.csharp-v2\model\namespace.ts:56:12)
at Project.init (C:\Users\kevin.blumenfeld\.autorest\@microsoft.azure_autorest.csharp-v2@2.0.350\node_modules\@microsoft.azure\autorest.csharp-v2\project.ts:69:46), {}
FATAL: Error: Unknown Model. Fatal.
C:\Users\kevin.blumenfeld\.autorest\@microsoft.azure_autorest-core@3.0.5504\node_modules\@microsoft.azure\autorest-core\dist\lib\pipeline\pipeline.js - FAILURE {}
ERROR (UnknownJsonType/LLCS2000): Schema 'ApplicationSettingsApplication' is declared with invalid type 'undefined'
- code-model-v3-add-azure-completers.yaml:1:1
C:\Users\kevin.blumenfeld\.autorest\@microsoft.azure_autorest.powershell@2.0.547\node_modules\@microsoft.azure\autorest.powershell\dist\plugin-powershell.js - FAILURE {} Error: Unknown Model. Fatal.
at PSSchemaResolver.resolveTypeDeclaration (C:\Users\kevin.blumenfeld\.autorest\@microsoft.azure_autorest.powershell@2.0.547\node_modules\@microsoft.azure\autorest.csharp-v2\schema\schema-resolver.ts:145:11)
at PSSchemaResolver.resolveTypeDeclaration (C:\Users\kevin.blumenfeld\.autorest\@microsoft.azure_autorest.powershell@2.0.547\node_modules\@microsoft.azure\autorest.powershell\project.ts:45:18)
at CmdletClass.addPowershellParameters (C:\Users\kevin.blumenfeld\.autorest\@microsoft.azure_autorest.powershell@2.0.547\node_modules\@microsoft.azure\autorest.powershell\cmdlet-class.ts:886:74)
at CmdletClass.init (C:\Users\kevin.blumenfeld\.autorest\@microsoft.azure_autorest.powershell@2.0.547\node_modules\@microsoft.azure\autorest.powershell\cmdlet-class.ts:133:10)
at CmdletNamespace.init (C:\Users\kevin.blumenfeld\.autorest\@microsoft.azure_autorest.powershell@2.0.547\node_modules\@microsoft.azure\autorest.powershell\namespaces\cmdlet.ts:31:110)
PLUGIN FAILURE: Unknown Model. Fatal., Error: Unknown Model. Fatal.
at PSSchemaResolver.resolveTypeDeclaration (C:\Users\kevin.blumenfeld\.autorest\@microsoft.azure_autorest.powershell@2.0.547\node_modules\@microsoft.azure\autorest.csharp-v2\schema\schema-resolver.ts:145:11)
at PSSchemaResolver.resolveTypeDeclaration (C:\Users\kevin.blumenfeld\.autorest\@microsoft.azure_autorest.powershell@2.0.547\node_modules\@microsoft.azure\autorest.powershell\project.ts:45:18)
at CmdletClass.addPowershellParameters (C:\Users\kevin.blumenfeld\.autorest\@microsoft.azure_autorest.powershell@2.0.547\node_modules\@microsoft.azure\autorest.powershell\cmdlet-class.ts:886:74)
at CmdletClass.init (C:\Users\kevin.blumenfeld\.autorest\@microsoft.azure_autorest.powershell@2.0.547\node_modules\@microsoft.azure\autorest.powershell\cmdlet-class.ts:133:10)
at CmdletNamespace.init (C:\Users\kevin.blumenfeld\.autorest\@microsoft.azure_autorest.powershell@2.0.547\node_modules\@microsoft.azure\autorest.powershell\namespaces\cmdlet.ts:31:110), {}
FATAL: Error: Unknown Model. Fatal.
C:\Users\kevin.blumenfeld\.autorest\@microsoft.azure_autorest-core@3.0.5504\node_modules\@microsoft.azure\autorest-core\dist\lib\pipeline\pipeline.js - FAILURE {}
Process() cancelled due to exception : Plugin llcsharp reported failure. / Error: Plugin llcsharp reported failure.
at C:\Users\kevin.blumenfeld\.autorest\@microsoft.azure_autorest-core@3.0.5504\node_modules\@microsoft.azure\autorest-core\dist\lib\pipeline\plugins\external.js:26:19
Error: Plugin llcsharp reported failure.```
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
AutoRest.PowerShell - DEV Community
AutoRest.PowerShell enable PowerShell users to create a PowerShell module to deal with an API by using a specification file as input.
Read more >Resource not found errors - Azure Resource Manager
If you're using PowerShell or Azure CLI, check that you're running commands in the subscription that contains the resource.
Read more >Troubleshooting the Azure Az PowerShell module
One of the first steps you should take in troubleshooting a problem with the Azure Az PowerShell module is to enable debug logging....
Read more >Troubleshoot Azure VM Image Builder - Microsoft Learn
This article helps you troubleshoot common problems and errors you might encounter when you're using Azure VM Image Builder.
Read more >WARNING: Unable to acquire token for tenant - Microsoft Q&A
When i am trying to connect to my azure portal through powershell iam ... normally use Connect-AzAccount followed by Get-AzSubscription to ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @kevinblumenfeld
I’d be interested in your use case, since I’m also interested in Swagger -> PowerShell.
I created https://github.com/gabrielsroka/OktaAPI.psm1 but it was coded by hand.
@kevinblumenfeld That does look like an issue, I’ll see what we can do.
Thanks for digging into this!