adobe / adobe/jsonschema2md

ERR_INVALID_ARG_TYPE: The "path" argument must be of type string. Received undefined

Open
#392 18 comments 31 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
724
Forks
150
Avg merge
18h 22m
Merged PRs (30d)
4

Description

### Expected Behaviour
Converts JSON schema to MD.

### Actual Behaviour
The following error is thrown:
```
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
at new NodeError (node:internal/errors:371:5)
at validateString (node:internal/validators:119:11)
at Object.parse (node:path:913:5)
at Object.get (node_modules\@adobe\jsonschema2md\lib\schemaProxy.js:123:27)
at Function.values ()
at reducer (node_modules\@adobe\jsonschema2md\lib\traverseSchema.js:42:23)
at Array.reduce ()
at reducer (\node_modules\@adobe\jsonschema2md\lib\traverseSchema.js:36:41)
at Array.reduce ()
at reducer (node_modules\@adobe\jsonschema2md\lib\traverseSchema.js:42:39) {
code: 'ERR_INVALID_ARG_TYPE'
```

### Reproduce Scenario (including but not limited to)

#### Steps to Reproduce
Running with `jsonschema2md -d input -o output`
JSON Schema:
```
{
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"ItemLink": {
"properties": {
"allowedSuccessors": {
"items": {
"type": "string"
},
"type": "array"
},
"class": {
"type": "string"
}
},
"type": "object"
},
"ItemLinkOptions": {
"properties": {
"allowedLinks": {
"items": {
"$ref": "#/definitions/ItemLink"
},
"type": "array"
},
"maxIncoming": {
"type": "number"
},
"maxOutgoing": {
"type": "number"
}
},
"type": "object"
}
},
"properties": {
"id": {
"type": "string"
},
"items": {
"items": {
"anyOf": [
{
"$ref": "#/definitions/ItemLink"
}
]
},
"type": "array"
},

"version": {
"type": "string"
}
},
"type": "object"
}
```

#### Platform and Version
Windows 10

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure with `jsonschema2md -d input -o output` and the schema shown in the issue. Start at `lib/schemaProxy.js` around line 123, then follow the related traversal in `lib/traverseSchema.js`; done means the schema converts to Markdown without the undefined-path error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
documentation
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.