Skip to content
This repository has been archived by the owner on Jun 27, 2020. It is now read-only.

Nested TwiML can be retroactively modified. #40

Open
jmatth opened this issue Jul 11, 2014 · 1 comment
Open

Nested TwiML can be retroactively modified. #40

jmatth opened this issue Jul 11, 2014 · 1 comment
Labels

Comments

@jmatth
Copy link
Collaborator

jmatth commented Jul 11, 2014

The few TwiML verbs that take nested interfaces currently take struct pointers, which makes it possible to do something like this:

inner := new(twiml.DialTwiml)
inner.Number(NumberOpts{} "123")
response.Dial(DialOpts{}, inner)
inner.Sip(SipOpts{}, "sip:something")

The rendered TwiML would then have the sip directive in there. This is probably not expected behavior, and also makes implementing caching on the Render method rather difficult.

@natebrennand
Copy link
Owner

the cache flag could be in all the inner structs and then we set it accordingly?

alternatively make a very explicit warning and provide both a Render() and ForceRender() methods, the latter for ignoring the cache

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants