Skip to content
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

Missing request body definition for updating the configuration of a Twilio Flex instance #36

Open
RJPearson94 opened this issue May 28, 2021 · 6 comments
Labels
status: work in progress Twilio or the community is in the process of implementing type: twilio enhancement feature request on Twilio's roadmap

Comments

@RJPearson94
Copy link

RJPearson94 commented May 28, 2021

Issue Summary

First of all, great work on the OpenAPI definitions. They're super handy to have when building against the APIs.

When looking at the OpenAPI definition for the Twilio Flex API, I noticed there was no definition/ schema for the request body to describe the request payload which needs to be supplied to update the configuration of a Twilio Flex Instance (OperationId: UpdateConfiguration, path: /v1/configuration, HTTP method: post). This can be seen in the YAML OpenAPI template

I have searched through the Twilio API docs and I found out the request body needs to be JSON, as seen here however the documentation doesn't specify all the properties which can be modified and the data types for each of the properties.

Is it possible to get the request body added to the OpenAPI definitions for UpdateConfiguration?

Steps to Reproduce

N/A

Code Snippet

/v1/Configuration:
  description: Configuration for a Flex instance
  get:
    ...
  post:
    description: ''
    operationId: UpdateConfiguration
    responses:
      '200':
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/flex.v1.configuration'
        description: OK
    security:
    - accountSid_authToken: []
    x-maturity:
    - GA
  ...

Exception/Log

N/A

Technical details:

  • twilio-oai version: 1.16.0
  • open version:
@JenniferMah
Copy link
Contributor

Hi @RJPearson94 thanks for opening an issue! This is also related to the request in issue #49. 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.

@JenniferMah JenniferMah added the type: twilio enhancement feature request on Twilio's roadmap label Jun 3, 2021
RJPearson94 added a commit to RJPearson94/twilio-oai-generator that referenced this issue Jun 10, 2021
…JSON media type for the request body

The Go Generator has been updated to add a vendor extension to set `x-is-json` to true when the consume media type is `application/json` and `x-is-form` when the consumes media type is `application/x-www-form-urlencoded`

The `x-is-json` vendor extension is used to generate the code to handle calling the new PostJson function or the corresponding HTTP method function on the request handler. This is designed to only work with Post requests at the moment but could be extended in the future if needed.

This PR aids in resolving twilio#49 however once this PR is merged twilio/twilio-oai#36 will need to be finished to fully resolve the issue

This change relies on twilio/twilio-go#83 and the tests cannot be updated until this PR is merged and released

This change also fixes an issue with JSON struct tags for the Params structs being `html-escaped`. I have disabled the escaping by using `{{{}}}` as this was highlighted during linting the Go SDK repo
RJPearson94 added a commit to RJPearson94/twilio-oai-generator that referenced this issue Jul 9, 2021
…JSON media type for the request body

The Go Generator has been updated to add a vendor extension to set `x-is-json` to true when the consume media type is `application/json` and `x-is-form` when the consumes media type is `application/x-www-form-urlencoded`

The `x-is-json` vendor extension is used to generate the code to handle calling the new PostJson function or the corresponding HTTP method function on the request handler. This is designed to only work with Post requests at the moment but could be extended in the future if needed.

This PR aids in resolving twilio#49 however once this PR is merged twilio/twilio-oai#36 will need to be finished to fully resolve the issue

This change relies on twilio/twilio-go#83 and the tests cannot be updated until this PR is merged and released

This change also fixes an issue with JSON struct tags for the Params structs being `html-escaped`. I have disabled the escaping by using `{{{}}}` as this was highlighted during linting the Go SDK repo
RJPearson94 added a commit to RJPearson94/twilio-oai-generator that referenced this issue Jul 9, 2021
…JSON media type for the request body

The Go Generator has been updated to add a vendor extension to set `x-is-json` to true when the consume media type is `application/json` and `x-is-form` when the consumes media type is `application/x-www-form-urlencoded`

The `x-is-json` vendor extension is used to generate the code to handle calling the new PostJson function or the corresponding HTTP method function on the request handler. This is designed to only work with Post requests at the moment but could be extended in the future if needed.

This PR aids in resolving twilio#49 however once this PR is merged twilio/twilio-oai#36 will need to be finished to fully resolve the issue

This change relies on twilio/twilio-go#83 and the tests cannot be updated until this PR is merged and released

This change also fixes an issue with JSON struct tags for the Params structs being `html-escaped`. I have disabled the escaping by using `{{{}}}` as this was highlighted during linting the Go SDK repo
@thinkingserious thinkingserious added the status: work in progress Twilio or the community is in the process of implementing label Jul 10, 2021
@thinkingserious
Copy link
Contributor

Hello @RJPearson94,

I'm working on getting this un-blocked internally. Thanks again for reporting this!

@RJPearson94
Copy link
Author

Thanks for the update @thinkingserious

@rnairtwilio
Copy link

Hi @RJPearson94, thanks for bringing this issue to our notice.
Could you tell us more about the use cases you are building on Flex and what functionalities you plan to use from the helper libraries?

@thinkingserious
Copy link
Contributor

Internal Tracking: FLEXADMIN-1839

@RJPearson94
Copy link
Author

Hi @rnairtwilio,

Apologies for the slow response.

I previously worked for an ISV in the UK which was using Twilio Flex to develop a contact centre solution for our clients that used AI to enhance the customer experience, help agents and contact centres deliver a better customer experience and gain insight into why customers were reaching out to the contact centre. The solution used a range of Twilio services and some 3rd party integrations. As an ISV, we needed to manage multiple Flex instances for internal use and clients, so being able to script/ automate this was quite important.

After departing the company and during the covid lockdown in the UK, I started developing my own Go SDK and Terraform provider to manage the lifecycle of Flex and other Twilio services. Adding the ability to update a Flex instance configuration via the helper libraries would allow me to include the helper libraries in other tools or scripts to automate more of the setup/ configuration of Flex using official/ supported tools and libraries.
If possible, I would like to see support for additional Flex resources e.g. Flex Plugins, IAM/ SSO configuration for Flex (not sure if this is possible via the public API) as part of the OpenAPI documents for Flex and helper libraries too. This would allow for further automation of a Flex instance and supporting resources. If you want to track these as separate issues, then let me know.

I appreciate this is a niche use case however if there are no plans to include these Flex resources within the helper libraries, would it be possible to have the resources included in the OpenAPI documents for Flex regardless? As this documentation could still help the community when building against the Flex API

If you want to know more I am also on the Twilio forums (same username), so feel free to send me a DM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: work in progress Twilio or the community is in the process of implementing type: twilio enhancement feature request on Twilio's roadmap
Projects
None yet
Development

No branches or pull requests

4 participants