Attach `x-pyramid-route-name` to request type rather than path
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 55/100
Research direction
Start by tracing the x-pyramid-route-name handling from openapi.yaml into the request method configuration and compare it with the @view_config() examples in handler.py. Review server.py and its add_routes usage to understand the current workaround. Done means each request method can specify its own route name without requiring separate add_routes calls.
Written by the indexing model from the issue text.
Description
I have a simple code example like this:
# openapi.yaml
/path/site/user:
get:
operationId: getUser
....
post:
operationId: addUser
....
put:
operationId: editUser
....
These each link to an @view_config() decorator akin to:
# handler.py
@view_config(
route_name='getUser',
request_method='GET',
...
)
def get_user():
and so on for the other two handler functions
This structure means I cannot use x-pyramid-route-name as this variable is at the same level as the request types
Solution:
If x-pyramid-route-name can be moved within the request type field, I could have something like:
# openapi.yaml
/path/site/user:
get:
x-pyramid-route-name: getUser
operationId: getUser
....
post:
x-pyramid-route-name: addUser
operationId: addUser
....
put:
x-pyramid-route-name: editUser
operationId: editUser
....
Is there currently a way to do what I am trying to do (without having to add potentially hundreds of add_routes in my server.py)?
If not, please consider this change
- Dominant language
- Python
- Stars
- 84
- Forks
- 46
- Avg merge
- 5d 20h
- Merged PRs (30d)
- 3
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Pylons/pyramid_openapi3
-
dependencies
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Pylons/pyramid_openapi3#327 · 1 comment ·
-
Pylons/pyramid_openapi3#319 · 1 comment · 1 assignee ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
Pylons/pyramid_openapi3#194 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
Pylons/pyramid_openapi3#192 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 32/100
Pylons/pyramid_openapi3#178 · 2 comments ·
All issues in Pylons/pyramid_openapi3
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
bancolombia/sentinel#23 ·
-
test md OpenCI
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
bug client
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100