Azure / Azure/autorest.powershell

Compiling generated module with a title that matches the first string in the namespace errors

Open
#887 0 comments 0 reactions 0 assignees View on GitHub
bug P2
Dominant language
C#
Stars
123
Forks
99
PR merge metrics
No merged PRs in 30d

Description

When attempting to build a module that was generated with the following command:

```
autorest --powershell --input-file:.\swagger.json --namespace:Blah.PowerShell --title:Blah
```

*notice the matching namespace and title*

And then trying to build it with:

```powershell
.\build-module.ps1
```

Results in a huge wall of errors (with my swagger it takes 10-15 seconds to display all of it). Here's an example:

```
generated\api\Models\SignupRequest.cs(91,9): error CS0246: The type or namespace name 'Required' could not be found (are you missing a using directive or an assembly reference?) [C:\path\to\generated\Blah.csproj]
```

I'm able to reproduce this with various random names being used for the namespace and the title as long as the first string in the namespace matches the title.

Version:

```text
PS C:\> autorest --version
SourceMapConsumer.initialize is a no-op when running in node.js
AutoRest code generation utility [cli version: 3.5.1; node: v12.19.0]
(C) 2018 Microsoft Corporation.
https://aka.ms/autorest

Showing All Installed Extensions

Type Extension Name Version Location
core @autorest/core 3.7.2 C:\path\to\.autorest\@autorest_core@3.7.2
extension @autorest/modelerfour 4.15.414 C:\path\to\.autorest\@autorest_modelerfour@4.15.414
extension @autorest/modelerfour 4.19.3 C:\path\to\.autorest\@autorest_modelerfour@4.19.3
extension @autorest/powershell 3.0.467 C:\path\to\.autorest\@autorest_powershell@3.0.467
extension @autorest/python 5.12.0 C:\path\to\.autorest\@autorest_python@5.12.0
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.