You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2019/08/20 06:50:35 UTC

[GitHub] [openwhisk] chetanmeh commented on a change in pull request #4559: Allow parameters to be designated as init time properties

chetanmeh commented on a change in pull request #4559: Allow parameters to be designated as init time properties
URL: https://github.com/apache/openwhisk/pull/4559#discussion_r315514326
 
 

 ##########
 File path: common/scala/src/main/scala/org/apache/openwhisk/core/entity/Parameter.scala
 ##########
 @@ -230,10 +254,14 @@ protected[core] object Parameters extends ArgNormalizer[Parameters] {
      */
     def read(params: Vector[JsValue]) = Try {
       new Parameters(params map {
-        _.asJsObject.getFields("key", "value") match {
+        _.asJsObject.getFields("key", "value", "init") match {
           case Seq(JsString(k), v: JsValue) =>
             val key = new ParameterName(k)
-            val value = new ParameterValue(v)
+            val value = new ParameterValue(v, false)
+            (key, value)
+          case Seq(JsString(k), v: JsValue, JsBoolean(i)) =>
+            val key = new ParameterName(k)
+            val value = new ParameterValue(v, i)
 
 Review comment:
   Nit `ParameterValue` being case class now the `new` can be dropped

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services