Skip to content

parentheses ( ) not regex escaped #204

@leon-vg

Description

@leon-vg

I logged an issue in the Robot-Framework RESTinstance library, regarding an issue with parentheses ( ) in a swagger endpoint. asyrjasalo/RESTinstance#34

The issue is, in short, that an endpoint with parentheses cannot be found, while this is incorrect.

I tracked down the problem to the following file in this library: https://github.com/pipermerriam/flex/blob/master/flex/paths.py#L19

The problem seems to be resolved when I change the following code:

REGEX_REPLACEMENTS = (
    ('\.', '\.'),
    ('\{', '\{'),
    ('\}', '\}'),
)

to this:

REGEX_REPLACEMENTS = (
    ('\.', '\.'),
    ('\{', '\{'),
    ('\}', '\}'),
    ('\(', '\('),
    ('\)', '\)'),
)

I am not a python developer, otherwise I would have submitted a PR. I hope a more experienced developer can check if this change is appropriate and realize this change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions