{"action":"created","issue":{"url":"https://api.github.com/repos/Rebilly/ReDoc/issues/395","repository_url":"https://api.github.com/repos/Rebilly/ReDoc","labels_url":"https://api.github.com/repos/Rebilly/ReDoc/issues/395/labels{/name}","comments_url":"https://api.github.com/repos/Rebilly/ReDoc/issues/395/comments","events_url":"https://api.github.com/repos/Rebilly/ReDoc/issues/395/events","html_url":"https://github.com/Rebilly/ReDoc/issues/395","id":282698568,"number":395,"title":"Incorrectly parsed reference fails to resolve","user":{"login":"bartfeenstra","id":376735,"avatar_url":"https://avatars2.githubusercontent.com/u/376735?v=4","gravatar_id":"","url":"https://api.github.com/users/bartfeenstra","html_url":"https://github.com/bartfeenstra","followers_url":"https://api.github.com/users/bartfeenstra/followers","following_url":"https://api.github.com/users/bartfeenstra/following{/other_user}","gists_url":"https://api.github.com/users/bartfeenstra/gists{/gist_id}","starred_url":"https://api.github.com/users/bartfeenstra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bartfeenstra/subscriptions","organizations_url":"https://api.github.com/users/bartfeenstra/orgs","repos_url":"https://api.github.com/users/bartfeenstra/repos","events_url":"https://api.github.com/users/bartfeenstra/events{/privacy}","received_events_url":"https://api.github.com/users/bartfeenstra/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-12-17T14:46:24Z","updated_at":"2018-02-02T19:30:04Z","closed_at":null,"author_association":"NONE","body":"I'm using the latest stable CDN-hosted ReDoc version on the Swagger 2.0 and JSON Schema documents at the end of this post. When loading this in ReDoc, it fails with the following error: `ERROR Error: Uncaught (in promise): SyntaxError: Error resolving $ref pointer \"http://127.0.0.1:5000/about/json/schema#/definitions/schema\". Token \"schema\" does not exist.`. As you can see in the documents below, this subschema does indeed not exist, but I don't know why ReDoc tries to load it. I'm hoping someone here might. The same JSON schema is also parsed and resolved by a Python library, which works well, so at this point like the error is caused by something on ReDoc's side.\r\n\r\nPlease let me know if I can provide more information. Once https://github.com/Rebilly/ReDoc/issues/388 has been addressed, I can hopefully help debug this error myself locally :)\r\n\r\nSwagger spec:\r\n```json\r\n{\r\n   \"swagger\":\"2.0\",\r\n   \"info\":{\r\n      \"title\":\"Alfred\",\r\n      \"version\":\"0.0.0\",\r\n      \"description\":\"This document describes Alfred's HTTP API in the [OpenApi 2.0](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md) format.\"\r\n   },\r\n   \"definitions\":{\r\n\r\n   },\r\n   \"parameters\":{\r\n\r\n   },\r\n   \"paths\":{\r\n      \"/about/json/schema\":{\r\n         \"get\":{\r\n            \"operationId\":\"schema\",\r\n            \"consumes\":[\r\n\r\n            ],\r\n            \"produces\":[\r\n               \"application/schema+json\"\r\n            ],\r\n            \"responses\":{\r\n               \"200\":{\r\n                  \"description\":\"A successful response.\",\r\n                  \"schema\":{\r\n                     \"$ref\":\"http://127.0.0.1:5000/about/json/schema#/definitions/response/schema\"\r\n                  }\r\n               },\r\n               \"406\":{\r\n                  \"$ref\":\"#/responses/406\"\r\n               },\r\n               \"415\":{\r\n                  \"$ref\":\"#/responses/415\"\r\n               }\r\n            }\r\n         }\r\n      },\r\n      \"/about/json/external-schema/{id}\":{\r\n         \"get\":{\r\n            \"operationId\":\"external-schema\",\r\n            \"consumes\":[\r\n\r\n            ],\r\n            \"produces\":[\r\n               \"application/schema+json\"\r\n            ],\r\n            \"responses\":{\r\n               \"200\":{\r\n                  \"description\":\"A successful response.\",\r\n                  \"schema\":{\r\n                     \"$ref\":\"http://127.0.0.1:5000/about/json/schema#/definitions/response/schema\"\r\n                  }\r\n               },\r\n               \"406\":{\r\n                  \"$ref\":\"#/responses/406\"\r\n               },\r\n               \"415\":{\r\n                  \"$ref\":\"#/responses/415\"\r\n               }\r\n            }\r\n         }\r\n      },\r\n      \"/about/openapi\":{\r\n         \"get\":{\r\n            \"operationId\":\"openapi\",\r\n            \"consumes\":[\r\n\r\n            ],\r\n            \"produces\":[\r\n               \"application/json\",\r\n               \"text/html\"\r\n            ],\r\n            \"responses\":{\r\n               \"200\":{\r\n                  \"description\":\"A successful response.\",\r\n                  \"schema\":{\r\n                     \"$ref\":\"http://127.0.0.1:5000/about/json/schema#/definitions/response/openapi\"\r\n                  }\r\n               },\r\n               \"406\":{\r\n                  \"$ref\":\"#/responses/406\"\r\n               },\r\n               \"415\":{\r\n                  \"$ref\":\"#/responses/415\"\r\n               }\r\n            }\r\n         }\r\n      }\r\n   },\r\n   \"tags\":[\r\n\r\n   ],\r\n   \"responses\":{\r\n      \"406\":{\r\n         \"description\":\"Returned if the request `Accept` header does not contain any content type produced by this endpoint.\"\r\n      },\r\n      \"415\":{\r\n         \"description\":\"Returned if the request `Content-Type` header does not contain any content type consumed by this endpoint.\"\r\n      }\r\n   },\r\n   \"host\":\"127.0.0.1:5000\",\r\n   \"schemes\":[\r\n      \"http\"\r\n   ]\r\n}\r\n```\r\n\r\nJSON Schema:\r\n```json\r\n{\r\n   \"id\":\"http://127.0.0.1:5000/about/json/schema\",\r\n   \"$schema\":\"http://json-schema.org/draft-04/schema#\",\r\n   \"enum\":[\r\n      null\r\n   ],\r\n   \"definitions\":{\r\n      \"request\":{\r\n\r\n      },\r\n      \"response\":{\r\n         \"schema\":{\r\n            \"anyOf\":[\r\n               {\r\n                  \"$ref\":\"http://127.0.0.1:5000/about/json/schema#/definitions/response/error\"\r\n               },\r\n               {\r\n                  \"$ref\":\"http://127.0.0.1:5000/about/json/external-schema/aHR0cDovL2pzb24tc2NoZW1hLm9yZy9kcmFmdC0wNC9zY2hlbWE%3D\",\r\n                  \"description\":\"A JSON Schema.\"\r\n               }\r\n            ]\r\n         },\r\n         \"openapi\":{\r\n            \"$ref\":\"http://127.0.0.1:5000/about/json/external-schema/aHR0cDovL3N3YWdnZXIuaW8vdjIvc2NoZW1hLmpzb24%3D\",\r\n            \"description\":\"An OpenAPI/Swagger 2.0 schema.\"\r\n         },\r\n         \"error\":{\r\n            \"title\":\"Error response\",\r\n            \"type\":\"object\",\r\n            \"properties\":{\r\n               \"errors\":{\r\n                  \"type\":\"array\",\r\n                  \"items\":{\r\n                     \"$ref\":\"http://127.0.0.1:5000/about/json/schema#/definitions/data/error\"\r\n                  }\r\n               }\r\n            },\r\n            \"required\":[\r\n               \"errors\"\r\n            ]\r\n         }\r\n      },\r\n      \"data\":{\r\n         \"error\":{\r\n            \"title\":\"An API error\",\r\n            \"type\":\"object\",\r\n            \"properties\":{\r\n               \"code\":{\r\n                  \"title\":\"The machine-readable error code.\",\r\n                  \"type\":\"string\"\r\n               },\r\n               \"title\":{\r\n                  \"title\":\"The human-readable error title.\",\r\n                  \"type\":\"string\"\r\n               }\r\n            },\r\n            \"required\":[\r\n               \"code\",\r\n               \"title\"\r\n            ]\r\n         }\r\n      }\r\n   }\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/Rebilly/ReDoc/issues/comments/362682858","html_url":"https://github.com/Rebilly/ReDoc/issues/395#issuecomment-362682858","issue_url":"https://api.github.com/repos/Rebilly/ReDoc/issues/395","id":362682858,"user":{"login":"bartfeenstra","id":376735,"avatar_url":"https://avatars2.githubusercontent.com/u/376735?v=4","gravatar_id":"","url":"https://api.github.com/users/bartfeenstra","html_url":"https://github.com/bartfeenstra","followers_url":"https://api.github.com/users/bartfeenstra/followers","following_url":"https://api.github.com/users/bartfeenstra/following{/other_user}","gists_url":"https://api.github.com/users/bartfeenstra/gists{/gist_id}","starred_url":"https://api.github.com/users/bartfeenstra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bartfeenstra/subscriptions","organizations_url":"https://api.github.com/users/bartfeenstra/orgs","repos_url":"https://api.github.com/users/bartfeenstra/repos","events_url":"https://api.github.com/users/bartfeenstra/events{/privacy}","received_events_url":"https://api.github.com/users/bartfeenstra/received_events","type":"User","site_admin":false},"created_at":"2018-02-02T19:30:04Z","updated_at":"2018-02-02T19:30:04Z","author_association":"NONE","body":"I managed to run ReDoc locally using its dev server, allowing me to debug the code through my browser (I learned a thing!). As it turns out, `SchemaWalker` ends up in an infinite loop when parsing the official JSON core schema (as proxied through my app).\r\nStack trace:\r\n```\r\nError: Script terminated by timeout at:\r\nparse@http://localhost:9000/redoc.js:48472:12\r\nJsonPointer.parse@http://localhost:9000/redoc.js:17765:16\r\nJsonPointer.join@http://localhost:9000/redoc.js:17776:26\r\nSchemaWalker.walkEach@http://localhost:9000/redoc.js:31835:23\r\nSchemaWalker.walk@http://localhost:9000/redoc.js:31802:13\r\nSchemaWalker.walk@http://localhost:9000/redoc.js:31810:27\r\nSchemaWalker.walkEach@http://localhost:9000/redoc.js:31836:23\r\nSchemaWalker.walk@http://localhost:9000/redoc.js:31802:13\r\nSchemaWalker.walk@http://localhost:9000/redoc.js:31810:27\r\nSchemaWalker.walkEach@http://localhost:9000/redoc.js:31836:23\r\nSchemaWalker.walk@http://localhost:9000/redoc.js:31802:13\r\nSchemaWalker.walk@http://localhost:9000/redoc.js:31810:27\r\nSchemaWalker.walkEach@http://localhost:9000/redoc.js:31836:23\r\nSchemaWalker.walk@http://localhost:9000/redoc.js:31802:13\r\nSchemaWalker.walk@http://localhost:9000/redoc.js:31810:27\r\nSchemaWalker.walkEach@http://localhost:9000/redoc.js:31836:23\r\nSchemaWalker.walk@http://localhost:9000/redoc.js:31802:13\r\nSchemaWalker.walk@http://localhost:9000/redoc.js:31810:27\r\nSchemaWalker.walkEach@http://localhost:9000/redoc.js:31836:23\r\nSchemaWalker.walk@http://localhost:9000/redoc.js:31802:13\r\nSchemaWalker.walk@http://localhost:9000/redoc.js:31810:27\r\nSchemaWalker.walkEach@http://localhost:9000/redoc.js:31836:23\r\nSchemaWalker.walk@http://localhost:9000/redoc.js:31802:13\r\nSchemaWalker.walk@http://localhost:9000/redoc.js:31810:27\r\nSchemaWalker.walkEach@http://localhost:9000/redoc.js:31836:23\r\nSchemaWalker.walk@http://localhost:9000/redoc.js:31802:13\r\nSchemaWalker.walk@http://localhost:9000/redoc.js:31810:27\r\nSchemaWalker.walkEach@http://localhost:9000/redoc.js:31836:23\r\nSchemaWalker.walk@http://localhost:9000/redoc.js:31802:13\r\nSchemaWalker.walk@http://localhost:9000/redoc.js:31810:27\r\nSchemaWalker.walkEach@http://localhost:9000/redoc.js:31836:23\r\nSchemaWalker.walk@http://localhost:9000/redoc.js:31802:13\r\nSchemaWalker.walk@http://localhost:9000/redoc.js:31810:27\r\n```\r\n\r\nI logged the pointers as the schema walker traversed over the data:\r\n```\r\n/paths/~1about~1json~1schema/get/responses/200/schema/properties\r\nschema-normalizer.service.ts:58:6\r\n/paths/~1about~1json~1schema/get/responses/200/schema/properties/definitions/additionalProperties\r\nschema-normalizer.service.ts:64:6\r\n/paths/~1about~1json~1schema/get/responses/200/schema/properties\r\nschema-normalizer.service.ts:58:6\r\n/paths/~1about~1json~1schema/get/responses/200/schema/properties/definitions/additionalProperties\r\nschema-normalizer.service.ts:64:6\r\n/paths/~1about~1json~1schema/get/responses/200/schema/properties/properties/additionalProperties\r\nschema-normalizer.service.ts:64:6\r\n/paths/~1about~1json~1schema/get/responses/200/schema/properties/patternProperties/additionalProperties\r\nschema-normalizer.service.ts:64:6\r\n/paths/~1about~1json~1schema/get/responses/200/schema/properties/dependencies/additionalProperties\r\nschema-normalizer.service.ts:64:6\r\n/paths/~1about~1json~1schema/get/responses/200/schema/properties/properties/additionalProperties\r\nschema-normalizer.service.ts:64:6\r\n/paths/~1about~1json~1schema/get/responses/200/schema/properties/patternProperties/additionalProperties\r\nschema-normalizer.service.ts:64:6\r\n/paths/~1about~1json~1schema/get/responses/200/schema/properties/dependencies/additionalProperties\r\nschema-normalizer.service.ts:64:6\r\n/paths/~1about~1json~1schema/get/responses/200/schema/properties/definitions/additionalProperties\r\nschema-normalizer.service.ts:64:6\r\n/paths/~1about~1json~1schema/get/responses/200/schema/properties/definitions/additionalProperties/properties\r\nschema-normalizer.service.ts:58:6\r\n/paths/~1about~1json~1schema/get/responses/200/schema/properties/definitions/additionalProperties/properties/definitions/additionalProperties\r\nschema-normalizer.service.ts:64:6\r\n/paths/~1about~1json~1schema/get/responses/200/schema/properties/definitions/additionalProperties/properties/definitions/additionalProperties/properties\r\nschema-normalizer.service.ts:58:6\r\n/paths/~1about~1json~1schema/get/responses/200/schema/properties/definitions/additionalProperties/properties/definitions/additionalProperties/properties/definitions/additionalProperties\r\nschema-normalizer.service.ts:64:6\r\n/paths/~1about~1json~1schema/get/responses/200/schema/properties/definitions/additionalProperties/properties/definitions/additionalProperties/properties/definitions/additionalProperties/properties\r\nschema-normalizer.service.ts:58:6\r\n/paths/~1about~1json~1schema/get/responses/200/schema/properties/definitions/additionalProperties/properties/definitions/additionalProperties/properties/definitions/additionalProperties/properties/definitions/additionalProperties\r\nschema-normalizer.service.ts:64:6\r\n/paths/~1about~1json~1schema/get/responses/200/schema/properties/definitions/additionalProperties/properties/definitions/additionalProperties/properties/definitions/additionalProperties/properties/definitions/additionalProperties/properties\r\nschema-normalizer.service.ts:58:6\r\n/paths/~1about~1json~1schema/get/responses/200/schema/properties/definitions/additionalProperties/properties/definitions/additionalProperties/properties/definitions/additionalProperties/properties/definitions/additionalProperties/properties/definitions/additionalProperties\r\n```\r\nwhere `/paths/~1about~1json~1schema/get/responses/200/schema` is a reference to the core JSON Schema schema as proxied through my app.\r\n\r\nTo reproduce this, you can run my app locally using the instructions in https://github.com/Rebilly/ReDoc/issues/395#issuecomment-359352735. The Swagger spec will be available at http://127.0.0.1:5000/about/openapi."}}
{"actor":{"display_login":"bartfeenstra"}}