Typeform/js-api-client

Choice interface doesn't match API results

Opened this issue · 0 comments

Description

Response.answers.choice.other was removed in 1.12.1. However, if you have a Multiple Choice with Multiple selection disabled and "Other" option enabled, the API still returns in the structure:

"choice": { "id": "other", "other": "foo bar" }

Expected Behavior

I would expect the API's interfaces allow a developer to collect answer.choice.other if the API returns that structure.

Possible Solution

Could add other field to Choice interface.

Steps to Reproduce

With a Multiple Choice answer with Multiple selection disabled and "Other" option enabled, it was previously read by using answer.choice.other but this no longer compiles.

Your Environment

  • Client Version: 1.12.1 thru at least 1.15.2