Skip to content

Better handling for JSON schema composition of complex types #40

@CalebCourier

Description

@CalebCourier

Currently for any union or intersection keyword (allOf, anyOf, oneOf), we just spread the properties onto a single composite schema to prompt the user for input.

This approach is incorrect, particularly for oneOf.
Instead of spreading oneOf, we should present the subSchemas under it as variants that the user can choose from.

We may eventually need more nuanced handling of allOf and anyOf as well, but those lend themselves to a naive approach (spreading) more easily than oneOf because prompting the user for all sub-schema properties can be correct for those union types.

Originally posted by @zsimjee in #38 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions