Skip to content

Processing a self-referencing subResource leads to a series of recursive scans #1424

@elakito

Description

@elakito

The problem is described here.
https://groups.google.com/forum/#!topic/swagger-swaggersocket/v_VTJgMm3PM

I'll attach a PR with a proposed solution which caches classes at the Reader instance.

Alternatively, a slightly more complex solution would be to create a private read method that looks like the current recursively invoked read method but with an extra argument of a map that can be used to detect the self-referencing loop during its recursive calls. The original read method can call this private read method with an empty map object.

Which one to take depends on how the reader is used and how its expected behavior should be.
And I would like to ask for your feedback.

regards, aki

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions