Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alias types not getting referenced inside tuples #289

Open
HoldYourWaffle opened this issue May 31, 2019 · 0 comments
Open

Alias types not getting referenced inside tuples #289

HoldYourWaffle opened this issue May 31, 2019 · 0 comments

Comments

@HoldYourWaffle
Copy link
Contributor

Possibly related to #232.

/** @minLength 2 */
type Word = string;
type AliasedTupleType = [Word, Word];

Results in (modified for clarity):

{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "definitions": {
        "AliasedTupleType": {
            "additionalItems": {
				"this should be false": "but it isn't because of #208",
				"the maxItems constraint is also missing": "because of the same issue"
			},
            "items": [
                { "type": "string" },
                { "type": "string" }
            ],
			"minItems": 2,
            "type": "array"
        },
        "Word": {
            "minLength": 2,
            "type": "string"
        }
    }
}

I'd expect the items property of AliasedTupleType to be generated like this:

"items": [
	{ "$ref": "#/definitions/Word" },
	{ "$ref": "#/definitions/Word" }
],

Using --aliasRefs does not make any difference.
I'd love to create a PR for this myself but I have literally no idea where to start with this, so any pointers would be greatly appreciated 😄

This would also fix #283.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant