Skip to content
This repository was archived by the owner on Sep 14, 2022. It is now read-only.
This repository was archived by the owner on Sep 14, 2022. It is now read-only.

Paths in the cache are overwritten when filtering by pathPart #91

Description

@baltendo

Hi!
I have a problem when I want to filter my APIs by path.

/swagger.json?path=/rest/api/users
/swagger.json?path=/rest/api/persons

After I restart the application I can access the "users" api and I can use it in swagger-ui.
When I then use another api like "persons" I don't see anything in swagger-ui.
When I switch back to the "users" api I don't see anything in swagger-ui.
When I restart the application I can see the first used API again.
The problem why I don't see anything in swagger-ui is because the paths field is empty.

I debugged the problem a bit and I think the problem is in ApiHelpController.getApiListing:
clone.setPaths(clone.getPaths.filterKeys(_.startsWith(pathPart) ))

Here the existing paths are filtered and set to the clone.
When I access the "users" api I see that all 20 paths are filtered and 10 paths are left.
When I then access the "persons" api I see that the 10 paths are filtered and 0 paths are left.
So instead of changing a clone the cache is changed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions