Skip to content

Tuple / array confusion #208

Open
Open
@fanf2

Description

@fanf2

I have defined a tuple type like this:

type tuple3 = [ number, string, string ];

The translation I get (with or without --noExtraProps) is:

{
    "$schema": "http://json-schema.org/draft-06/schema#",
    "additionalItems": {
        "anyOf": [
            {
                "type": "number"
            },
            {
                "type": "string"
            },
            {
                "type": "string"
            }
        ]
    },
    "items": [
        {
            "type": "number"
        },
        {
            "type": "string"
        },
        {
            "type": "string"
        }
    ],
    "minItems": 3,
    "type": "array"
}

What I expect is no additionalItems, like this:

{
    "$schema": "http://json-schema.org/draft-06/schema#",
    "items": [
        {
            "type": "number"
        },
        {
            "type": "string"
        },
        {
            "type": "string"
        }
    ],
    "maxItems": 3,
    "minItems": 3,
    "type": "array"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions