Azure-Samples / Azure-Time-Series-Insights

Sample modules written in different languages that can be used as templates for applications needing to query Time Series Insights
MIT License
21 stars 31 forks source link

C# code generation with AutoRest failed #20

Closed mjhubert closed 4 years ago

mjhubert commented 4 years ago

This issue is for a:

- [x ] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

git clone https://github.com/Azure-Samples/Azure-Time-Series-Insights.git cd Azure-Time-Series-Insights\csharp-tsi-preview-sample\DataPlaneClient .\GenerateCode.bat AutoRest .\azure-rest-api-specs\specification\timeseriesinsights\data-plane\readme.md --csharp-sdks-folder=.\Generated --csharp --verbose --latest --azure-validator --model-validator --semantic-validator

Any log messages given by the failure


AutoRest .\azure-rest-api-specs\specification\timeseriesinsights\data-plane\readme.md --csharp-sdks-folder=.\Generated --csharp --verbose --latest --azure-validator --model-validator --semantic-validator
AutoRest code generation utility [cli version: 3.0.6187; node: v12.16.3, max-memory: 8192 gb]
(C) 2018 Microsoft Corporation.
https://aka.ms/autorest
NOTE: AutoRest core version selected from configuration: ~2.0.4413.
   Loading AutoRest core      'C:\Users\michelh\.autorest\@microsoft.azure_autorest-core@2.0.4417\node_modules\@microsoft.azure\autorest-core\dist' (2.0.4417)
   Loading AutoRest extension '@microsoft.azure/autorest.csharp' (~2.3.79->2.3.84)
   Loading AutoRest extension '@microsoft.azure/classic-openapi-validator' (~1.0.9->1.0.14)
   Loading AutoRest extension '@microsoft.azure/openapi-validator' (~1.0.2->1.0.4)
   Loading AutoRest extension 'oav' (~0.4.20->0.4.70)
   Loading AutoRest extension '@microsoft.azure/autorest.modeler' (2.3.55->2.3.55)
VERBOSE: Validating 'file:///C:/source/experimental/azure/p2/Azure-Time-Series-Insights/csharp-tsi-preview-sample/DataPlaneClient/azure-rest-api-specs/specification/timeseriesinsights/data-plane/Microsoft.TimeSeriesInsights/preview/2018-11-01-preview/timeseriesinsights.json'
VERBOSE: Validating 'swagger-document'
TypeError: jsonPath.nodes is not a function
    at openApiValidationExample (C:\Users\michelh\.autorest\oav@0.4.70\node_modules\oav\dist\lib\autorestPlugin\extension.js:75:40)
    at async analyzeSwagger (C:\Users\michelh\.autorest\oav@0.4.70\node_modules\oav\dist\lib\autorestPlugin\extension.js:34:38)
    at async C:\Users\michelh\.autorest\oav@0.4.70\node_modules\oav\dist\lib\autorestPlugin\extension.js:48:70
    at async Promise.all (index 0)
    at async C:\Users\michelh\.autorest\oav@0.4.70\node_modules\oav\dist\lib\autorestPlugin\extension.js:49:5
    at async C:\Users\michelh\.autorest\oav@0.4.70\node_modules\@microsoft.azure\autorest-extension-base\dist\lib\extension-base.js:39:17
FATAL: TypeError: jsonPath.nodes is not a function
FATAL: swagger-document/model-validator - FAILED
FATAL: Error: Plugin model-validator reported failure.
Process() cancelled due to exception : Plugin model-validator reported failure.
  Error: Plugin model-validator reported failure.```

### Expected/desired behavior
> C# code generated

### OS and Version?
> Windows 10.

### Versions
> AutoRest core version selected from configuration: ~2.0.4413
Sandip-Raiyani commented 4 years ago

Hey @mjhubert ,

We are looking into this issue and will be updating the samples soon. Meanwhile, can you try removing "--model-validator" by editing Generate.bat and try running it again. Let us know if the samples works for you.