{ "aid": "swaggerhub.andrewflbarnes:bug.broken-yaml-anchor-in-json-08.07.2020", "name": "SwaggerHub broken YAML anchor in JSON and broken multiline highlighting", "type": "Index", "description": "As of 8th June 2020\n\nWhen using a YAML anchor in the spec JSON not correctly generated.\n\nOpen the below in the swagger UI (locally or at petstore.swagger.io)\nhttps://api.swaggerhub.com/apis/andrewflbarnes/bug.broken-yaml-anchor-in-json/08.07.2020\n\nThe yaml anchor isn't correctly parsed in the JSON version and can't be\ndisplayed by swagger UI. This will just resolve to\n```\n\"objectWithYamlAnchorReference\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": \"id\"\n }\n}\n```\nIt should be\n```\n\"objectWithYamlAnchorReference\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"format\": \"uuid\",\n \"example\": \"00000000-0000-0000-0000-000000000000\"\n }\n }\n}\n```\n\nThe error shown is\n😱 Could not render n, see the console.\n\nConsole output:\n```\nat object-model.jsx:98\nat immutable.js:3084\nat immutable.js:2867\nat immutable.js:3016\nat immutable.js:2832\nat immutable.js:2699\nat ot.__iterate (immutable.js:2206)\nat wt.__iterate (immutable.js:2698)\nat At.__iterate (immutable.js:2830)\nat r.Pt.r.__iterateUncached (immutable.js:3015)\n```\n\nPresence of the emoji above also prevents the newline from being displayed in\nswaggerhub editor. This also happens with colons and other characters regardless\nof where on the line they appear. e.g.\n\nfirstline\nseco:ndline\n\nfirstline\nsecon-dline\n\nfirstline\nsecond\"line\n\nfirstline\nsecondline'\n\nNewlines seem to display correctly on the Details popout of the swaggerhub home\npage (https://app.swaggerhub.com/home)\n\nYou should also see on swaggerhub that these lines and the URL are incorrectly\nhighlighted in the editor because of the colon following https. A colon anywhere\nin a multiline block breaks the formatting making the editor think it is no longer\nin a string\n\nexample: example\n\n\"example\" example\n\n'example' example\n\n*example &example", "url": "https://raw.githubusercontent.com/jentic/jentic-public-apis/refs/heads/main/apis/openapi/swaggerhub.andrewflbarnes/bug.broken-yaml-anchor-in-json/08.07.2020/apis.json", "tags": [ "swaggerhub.andrewflbarnes", "bug.broken-yaml-anchor-in-json" ], "created": "2026-04-01", "modified": "2026-04-01", "specificationVersion": "0.19", "access": "3rd-Party", "maintainers": [ { "FN": "Jentic", "X-github": "jentic", "url": "https://github.com/jentic" } ], "apis": [ { "aid": "swaggerhub.andrewflbarnes:bug.broken-yaml-anchor-in-json-08.07.2020", "name": "SwaggerHub broken YAML anchor in JSON and broken multiline highlighting", "description": "As of 8th June 2020\n\nWhen using a YAML anchor in the spec JSON not correctly generated.\n\nOpen the below in the swagger UI (locally or at petstore.swagger.io)\nhttps://api.swaggerhub.com/apis/andrewflbarnes/bug.broken-yaml-anchor-in-json/08.07.2020\n\nThe yaml anchor isn't correctly parsed in the JSON version and can't be\ndisplayed by swagger UI. This will just resolve to\n```\n\"objectWithYamlAnchorReference\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": \"id\"\n }\n}\n```\nIt should be\n```\n\"objectWithYamlAnchorReference\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"format\": \"uuid\",\n \"example\": \"00000000-0000-0000-0000-000000000000\"\n }\n }\n}\n```\n\nThe error shown is\n😱 Could not render n, see the console.\n\nConsole output:\n```\nat object-model.jsx:98\nat immutable.js:3084\nat immutable.js:2867\nat immutable.js:3016\nat immutable.js:2832\nat immutable.js:2699\nat ot.__iterate (immutable.js:2206)\nat wt.__iterate (immutable.js:2698)\nat At.__iterate (immutable.js:2830)\nat r.Pt.r.__iterateUncached (immutable.js:3015)\n```\n\nPresence of the emoji above also prevents the newline from being displayed in\nswaggerhub editor. This also happens with colons and other characters regardless\nof where on the line they appear. e.g.\n\nfirstline\nseco:ndline\n\nfirstline\nsecon-dline\n\nfirstline\nsecond\"line\n\nfirstline\nsecondline'\n\nNewlines seem to display correctly on the Details popout of the swaggerhub home\npage (https://app.swaggerhub.com/home)\n\nYou should also see on swaggerhub that these lines and the URL are incorrectly\nhighlighted in the editor because of the colon following https. A colon anywhere\nin a multiline block breaks the formatting making the editor think it is no longer\nin a string\n\nexample: example\n\n\"example\" example\n\n'example' example\n\n*example &example", "image": "", "baseURL": "", "humanURL": "https://github.com/jentic/jentic-public-apis/tree/main/apis/openapi/swaggerhub.andrewflbarnes/bug.broken-yaml-anchor-in-json/08.07.2020", "version": "08.07.2020", "tags": [ "swaggerhub.andrewflbarnes", "bug.broken-yaml-anchor-in-json" ], "properties": [ { "type": "OpenAPI", "name": "OpenAPI definition", "url": "https://raw.githubusercontent.com/jentic/jentic-public-apis/refs/heads/main/apis/openapi/swaggerhub.andrewflbarnes/bug.broken-yaml-anchor-in-json/08.07.2020/openapi.json", "mediaType": "application/openapi+json" }, { "type": "GitHubRepo", "url": "https://github.com/jentic/jentic-public-apis/tree/main/apis/openapi/swaggerhub.andrewflbarnes/bug.broken-yaml-anchor-in-json/08.07.2020" } ] } ] }