Skip to content

Add support for root arrays and unions - #100

Merged
mikee47 merged 2 commits into
developfrom
feature/root-array-union
Aug 12, 2026
Merged

Add support for root arrays and unions#100
mikee47 merged 2 commits into
developfrom
feature/root-array-union

Conversation

@mikee47

@mikee47 mikee47 commented Aug 12, 2026

Copy link
Copy Markdown
Owner

Currently a root object must either be an object, or empty for definition-only schemas.
This PR enables support for both array and union types.

Worked examples are included in the tests module.

Arrays:

{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "type": "array",
    "items": { ...
    }
}

Unions:

{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "oneOf": [ ...
    ]
}

Note that schema may not contain both oneOf and type properties. This is now checked during code generation.

@mikee47
mikee47 force-pushed the feature/root-array-union branch from c69d3ba to 770af90 Compare August 12, 2026 13:17
@mikee47
mikee47 merged commit b2cdfbe into develop Aug 12, 2026
18 checks passed
@mikee47
mikee47 deleted the feature/root-array-union branch August 12, 2026 13:48
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