Skip to content

Support allOf in response schemas #98

Closed

Description

@dtkav

Is your feature request related to a problem? Please describe.
I attempted to generate a client from one of my OpenAPI specs, and allOf and oneOf keywords are not yet supported

Describe the solution you'd like
oneOf should create a union type of the objects.
allOf should create a type with all of the objects subfields.

Additional context
FYI, we've implemented allOf support in our fork here:
benchling/openapi-python-client@2670d11
benchling/openapi-python-client@9f5b95a (bugfix)

I will try to open a PR if I can find some free time 😅 , otherwise feel free to pull in whatever you find useful!

Activity

  1. dbanty commented on Aug 19, 2020

    @dbanty
    Collaborator

    Will add support for oneOf in 0.5.4, allOf is definitely trickier and will happen in a future version.

  2. dtkav commented on Sep 23, 2020

    @dtkav
    ContributorAuthor

    FYI, we've implemented allOf support in our fork here:
    benchling@2670d11
    benchling@9f5b95a (bugfix)

    I will try to open a PR if I can find some free time 😅 , otherwise feel free to pull in whatever you find useful!

  3. changed the title [-]Support allOf, oneOf[/-] [+]Support allOf, ~oneOf~[/+] on Sep 23, 2020
  4. changed the title [-]Support allOf, ~oneOf~[/-] [+]Support allOf in response schemas[/+] on Sep 23, 2020
  5. heiqs commented on Mar 12, 2021

    @heiqs

    With the latest version, the default value for enum fields is not used.
    my_field: Union[Unset, None] = UNSET rather than
    my_field: Union[My_Enum, None] = My_Enum.DEFAULT

    Also I see some strange Enum creation like the following:

    M_Y_E_N_U_M_T_Y_P_1 = "model_a" instead of MYENUMTYP1 = "model_a"

  6. dbanty commented on Mar 23, 2021

    @dbanty
    Collaborator

    This should be solved in 0.9.0 (releasing soon)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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