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.

unresolved reference when using relative $ref

See original GitHub issue

What did you do

I tried generated markdown from a schema that makes use of relative definitions that are all in one file.

jsonschema2md -d ./schema.json

Splitting these references out into separate files with absolute URL’s does work, but it makes the schema far less portable.

What did you expect to happen

Successfully generate markdown without any errors.

What happened

07
info: output directory: /Users/wayneberry/src/github.com/overhq/open-file-format-specification/out
schema /Users/wayneberry/src/github.com/overhq/open-file-format-specification/schema.json has no $id
info: finished reading /Users/wayneberry/src/github.com/overhq/open-file-format-specification/schema.json, beginning processing....
/Users/wayneberry/src/github.com/overhq/open-file-format-specification/schema.json
unresolved reference: #/definitions/Identifier
unresolved reference: #/definitions/Identifier
Output processed.
info: Processing complete.

What’s your environment

  • Operating System: macOS 10.14.1
  • node.js version: v11.2.0

Do you have example files:

For this schema

{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$ref": "#/definitions/Project",
    "definitions": {
        "Project": {
            "type": "object",
            "additionalProperties": true,
            "properties": {
                "identifier": {
                    "$ref": "#/definitions/Identifier"
                }
            },
            "required": [
                "identifier",
                "layers",
                "size"
            ],
            "title": "Project"
        },
        "Identifier": {
            "type": "string",
            "minLength": 36,
            "maxLength": 36,
            "examples": [
                "1467103b-45d3-49fa-addc-374370f93e9c"
            ],
            "description": "A universally unique identifier as specified by https://www.ietf.org/rfc/rfc4122.txt"
        }
    }
}

I’m getting following Markdown

#  Schema



| Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Defined In |
|----------|------------|--------|--------------|-------------------|-----------------------|------------|
| Cannot be instantiated | Yes | Experimental | No | Forbidden | Permitted |  |

#  Definitions

| Property | Type | Group |
|----------|------|-------|
| [identifier](#identifier) | reference | `#/definitions/Project` |

## identifier


`identifier`

* is optional
* type: reference
* defined in this schema

### identifier Type


* []() – `#/definitions/Identifier`

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
rbucklandcommented, Mar 17, 2019

@dskvr have you started working on this issue ? I would like to help out (to resolve it 😃. Let me know. Thanks

2reactions
wayneashleyberrycommented, Nov 19, 2018

@trieloff good find, that is a decent workaround for the “unresolved reference” issue.

Perhaps a separate issue, but I’m finding the output for a schema with many definitions far inferior to multiple schema’s with absolute references. Seeing a list of all properties with a “group” soon becomes unreadable when you have a few definitions in a single schema. The links to requirements also don’t work. Would it be worth creating separate issues for these?

Alternatively, is it possible to use multiple absolute references in a single file?

Here’s a quick screenshot of some rather unwieldy output:

screenshot 2018-11-19 at 16 04 37
Read more comments on GitHub >

github_iconTop Results From Across the Web

Unresolved reference issue in PyCharm - Stack Overflow
The project I cloned had a directory called modules and was successfully using files from there in the code with import this as...
Read more >
Resolve references | PyCharm Documentation - JetBrains
PyCharm's on-the-fly inspection immediately detects unresolved references, and highlights them with the red curvy line.
Read more >
External reference (xref) file is missing or unresolved in ...
Opening a drawing shows a message about missing xrefs. "One or more referenced files could not be located or read. What do you...
Read more >
The #REF Excel Error - How to Find and Fix #REF Errors in ...
Learn how to recognize and resolve #REF! errors in Excel with this guide. About the #REF Error in Excel. The #REF error in...
Read more >
[Solved]-Unresolved reference:DetailActivity-kotlin
score:0. Accepted answer. There was a spelling mistake with the DetailActivity, all working now · score:0. Change this private fun viewMonsterImage(imageButton: ...
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