-
Notifications
You must be signed in to change notification settings - Fork 22
feat: update generator to support making a JSON POST request from the Go SDK #54
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
base: main
Are you sure you want to change the base?
Conversation
|
SDK changes twilio/twilio-go#84 |
|
The PR job is failing due to dockerhub rate limits |
|
Hello @RJPearson94! This PR has come up for review, could you please resolve the merge conflicts? Thank you!! Also, there are merge conflicts for twilio/twilio-go#84 and twilio/twilio-go#83. Thank you and apologies for the delayed response. |
…JSON media type for the request body The Go Generator has been updated to add a vendor extension to set `x-is-json` to true when the consume media type is `application/json` and `x-is-form` when the consumes media type is `application/x-www-form-urlencoded` The `x-is-json` vendor extension is used to generate the code to handle calling the new PostJson function or the corresponding HTTP method function on the request handler. This is designed to only work with Post requests at the moment but could be extended in the future if needed. This PR aids in resolving twilio#49 however once this PR is merged twilio/twilio-oai#36 will need to be finished to fully resolve the issue This change relies on twilio/twilio-go#83 and the tests cannot be updated until this PR is merged and released This change also fixes an issue with JSON struct tags for the Params structs being `html-escaped`. I have disabled the escaping by using `{{{}}}` as this was highlighted during linting the Go SDK repo
f6d46b3 to
25cbb8b
Compare
|
Hey @thinkingserious, Thanks for getting back to me and no need to apologise for the delay, I appreciate you taking the time to look at these. All 3 PR's have now been updated to resolve any merge conflicts. |
The Go Generator has been updated to add a vendor extension to set
x-is-jsonto true when the consumes media type isapplication/jsonandx-is-formwhen the consumes media type isapplication/x-www-form-urlencodedThe
x-is-jsonvendor extension is used to generate the code to handle calling the new PostJson function or the corresponding HTTP method function on the request handler. This is designed to only work with Post requests at the moment but the request handler could be extended in the future if needed.This PR aids in resolving #49 however once this PR is merged twilio/twilio-oai#36 will need to be finished to fully resolve the issue
This change relies on twilio/twilio-go#83 and the tests cannot be updated until this PR is merged and released
This change also fixes an issue with JSON struct tags for the Params structs being
html-escaped. I have disabled the escaping by using{{{ }}}as this was highlighted during linting the Go SDK repoChecklist
make test-dockerpython examples/build_twilio_go.py path/to/twilio-oai/spec/yaml path/to/twilio-goand inspect the diffmake testintwilio-gotwilio-goIf you have questions, please create a GitHub Issue in this repository.