Azure / autorest

OpenAPI (f.k.a Swagger) Specification code generator. Supports C#, PowerShell, Go, Java, Node.js, TypeScript, Python
MIT License
4.61k stars 737 forks source link

$ref to original location not found in new refs collection #3546

Closed erich-wang closed 3 years ago

erich-wang commented 4 years ago
Microsoft (R) Build Engine version 16.5.0+d4cbfca49 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  AutoRest code generation utility [cli version: 3.0.6221; node: v13.12.0, max-memory: 8192 gb]
  (C) 2018 Microsoft Corporation.
  https://aka.ms/autorest
     Loading AutoRest core      'C:\Users\v-lipyo\.autorest\@autorest_core@3.0.6280\node_modules\@autorest\core\dist' (3.0.6280)
     Initial configuration file 'file:///C:/AME/azure-rest-api-specs/specification/mixedreality/resource-manager/readme.md'
     Including configuration file 'file:///C:/Users/v-lipyo/.autorest/@autorest_core@3.0.6280/node_modules/@autorest/core/resources/inspect.md'
     Including configuration file 'file:///C:/Users/v-lipyo/.autorest/@autorest_core@3.0.6280/node_modules/@autorest/core/resources/directives.md'
     Including configuration file 'file:///C:/Users/v-lipyo/.autorest/@autorest_core@3.0.6280/node_modules/@autorest/core/resources/pipeline.md'
     Including configuration file 'file:///C:/Users/v-lipyo/.autorest/@autorest_core@3.0.6280/node_modules/@autorest/core/resources/loader-openapi.md'
     Including configuration file 'file:///C:/Users/v-lipyo/.autorest/@autorest_core@3.0.6280/node_modules/@autorest/core/resources/miscellaneous.md'
     Including configuration file 'file:///C:/Users/v-lipyo/.autorest/@autorest_core@3.0.6280/node_modules/@autorest/core/resources/patches.md'
     Including configuration file 'file:///C:/Users/v-lipyo/.autorest/@autorest_core@3.0.6280/node_modules/@autorest/core/resources/plugin-powershell.md'
     Including configuration file 'file:///C:/Users/v-lipyo/.autorest/@autorest_core@3.0.6280/node_modules/@autorest/core/resources/plugin-azureresourceschema.md'
     Including configuration file 'file:///C:/Users/v-lipyo/.autorest/@autorest_core@3.0.6280/node_modules/@autorest/core/resources/plugin-csharp.md'
     Including configuration file 'file:///C:/Users/v-lipyo/.autorest/@autorest_core@3.0.6280/node_modules/@autorest/core/resources/plugin-go.md'
     Including configuration file 'file:///C:/Users/v-lipyo/.autorest/@autorest_core@3.0.6280/node_modules/@autorest/core/resources/plugin-java.md'
     Including configuration file 'file:///C:/Users/v-lipyo/.autorest/@autorest_core@3.0.6280/node_modules/@autorest/core/resources/plugin-nodejs.md'
     Including configuration file 'file:///C:/Users/v-lipyo/.autorest/@autorest_core@3.0.6280/node_modules/@autorest/core/resources/plugin-php.md'
     Including configuration file 'file:///C:/Users/v-lipyo/.autorest/@autorest_core@3.0.6280/node_modules/@autorest/core/resources/plugin-python.md'
     Including configuration file 'file:///C:/Users/v-lipyo/.autorest/@autorest_core@3.0.6280/node_modules/@autorest/core/resources/plugin-ruby.md'
     Including configuration file 'file:///C:/Users/v-lipyo/.autorest/@autorest_core@3.0.6280/node_modules/@autorest/core/resources/plugin-typescript.md'
     Including configuration file 'file:///C:/Users/v-lipyo/.autorest/@autorest_core@3.0.6280/node_modules/@autorest/core/resources/plugin-validators.md'
     Including configuration file 'file:///C:/Users/v-lipyo/.autorest/@autorest_core@3.0.6280/node_modules/@autorest/core/resources/plugin-az.md'
     Including configuration file 'file:///C:/Users/v-lipyo/.autorest/@autorest_core@3.0.6280/node_modules/@autorest/core/resources/plugin-trenton.md'
     Including configuration file 'file:///C:/Users/v-lipyo/.autorest/@autorest_core@3.0.6280/node_modules/@autorest/core/resources/graphs.md'
     Including configuration file 'file:///C:/Users/v-lipyo/.autorest/@autorest_core@3.0.6280/node_modules/@autorest/core/resources/help-configuration.md'
     Loading AutoRest extension '@autorest/csharp-v3' (https://github.com/Azure/autorest.csharp/releases/download/3.0.0-dev.20200415.7/autorest-csharp-v3-3.0.0-dev.20200415.7.tgz->3.0.0-dev.20200415.7)
     Including extension configuration file 'file:///C:/Users/v-lipyo/.autorest/@autorest_csharp-v3@3.0.0-dev.20200415.7/node_modules/@autorest/csharp-v3/readme.md'
     Loading AutoRest extension '@autorest/modelerfour' (4.13.312->4.13.312)
     Including extension configuration file 'file:///C:/Users/v-lipyo/.autorest/@autorest_modelerfour@4.13.312/node_modules/@autorest/modelerfour/readme.md'
  VERBOSE [2.44 s]: Reading OpenAPI 2.0 file file:///C:/AME/azure-rest-api-specs/specification/mixedreality/resource-manager/Microsoft.MixedReality/preview/2019-12-02-preview/proxy.json
  VERBOSE [2.45 s]: Reading OpenAPI 2.0 file file:///C:/AME/azure-rest-api-specs/specification/mixedreality/resource-manager/Microsoft.MixedReality/preview/2019-12-02-preview/remote-rendering.json
  VERBOSE [2.47 s]: Reading OpenAPI 2.0 file file:///C:/AME/azure-rest-api-specs/specification/mixedreality/resource-manager/Microsoft.MixedReality/preview/2019-12-02-preview/spatial-anchors.json
  VERBOSE [2.51 s]: Reading $ref'd file file:///C:/AME/azure-rest-api-specs/specification/mixedreality/resource-manager/Microsoft.MixedReality/preview/2019-12-02-preview/common.json
  VERBOSE [2.52 s]: Reading $ref'd file file:///C:/AME/azure-rest-api-specs/specification/common-types/resource-management/v1/types.json
EXEC : error : $ref to original location 'file:///C:/AME/azure-rest-api-specs/specification/mixedreality/resource-manager/Microsoft.MixedReality/preview/2019-12-02-preview/common.json#/components/parameters/accountKeyRegenerateParameter' is not found in the new refs collection [D:\sdk\azure-sdk-for-net\sdk\mixedreality\Azure.Management.MixedReality\src\Azure.Management.MixedReality.csproj]
D:\sdk\azure-sdk-for-net\eng\CodeGeneration.targets(24,5): error MSB3073: The command "npx autorest@https://github.com/Azure/autorest/releases/download/autorest-3.0.6221/autorest-3.0.6221.tgz --version=3.0.6280 C:\AME\azure-rest-api-specs\specification\mixedreality\resource-manager\readme.md  --use=https://github.com/Azure/autorest.csharp/releases/download/3.0.0-dev.20200415.7/autorest-csharp-v3-3.0.0-dev.20200415.7.tgz --output-folder=D:\sdk\azure-sdk-for-net\sdk\mixedreality\Azure.Management.MixedReality\src --title=Azure.Management.MixedReality --namespace=Azure.Management.MixedReality --shared-source-folder=D:\sdk\azure-sdk-for-net\eng\../sdk/core/Azure.Core/src/Shared/ --verbose" exited with code 1. [D:\sdk\azure-sdk-for-net\sdk\mixedreality\Azure.Management.MixedReality\src\Azure.Management.MixedReality.csproj]
daviwil commented 4 years ago

Also present in Cognitive Services Common:

Error: $ref to original location 'https://github.com/Azure/azure-rest-api-specs/blob/d9cf7c7ed3d674ebd482836e82b274014245ae67/specification/cognitiveservices/data-plane/Common/Parameters.json#/components/parameters/ImageUrl' is not found in the new refs collection
daviwil commented 4 years ago

Also reported by @jianghaolu in issue Azure/autorest.modelerfour#308 when generating Cognitive Services Face:

autorest --use=@autorest/java@4.0.0 https://github.com/Azure/azure-rest-api-specs/blob/master/specification/cognitiveservices/data-plane/Face/readme.md --java.output-folder=/Users/jianghlu/Documents/code/azure-sdk-for-java/sdk/faceapi/azure-ai-faceapi --java.namespace=com.azure.ai.faceapi

AutoRest code generation utility [cli version: 3.0.6187; node: v10.16.1, max-memory: 8192 gb]
(C) 2018 Microsoft Corporation.
https://aka.ms/autorest
   Loading AutoRest core      '/Users/jianghlu/.autorest/@autorest_core@3.0.6282/node_modules/@autorest/core/dist' (3.0.6282)
   Loading local AutoRest extension '@autorest/java' (/Users/jianghlu/Documents/code/autorest.java.v3)
   Loading local AutoRest extension '@autorest/java.vanilla' (/Users/jianghlu/Documents/code/autorest.java.v3/javagen)
   Loading local AutoRest extension '@autorest/java.preprocessor' (/Users/jianghlu/Documents/code/autorest.java.v3/javagen/../preprocessor)
   Loading AutoRest extension '@autorest/modelerfour' (4.13.309->4.13.309)
  Error: $ref to original location 'file:///Users/jianghlu/Documents/code/azure-rest-api-specs/specification/cognitiveservices/data-plane/Common/Parameters.json#/components/parameters/ImageUrl' is not found in the new refs collection

https://github.com/Azure/azure-rest-api-specs/blob/master/specification/cognitiveservices/data-plane/Face/stable/v1.0/Face.json#L986

daviwil commented 3 years ago

We'll have to ship a new version of AutoRest Core before this fix will be available, I'll try to get this done today.

daviwil commented 3 years ago

Fix is out in @autorest/core 3.0.6339, you can get it by using autorest --reset