This repository was archived by the owner on Dec 4, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
libraries/bot-builder/src/main/java/com/microsoft/bot/builder Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33
44package com .microsoft .bot .builder ;
55
6- import com .fasterxml .jackson .databind .JsonNode ;
76import com .microsoft .bot .connector .Async ;
87import java .net .HttpURLConnection ;
98import java .util .List ;
@@ -702,17 +701,7 @@ private AdaptiveCardInvokeValue getAdaptiveCardInvokeValue(Activity activity) th
702701 throw new InvokeResponseException (HttpURLConnection .HTTP_BAD_REQUEST , response );
703702 }
704703
705- Object obj = activity .getValue ();
706- JsonNode node = null ;
707- if (obj instanceof JsonNode ) {
708- node = (JsonNode ) obj ;
709- } else {
710- AdaptiveCardInvokeResponse response = createAdaptiveCardInvokeErrorResponse (
711- HttpURLConnection .HTTP_BAD_REQUEST , "BadRequest" , "Value property instanceof not properly formed" );
712- throw new InvokeResponseException (HttpURLConnection .HTTP_BAD_REQUEST , response );
713- }
714-
715- AdaptiveCardInvokeValue invokeValue = Serialization .treeToValue (node , AdaptiveCardInvokeValue .class );
704+ AdaptiveCardInvokeValue invokeValue = Serialization .getAs (activity .getValue (), AdaptiveCardInvokeValue .class );
716705 if (invokeValue == null ) {
717706 AdaptiveCardInvokeResponse response = createAdaptiveCardInvokeErrorResponse (
718707 HttpURLConnection .HTTP_BAD_REQUEST , "BadRequest" , "Value property instanceof not properly formed" );
You can’t perform that action at this time.
0 commit comments