question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

$ref to original location not found

See original GitHub issue

Describe the bug When running the following command to generate Microsoft.Authorizaiton schemas, autorest pipeline failed at openapi-document/emitter (with --debug) :

autorest --azureresourceschema --tag=schema-authorization-2020-09-01 https://github.com/Azure/azure-rest-api-specs/blob/dfedab416d1c4fe521f6f3c58cdcb0da37107b84/specification/resources/resource-manager/readme.md
AutoRest code generation utility [cli version: 3.0.6339; node: v14.15.5, max-memory: 2048 MB]
(C) 2018 Microsoft Corporation.
https://aka.ms/autorest
   Loading AutoRest core      '/home/leni/.autorest/@autorest_core@3.0.6373/node_modules/@autorest/core/dist' (3.0.6373)
   Loading AutoRest extension '@autorest/azureresourceschema' (~3.0.45->3.0.92)
  Error: $ref to original location '#/components/schemas/schemas:516' is not found in the new refs collection

Please provide as much information as you can. This would be:

  • OpenAPI files having the issues:

https://github.com/Azure/azure-rest-api-specs/blob/dfedab416d1c4fe521f6f3c58cdcb0da37107b84/specification/resources/resource-manager/Microsoft.Authorization/stable/2020-09-01/dataPolicyManifests.json

  • Autorest command used:

autorest --azureresourceschema --tag=schema-authorization-2020-09-01 https://github.com/Azure/azure-rest-api-specs/blob/dfedab416d1c4fe521f6f3c58cdcb0da37107b84/specification/resources/resource-manager/readme.md

Expected behavior The Microsoft.Authorization ARM Template schemas can be successfully generated.

Additional context Tried to debug into autorest code, the obj value is as follows, when throwing the Error: image

{
  "x-ms-metadata": {
    "apiVersions": [
      "2020-06-01"
    ],
    "filename": [
      "mem:///394?oai3.shaken.json"
    ],
    "name": "paths·1fnlsr8·providers-microsoft-resources-deployments-deploymentname-whatif·post·responses·202·headers·location",
    "originalLocations": [
      "file:///home/leni/workspace/azure-rest-api-specs/specification/resources/resource-manager/Microsoft.Resources/stable/2020-06-01/resources.json#/components/headers/paths·1fnlsr8·providers-microsoft-resources-deployments-deploymentname-whatif·post·responses·202·headers·location"
    ],
    "x-ms-secondary-file": true
  },
  "schema": {
    "$ref": "#/components/schemas/schemas:516"
  },
  "description": "URL to get status of this long-running operation."
}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
timotheeguerincommented, Feb 17, 2021

Hi @tonianelope could you open another issue with a swagger spec reproducing the erorr as this doesn’t seem to be the exact same problem

0reactions
tonianelopecommented, Feb 17, 2021

Hi am having a similar issue where I have the following definition see below: (RenamedExampleProperty is refrencing the definition of Example as it is the same property only with a different name). But the PR doesn’t fix the issue for me.

    "Language": {
      "description": "xxx",
      "allOf": [
        {
          "$ref": "#/definitions/CommonLanguageProperty"
        },
        {
          "type": "object",
          "properties": {
            "RemanedExampleProperty": {
              "$ref": "#/definitions/CommonExampleProperty/properties/Example"
            },
          },
        }
      ]
    },```
Read more comments on GitHub >

github_iconTop Results From Across the Web

To Fix Not Found Reference Files | AutoCAD LT 2020
Right-click the selected reference and select Select New Path from the context menu. Note: It is recommended that for a single selected broken...
Read more >
Show Reference File in Finder Not Working in Photos App
When I click on them it says Find Original. I go to the folder and select Choose Folder. But, nothing changes. If i...
Read more >
c# - Could not resolve this reference. Could not locate the ...
If you want to know the location it was referenced from, you'd have to open the .csproj file in a text editor and...
Read more >
7 Situations Where There Is the "Location Is Not Available" ...
Step 1. Launch MiniTool Power Data Recovery. Select the drive which prompts "location is not available" error, and click Scan. Step 2: Preview ......
Read more >
Troubleshoot bookmarks
By default, Word doesn't display them. ... Reference source not found. ... to another location in the same document the bookmark remains with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found