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.

Unknown type for array with anyOf items

See original GitHub issue

What did you do

jsonschema -d .

What did you expect to happen

An array type with multiple item types should be documented correctly, with links to each allowed type.

What happened

Unknown type.

What’s your environment

  • Operating System: macOS 10.14.1
  • node.js version: 11.2.0

Do you have example files:

For this schema:

{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
        "items": {
            "type": "array",
            "items": {
                "anyOf": [
                    {
                        "$ref": "#/definitions/Thing"
                    },
                    {
                        "$ref": "#/definitions/OtherThing"
                    }
                ]
            }
        }
    },
    "definitions": {
        "Thing": {
            "properties": {}
        },
        "OtherThing": {
            "properties": {}
        }
    }
}

I’m getting following Markdown:

Array type: array All items must be of the type: Unknown type ``.


Test files and output can be found here: https://github.com/wayneashleyberry/jsonschema2md-issues/tree/master/array-of

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8

github_iconTop GitHub Comments

2reactions
trieloffcommented, Dec 16, 2019

🎉 This issue has been resolved in version 4.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

1reaction
wayneashleyberrycommented, Dec 17, 2019

Yeah, I see it now - thanks @trieloff

Read more comments on GitHub >

github_iconTop Results From Across the Web

JSON Schema with unknown property names
Save this question. Show activity on this post. I want to have a JSON Schema with unknown property names in an array of...
Read more >
The unknown Type in TypeScript
TypeScript 3.0 introduced a new unknown type which is the ... It represents all possible JavaScript values — primitives, objects, arrays, ...
Read more >
Typescript: why you should use unknown instead of any
The unknown type, when assigned to a variable, means that a variable type is not known. And typescript doesn't allow you to use...
Read more >
TypeScript 3.0: Exploring Tuples and the Unknown Type
Tuples in rest parameters and spread expressions with optional elements. New unknown top type! It's the type-safe counterpart of any .
Read more >
15.1.0 API Reference - Joi
skipFunctions - when true , ignores unknown keys with a function value. Defaults to false . stripUnknown - remove unknown elements from objects...
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