Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: plainDirectives.flatMap is not a function #224

Open
icnocop opened this issue Jun 29, 2021 · 0 comments
Open

TypeError: plainDirectives.flatMap is not a function #224

icnocop opened this issue Jun 29, 2021 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@icnocop
Copy link

icnocop commented Jun 29, 2021

When I try to generate an AutoRest C# client from AutoRestClient.json, I get the following error:

(node:18000) ExperimentalWarning: The fs.promises API is experimental
  TypeError: plainDirectives.flatMap is not a function


   at ChristianHelle.DeveloperTools.CodeGenerators.ApiClient.Core.Generators.ProcessLauncher.StartInternal(String command, String arguments, Action`1 onOutputData, Action`1 onErrorData, String workingDirectory)
   at ChristianHelle.DeveloperTools.CodeGenerators.ApiClient.Core.Generators.ProcessLauncher.Start(String command, String arguments, Action`1 onOutputData, Action`1 onErrorData, String workingDirectory)
   at ChristianHelle.DeveloperTools.CodeGenerators.ApiClient.Core.Generators.ProcessLauncher.Start(String command, String arguments, String workingDirectory)
   at ChristianHelle.DeveloperTools.CodeGenerators.ApiClient.Core.Generators.AutoRest.AutoRestCSharpCodeGenerator.OnGenerateCode(IProgressReporter pGenerateProgress)
   at ChristianHelle.DeveloperTools.CodeGenerators.ApiClient.Core.Generators.AutoRest.AutoRestCSharpCodeGenerator.GenerateCode(IProgressReporter pGenerateProgress)
   at ChristianHelle.DeveloperTools.CodeGenerators.ApiClient.CustomTool.SingleFileCodeGenerator.Generate(String wszInputFilePath, String bstrInputFileContents, String wszDefaultNamespace, IntPtr[] rgbOutputFileContents, UInt32& pcbOutput, IVsGeneratorProgress pGenerateProgress)

Support Key: 14a9a75

Steps to reproduce

  1. Visual Studio 2019 Enterprise Edition
  2. Create a new C# library project which targets .net standard 2.0
  3. Right-click on the project and select Add > New REST API Client > Generate with AutoRest
  4. Enter URL of swagger.json
  5. Enter Filename AutoRestClient
  6. Click OK
    I expected the client to get generated here, but it didn't.
    The Output window indicated the "Microsoft.Azure.AutoRest.CSharp" nuget package installation failed.
    I had to add this to my csproj to be able to build:
    <LangVersion>8.0</LangVersion>
  7. Right-click on AutoRestClient.json and select "Run Custom Tool"
    Error appeared in the Output window.

Expected behavior
I expected the REST API client class to be generated.

Screenshots
image

Visual Studio Extension:

  • Visual Studio 2019
  • REST API Client Code Generator 1.2.7037

Additional context
Thank you!

Edit FYI, as a work-around, I'm now using https://devblogs.microsoft.com/aspnet/generating-http-api-clients-using-visual-studio-connected-services/ instead.

@christianhelle christianhelle self-assigned this Jul 1, 2021
@christianhelle christianhelle added the bug Something isn't working label Jul 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants