-
-
Notifications
You must be signed in to change notification settings - Fork 360
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
Support for HTTP API #602 #604
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, this looks really great! (I have added quite a few of inline comments, but these are mostly details, the whole PR looks really good!)
As for the tests, yes, this is a tricky one. Let me have a look at what's best 🤔
Regarding the tests, here is what I noted:
I have pushed a new commit to your pull request to start adding tests in |
Ace, thanks so much for your help on those tests -- i'll have a proper look through it once i've made the other code changes and got them committed. |
Awesome thanks! |
RE tests @mnapoli , the Bref\Test\Handler\FpmHandlerTest doesn't have the 'version' set on any of the data it's testing ... do you have a preferred approach ... default to v1 in the HttpRequestEvent or just add in the 'version' to each of the tests? (not sure if you wanted to keep the tests small or not). I'll finish tackling the v2 JSON files tomorrow -- i'm almost done :) |
Regarding |
At first look that sounds really good. The build seems to be failing, but we are definitely on the right track. |
Ace!
Hope that helps -- not quite sure on what approach to take for those two. |
- the query string encoding should not make any practical difference, because both encoding are semantically identical - the multi-value header seems unfortunately like an issue we cannot solve in v2, because all values are flatten in a string with a `,` as a separator: splitting that string again is prone to mistakes, because commas can appear in header values (see https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html); I have asked for confirmation from AWS, we'll see
OK @victormacko I think we are good here! |
Thank you so much for all that work, that is massive. Time to try that! |
I've added in support for HTTP v2.0 payloads primarily to have Bref give a "works out of the box" experience when linking Lambda with the new HTTP API via the AWS Console, rather than having to switch back to 1.0 in the integrations section in the console.
Also - i'm pretty keen to start using the new API Gateway HTTP option so hopefully this helps getting Bref one more step closer to it :) ... this should also help with issue #602
I'd started looking at the tests to add but was wanting some guidance on it first -- I think the best approach is to add another FpmHandlerTest class for the v2 payloads as most of the test-cases are probably going to be worth testing...
The changes i've made cover;
The unit-tests all pass, but they haven't as yet been updated to test for the v2 payloads -- need some guidance (as above) on this before spending time on getting that sorted.