-
Notifications
You must be signed in to change notification settings - Fork 1k
make RouteEntry._parse_view_args to respect greedy path variables #140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I'm interested to hear how you'd plan on using this in chalice. I'm not opposed to the change, but I'm not really sure how helpful this is for chalice. Would others find this useful? Feel free to chime in with use cases. |
Here is a quote from the documentation page I gave link to at the beginning:
This is just a new and useful API Gateway feature which needs to be supported in Chalice. @app.route('/objects/{keyPath+}', methods=['GET', 'PUT'])
def myobject(keyPath):
keyPath = keyPath.split('/')
# ... This code would be accepted by the deployer, and the proper API Gateway resource tree would be created successfully in AWS cloud. |
Sorry, I don't think I explained what I was looking for very well. I'm familiar with the feature and what it does, what I'm curious about is how people plan on using it in chalice. The common use case I've seen for this feature is to make integration with pre-existing frameworks. That is, if your framework already handles routing for you, you just need a catch-all greedy route that can be passed to your framework. This feature is perfect for that. Given chalice doesn't use that, and is using API gateway to handle the routing, I'm trying to envision how people would like to use this functionality in chalice. I'm trying to keep the feature set small, so I generally ask for each feature that's added to chalice to have a rationale for why it should be included (if it's not clear to me). If you (or anyone else) could give a few concrete use cases of how this feature would be helpful to you, that would be sufficient for me. Does that seem reasonable? |
Ah you know what, your last example is a good use case (I missed that earlier). If I want to have a view that takes an S3 key as part of the uri, I'd need to use a greedy path. That seems like a pretty reasonable thing to do in chalice. Thanks for your patience on this. I'm going to just add a few tests for this PR and then merge. |
@jamesls Do you need help with unittests? |
That'd be also lovely to catch 404 pages, sigh... |
Any updates regarding the {proxy+} support? |
I don't know why it should take so long to simply merge this very primitive and straightforward bugfix into the main repo. I myself gave up on this Chalice framework long time ago. |
I found the default Zappa performance worse than Chalice's... But the greedy path here would be Awesome !!! |
Hey sorry, just wanted to give an update here. I have no issues with this feature, but I wanted to give a list of things we'll need before this can get merged:
If someone would like to take a stab at this let me know. Otherwise I have this on my backlog but I don't have an exact timeframe. |
I got my own code to write.. but as far as I can assist, btw, I started using chalice from version 0.6.0 and stopped upgrading at 0.7.0 after I figured out the missing deployed.json file, because > 0.8.0 stopped serving unicode on my localhost and my pc doesn't have a CloudFront to send the safe base64 to, but back to the issue.. for the route so... I think you should simply document it 👍 |
@jamesls, any updates on how greedy path variables can be used with chalice? |
@freaker2k7 is your code sample able to handle a route like |
The is a relatively new feature described here: In addition to
/some/path/{tail}
route format there may be/some/path/{tail+}
resource declarations in API Gateway now.And this short patch teaches
Chalice
how to deal with them.