CesiumGS / CesiumGS/wetzel

Items missing from Schema with array type

Open
#64 5 comments 2 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
137
Forks
52
PR merge metrics
No merged PRs in 30d

Description

I have a JSON schema named `things.schema.json` that looks like this:

``` json
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "things.schema.json",
"title": "Things",
"description": "A list of things.",
"type": "array",
"uniqueItems": true,
"minItems": 1,
"items": { "$ref": "thing.schema.json" }
}
```

It references `thing.schema.json`, which looks like this:

``` json
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "thing.schema.json",
"title": "Thing",
"description": "A thing.",
"type": "object",
"properties": {
"name": { "type": "string" },
"age": { "type": "number" }
},
"required": ["name", "age"]
}
```

Then I run wetzel like so:

```
wetzel.js --autoLink=cqo things.schema.json > things.md
```

The resulting file looks like this:

``` md
# Objects
* [`Thing`](#reference-thing)
* [`Things`](#reference-things) (root object)

---------------------------------------

## Thing

A thing.

**`Thing` Properties**

| |Type|Description|Required|
|---|---|---|---|
|**name**|`string`|| ✓ Yes|
|**age**|`number`|| ✓ Yes|

Additional properties are allowed.

### thing.name

* **Type**: `string`
* **Required**: ✓ Yes

### thing.age

* **Type**: `number`
* **Required**: ✓ Yes

---------------------------------------

## Things

A list of things.

```

Note that the Things reference at the bottom is missing any information about the items. The same is true even if I set `"items": { "type": "string" }`; the resulting Markdown is simply:

``` md
# Objects
* [`Things`](#reference-things) (root object)

---------------------------------------

## Things

A list of things.

```

If I add `minItems` `uniqueItems`, or any of the rest, none of it appears, either. Shouldn't there be more details on what constitutes an an array schema?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the wetzel.js command with the two schemas shown in the issue and inspect the generated things.md output. Trace the array-schema documentation path from that CLI entry point; done means array item details and constraints such as items, minItems, and uniqueItems appear in the Things section.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.