Skip to content

Support discriminator inference for oneOf with a nested sum type #1013

@dan-j

Description

@dan-j

Description

Given the following schema in the attached gist, implement discriminator inference on the root type where the nested oneOf contains another sum type (in this case, another oneOf)

https://gist.github.com/dan-j/6aa4e236e1e335f5ca6cfe5e62f32ecf

At the moment the library only allows Struct types to be inferred, and we call s.JSON().Fields() to detect which fields are common/unique.

I believe this issue could be solved by collecting common fields of all possible elements of the CreateThing type, instead of simply calling s.JSON().Fields() within schema_gen_sum.go.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions