-
Notifications
You must be signed in to change notification settings - Fork 335
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Try fallback to "value" and "displayName" when building connector sug…
…gestions API response (#2635) Address the schema and actual response misalignment issue especially for Teams Connector. **Context**: In Teams connector, the suggestions API "GetMessageLocations" is declared as below: ```ts // dynamic schema "x-ms-dynamic-values": { "operationId": "GetMessageLocations", "value-path": "id", "value-title": "displayName", "value-collection": "value", "parameters": { "messageType": "ParentMessage", "poster": { "parameter": "poster" } } } // response type { "type": "object", "properties": { "locations": { "type": "array", "items": { "type": "object" }, "description": "valid locations to post a message or reply, make verbose" } } } ``` It's a historical issue (PAuto supports weak type and consumes this format) that the actual response format ("value" and "displayName") is misaligned with the expected format ("id" and "displayName"). Then it caused the MCS suggestions API returning empty result. **Proposed solution**: Fallback to accept "value" and "displayName" when building the suggestion response if the value accessed by "value-path" or "value-title" is empty. (This approached was proved to work in MCS but since some version update there was a regression.)
- Loading branch information
Showing
5 changed files
with
91 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/tests/Microsoft.PowerFx.Connectors.Tests.Shared/Responses/Teams_GetMessageLocations.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"value": [ | ||
{ | ||
"value": "Channel", | ||
"displayName": "Channel" | ||
}, | ||
{ | ||
"value": "Group chat", | ||
"displayName": "Group chat" | ||
}, | ||
{ | ||
"value": "Chat with Flow bot", | ||
"displayName": "Chat with Flow bot" | ||
} | ||
] | ||
} |