openwhisk-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [openwhisk] chetanmeh commented on a change in pull request #4559: Allow parameters to be designated as init time properties
Date Tue, 20 Aug 2019 06:50:35 GMT
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

Mime
View raw message