-
Notifications
You must be signed in to change notification settings - Fork 507
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
TypeScript typed statusCallbackEvent writes invalid attribute value #497
Comments
A related observation is that |
For the second issue, this is by-design and the docs are here: https://www.twilio.com/docs/voice/twiml#callstatus-values For the first issue, looks like in JS we're expecting the parameter to be a space-delimited string (see the example here), but in TS we're expecting an array of So, the JS code needs to be updated to serialize the parameter into a space-delimited list. Given that this exists in generated code, the best way to resolve is to submit a PR with very limited scope that illustrates how such cases should be handled. Using that as a template, we can then update the generator to use the new pattern. A PR and +1s on the issue summary will help it move up the backlog. |
Possible (un-tested) implementation:
|
Something along the lines of this is also another possibility:
This at least fixes my current case, and would probably be a good option if no atrributes exist which are Arrays and should be comma separated. |
Ahhh. If that does indeed work, I LIKE IT! I don't know of any arrays which are supposed to be comma-separated. Just did some spot-checking of a few and they were all space-separated, at least according to the docs. |
Here's the documentation of those hooks: https://github.com/oozcitak/xmlbuilder-js/wiki/Value-Conversion |
And |
As can be seen from the example code and its output below,
statusCallbackEvent
attribute ends up having wrong delimiter, comma instead of space, in the resulting XML, and this causes error on Twilio side.Version: 3.37.0
Code Snippet (main.ts)
Output
The text was updated successfully, but these errors were encountered: