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
I have a simple code example like this:
These each link to an
@view_config()decorator akin to:and so on for the other two handler functions
This structure means I cannot use
x-pyramid-route-nameas this variable is at the same level as the request typesSolution:
If
x-pyramid-route-namecan be moved within the request type field, I could have something like:Is there currently a way to do what I am trying to do (without having to add potentially hundreds of
add_routesin myserver.py)?If not, please consider this change