twilio / twilio-oai

The Twilio OpenAPI Specification
MIT License
127 stars 81 forks source link

Support Encoding Object #43

Open puug opened 3 years ago

puug commented 3 years ago

Issue Summary

As part of the 3.0.1 OpenAPI spec there's the ability to give further information about the behaviour of individual properties https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.1.md#encoding-object

This is useful for crafting requests and mocking services to more accurately replicate the live services and SDKs.

I've been looking into the notify arena so my examples are from there

Steps to Reproduce

  1. Import the notify spec into https://editor.swagger.io/
  2. Craft a notification request POST /v1​/Services​/{ServiceSid}​/Notifications with multiple Identities
  3. Resulting payload looks like Identity=string1,string2
  4. Edit the spec to have
            encoding:
              Identity:
                style: form
  5. The payload now looks like Identity=string1&Identity=string2 (this matches how Twilio Java SDK crafts the request)

This is one simple example, but there's many other properties that could benefit from this treatment, (ie objects encoded in application/json) which would help with other services like prism when they also support encoding - see https://github.com/stoplightio/prism/issues/1622

twilio-dx commented 3 years ago

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.

shwetha-manvinkurke commented 3 years ago

@puug Thanks for the suggestion. This issue has been added to our internal backlog to be prioritized. Pull requests and +1s on the issue summary will help it move up the backlog.