-
Notifications
You must be signed in to change notification settings - Fork 55
Open
Description
While creating Go TwiML examples for the docs, I noticed that the Prompt tag is not serialised to XML correctly. This is because the tag's for attribute is written incorrectly as for_.
For example, take the following, correct, XML:
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Pay>
<Prompt for="payment-card-number">
<Say>Please enter your 16 digit Visa or Mastercard number.</Say>
</Prompt>
</Pay>
</Response>For example, take the code below. We would reasonably expect it to generate the XML above:
package main
import (
"fmt"
"github.com/twilio/twilio-go/twiml"
)
func main() {
twiml, _ := twiml.Voice([]twiml.Element{
&twiml.VoicePay{
InnerElements: []twiml.Element{
&twiml.VoicePrompt{
For_: "payment-card-number",
InnerElements: []twiml.Element{
&twiml.VoiceSay{
Message: "Please enter your 16 digit Visa or Mastercard number.",
},
},
},
},
},
})
fmt.Print(twiml)
}Unfortunately, it won't, as you can see below:
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Pay>
<Prompt for_="payment-card-number">
<Say>Please enter your 16 digit Visa or Mastercard number.</Say>
</Prompt>
</Pay>
</Response>The serialisation process needs to be corrected to write the for attribute correctly.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels