File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed
common/scala/src/main/scala/org/apache/openwhisk/core/entity
tests/src/test/scala/org/apache/openwhisk/core/entity/test Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -103,6 +103,8 @@ object ControllerInstanceId extends DefaultJsonProtocol {
103103 } else {
104104 deserializationError(" could not read ControllerInstanceId" )
105105 }
106+ case Seq (JsString (asString)) =>
107+ new ControllerInstanceId (asString)
106108 case _ =>
107109 deserializationError(" could not read ControllerInstanceId" )
108110 }
Original file line number Diff line number Diff line change @@ -46,6 +46,11 @@ class ControllerInstanceIdTests extends FlatSpec with Matchers {
4646 }
4747 }
4848
49+ it should " deserialize legacy ControllerInstanceId format" in {
50+ val i = ControllerInstanceId (" controller0" )
51+ ControllerInstanceId .parse(JsObject (" asString" -> JsString (" controller0" )).compactPrint) shouldBe Success (i)
52+ }
53+
4954 it should " serialize and deserialize ControllerInstanceId" in {
5055 val i = ControllerInstanceId (" controller0" )
5156 i.serialize shouldBe JsObject (" asString" -> JsString (i.asString), " instanceType" -> JsString (i.instanceType)).compactPrint
You can’t perform that action at this time.
0 commit comments