You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The OAI specification for twilio API seems to be incorrect, or at least the nodejs implementation of twilio api may have an inconsistency. https://github.com/twilio/twilio-oai/blob/main/spec/yaml/twilio_api_v2010.yaml#L17395 - should be nullable to be consistent with the typings for twilio api. the OAI specification requires messagingServiceSid whereas the api does not. The same goes for statusCallback; it should be nullable to be consistent with twilio api.
Steps to Reproduce
install latest version of twilio via npm
npm install -g prism-cli
run prism mock https://github.com/twilio/twilio-oai/blob/main/spec/yaml/twilio_api_v2010.yaml
create a custom http client
Code Snippet
importtwiliofrom'twilio';classPrismHttpClientextendsRequestClient{request<TData>(opts: RequestClient.RequestOptions<TData>): Promise<Response<TData>>{opts.uri=opts.uri.replace(/^https:\/\/.*?\.twilio\.com/,'http://127.0.0.1:4010');// note: default prism port is 4010, so change if neededreturnsuper.request(opts);}}
Then...
constopts={httpClient: newPrismHttpClient()};constclient=smsClient(sid,token,opts);constresponse=awaitclient.messages.create({body: text,
from,
to,statusCallback: 'http://localhost:9000/status'// any url where twilio should post message status - this should be nullable also but it is not according to the twilio oai});
Then run that code.
Exception/Log
[5:49:29 PM] › [VALIDATOR] ⚠ warning Request did not pass the validation rules
[5:49:29 PM] › [VALIDATOR] ✖ error Request body property MessagingServiceSid must NOT have fewer than 34 characters
[5:49:29 PM] › [VALIDATOR] ✖ error Request body property MessagingServiceSid must match pattern "^MG[0-9a-fA-F]{32}$"
[5:49:29 PM] › [HTTP SERVER] post /2010-04-01/Accounts/AC6d4932eed0ae3cf5d9af4f071965be8f/Messages.json ✖ error Request terminated with error: https://stoplight.io/prism/errors#UNPROCESSABLE_ENTITY: Invalid request
Technical details:
twilio-oai version: latest
twilio version: 4.11.1
open version:
The text was updated successfully, but these errors were encountered:
Ahoy! Thank you for opening your first issue here! If this request is regarding troubleshooting your application, please reach out to the support team via https://support.twilio.com.
Issue Summary
The OAI specification for twilio API seems to be incorrect, or at least the nodejs implementation of twilio api may have an inconsistency. https://github.com/twilio/twilio-oai/blob/main/spec/yaml/twilio_api_v2010.yaml#L17395 - should be nullable to be consistent with the typings for twilio api. the OAI specification requires messagingServiceSid whereas the api does not. The same goes for statusCallback; it should be nullable to be consistent with twilio api.
Steps to Reproduce
prism mock https://github.com/twilio/twilio-oai/blob/main/spec/yaml/twilio_api_v2010.yaml
Code Snippet
Then...
Then run that code.
Exception/Log
Technical details:
The text was updated successfully, but these errors were encountered: