-
Notifications
You must be signed in to change notification settings - Fork 47
pyramid_openapi3 messes up routes when the server prefix matches #146
Copy link
Copy link
Open
Description
openapi.yaml:
servers:
- url: /v
paths:
/version:
get:
...
pyramid config:
config.add_route("version", "/version")
(along with this config to deal with the prefix on the server)
[filter:paste_prefix]
use = egg:PasteDeploy#prefix
prefix = /v
This code
pyramid_openapi3/pyramid_openapi3/__init__.py
Lines 371 to 377 in 2904c34
| def remove_prefixes(path): | |
| path = f"/{path}" if not path.startswith("/") else path | |
| for prefix in prefixes: | |
| if path.startswith(prefix): | |
| prefix_length = len(prefix) | |
| return path[prefix_length:] | |
| return path |
Will remove the /v from /version and then complain that route "/version" is missing even though it is clearly present in the code. Are prefixes ever part of the route that they need to be removed?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels