Skip to content

Recursive reference #347

Closed
Closed
@Kludex

Description

@Kludex

Describe the bug

So... I have this:

class FolderChildren(BaseModel):
    """
    Folder schema to output from GET folders/{folder_id}/children method.
    """

    id: int
    name: str
    n_docs: int
    children: Optional[List["FolderChildren"]] = None

FolderChildren.update_forward_refs()

And the error is:

Warning(s) encountered while generating. Client was generated, but some pieces may be missing

WARNING parsing GET /api/v1/folders/{folder_id}/children/ within hierarchy.

Cannot parse response for status code 200, response will be ommitted from generated client

Reference(ref='#/components/schemas/FolderChildren')

Unable to parse this part of your OpenAPI document: 

invalid data in items of array children

Reference(ref='#/components/schemas/FolderChildren')

I believe the problem is the self-reference. Am I wrong?

Expected behavior
Not having the error message.

OpenAPI Spec File
Can't give you this.

Desktop (please complete the following information):

  • OS: Ubuntu 20.04
  • Python Version: 3.6.9
  • openapi-python-client version 0.8.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐞bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions