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.

Type Arrays not Supported

See original GitHub issue

What did you do

Ran jsonschema2md against a schema file that has an array as a value for type. e.g.

What did you expect to happen

The docs to recognize that the type for the object could be either a string or an object.

What happened

The parser returned a message: “Unknown type object,string

What’s your environment

  • Operating System: macOS Catalina
  • node.js version: 10.16.0

Do you have example files:

For this schema

"baseLayers": {
  "type": "array",
  "items": {
    "type": [
      "object",
      "string"
    ],
    "properties": {
      "id": {
        "description": "The name of the layer",
        "type": "string"
      },
      "Factory": {
        "description": "The name of the esrijs module associated with the layer type",
        "type": "string"
      },
      "urlTemplate": {
        "description": "The urlTemplate for the layer. \"{quadWord}\" will be automatically replaced with the appropriate value at runtime.",
        "type": "string"
      }
    },
    "required": [
      "id",
      "Factory",
      "urlTemplate"
    ]
  }
},

I’m getting following Markdown

##### baseLayers Type

Array type: multiple

All items must be of the type: Unknown type `object,string`.

```json
{
  "type": "array",
  "items": {
    "type": ["object", "string"],
    "properties": {
      "id": {
        "description": "The name of the layer",
        "type": "string"
      },
      "Factory": {
        "description": "The name of the esrijs module associated with the layer type",
        "type": "string"
      },
      "urlTemplate": {
        "description": "The urlTemplate for the layer. \"{quadWord}\" will be automatically replaced with the appropriate value at runtime.",
        "type": "string"
      }
    },
    "required": ["id", "Factory", "urlTemplate"],
    "simpletype": "multiple"
  },
  "simpletype": "multiple"
}

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
trieloffcommented, Dec 16, 2019

🎉 This issue has been resolved in version 4.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

1reaction
stdaviscommented, Oct 21, 2019

I appreciate the workaround suggestion. I was able to refactor to something similar to your example and it’s working better now.

Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

numpy array type not supported? - Stack Overflow
numpy array type not supported? · 1. you can cast by doing array.astype(np.int16). – M Z · Do I just save after running...
Read more >
JavaScript typed arrays - MDN Web Docs
JavaScript typed arrays are array-like objects that provide a mechanism for reading and writing raw binary data in memory buffers.
Read more >
Documentation: 15: 8.15. Arrays - PostgreSQL
Arrays of a particular element type are all considered to be of the same type, regardless of size or number of dimensions. So,...
Read more >
Restrictions on the array data type - IBM
The following restrictions apply to the array data type: Use of the array data type in dynamic compound statements is not supported.
Read more >
Mutating arrays not supported - Julia Discourse
Like it says, “Mutating arrays not supported” meaning both x_out[1] = 1 and map! aren't allowed in code you ask it to differentiate....
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