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

Heterogeneous Arrays(Tuples) #22

Open
alpaylan opened this issue Nov 17, 2024 · 0 comments
Open

Heterogeneous Arrays(Tuples) #22

alpaylan opened this issue Nov 17, 2024 · 0 comments

Comments

@alpaylan
Copy link

Hi,

In some cases, I tend to deal with heterogenous arrays that are used more as tuples in my use case.

{
    "a": [
        {"b": 1},
        {"c": 2},
        {"d": 3}
    ]
}

jtd-infer works great with such a case, producing
{"properties":{"a":{"elements":{"optionalProperties":{"b":{"type":"uint8"},"c":{"type":"uint8"},"d":{"type":"uint8"}}}}}}

but when I make one of the elements of the tuple another array

{
    "a": [
        {"b": 1},
        [1, 2],
        {"d": 3}
    ]
}

I get a blank for the entire array

{"properties":{"a":{"elements":{}}}}

Is that the expected behavior? Would you be open to changing it?

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