Autorest: OpenAPI 3 Deduplication exception Cannot delete property '17' of [object String]

Created on 17 May 2019  ·  4Comments  ·  Source: Azure/autorest

I'm using the beta to try to generate a c# wrapper with OpenApi 3. However, I consistently get the error Cannot delete property '17' of [object String]

I've fiddled a bit with my swagger settings, but I don't have enough insight into the error to have a solid direction.

Let me know if there is any info I can provide.

__Version/system info__ [version: 3.0.5199; node: v11.12.0, max-memory: 8192 gb]

__Full Exception__

Process() cancelled due to exception : Cannot delete property '17' of [object String] / TypeError: Cannot delete property '17' of [object String]
    at Deduplicator.deduplicateAdditionalFieldMembers (/node_modules/@microsoft.azure/deduplication/dist/main.js:101:55)
    at Deduplicator.init (/node_modules/@microsoft.azure/deduplication/dist/main.js:83:26)
    at Deduplicator.get output [as output] (/node_modules/@microsoft.azure/deduplication/dist/main.js:311:18)
    at deduplicate (C:\Users\farle\.autorest\@[email protected]\node_modules\@microsoft.azure\autorest-core\dist\lib\pipeline\plugins\deduplicator.js:15:88)
    at processTicksAndRejections (internal/process/next_tick.js:81:5)
  TypeError: Cannot delete property '17' of [object String]

Most helpful comment

I was able to workaround this by removing
"x-generator": "NSwag v12.3.1.0 (NJsonSchema v9.14.1.0 (Newtonsoft.Json v11.0.0.0))"
from the top of my swagger spec.

All 4 comments

Some additional information
The error does not happen with Swagger 2.0 in autorest version: 2.0.4283; node: v11.12.0
However、 it does happen with Swagger 2.0 in autorest version: 3.0.5199

I'm hitting this too running the command:
autorest --powershell --input-file:swagger.json --verbose
on version: 3.0.5200; node: v10.16.0.

With the attached swagger spec.

I was able to workaround this by removing
"x-generator": "NSwag v12.3.1.0 (NJsonSchema v9.14.1.0 (Newtonsoft.Json v11.0.0.0))"
from the top of my swagger spec.

I have also experienced this exact error and confirm that the workaround from jeremy-collette worked for me

Was this page helpful?
0 / 5 - 0 ratings