Skip to content

Handle allOf(integer, number) correctly - #1101

Open
TvdW wants to merge 1 commit into
oxidecomputer:mainfrom
TvdW:allof-number-integer
Open

TvdW wants to merge 1 commit into
oxidecomputer:mainfrom
TvdW:allof-number-integer

Conversation

@TvdW

@TvdW TvdW commented Nov 9, 2026

Copy link
Copy Markdown

A generated jsonschema I tried to use with typify contained an allOf:[integer,number], which typify thinks makes for an impossible intersection. However, the actual jsonschema says that integer is a subset of number, therefore allOf(integer, number) should be equal to integer.

@TvdW TvdW changed the title allOf: Fix number and integer type intersections Handle allOf(integer, number) correctly Nov 9, 2026
A generated jsonschema I tried to use with typify contained an
`allOf:[integer,number]`, which typify thinks makes for an impossible
intersection. However, the actual jsonschema says that `integer` is a
subset of `number`, therefore `allOf(integer, number)` should be equal
to `integer`.
@TvdW
TvdW force-pushed the allof-number-integer branch from e64fa1b to 74358f0 Compare November 9, 2026 22:41
@TvdW

TvdW commented Nov 9, 2026 •

Copy link
Copy Markdown
Author

Context: a cue type n: int64 & >=2 can be exported into a jsonschema and then loaded into typify. The generated jsonschema then contains

"allOf": [
    {
        "minimum": 2
    },
    {
        "type": "integer",
        "maximum": 9223372036854775807,
        "minimum": -9223372036854775808
    }
]

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

Successfully merging this pull request may close these issues.

1 participant