You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Action parameters specified in the inputs array are not visible through the WSK CLI while parameters specified in the annotations.parameters array are visible.
Expected behaviour
How the inputs and annotations.parameters arrays work should be documented and the tests should reflect this.
Details
I am trying to specify action parameters in the manifest so that those parameters are visible when you run wsk package get <package> --summary. Reading through the wskdeploy tests suggests that this should be done usign the inputs field so I created this manifest:
packages:
hello:
version: 0.0.1license: ISCactions:
hello:
function: hello.jsruntime: 'nodejs:10'inputs:
name:
type: stringdescription: name of a personplace:
type: stringdescription: location of a person
However, when I deploy this and get the package summary, I get none defined (queried via the ibmcloud CLI):
Looking through the cloudant package install script, it uses annotations and parameters instead so I created a different manifest:
packages:
hello:
version: 0.0.1license: ISCactions:
hello:
function: hello.jsruntime: 'nodejs:10'annotations:
description: Generate a simple greeting messageparameters:
- name: namerequired: falsedescription: the name of a person
- name: placerequired: falsedescription: location of a person
When deployed, the parameters for the action are now documented:
the first form allows you to specify the value of inputs in a deployment manifest,
the second form allows you to specify details of inputs as annotations for documentation purposes.
If this is correct, both forms should be included in the tests and documented. From the perspective of developers writing manifests, having two forms is confusing, especially when they overlap but don't quite do the same thing. It would be a lot easier if all parameter details, including type, value and description, where defined in the same block in the manifest, for the tool to work out how to deploy it.
For completeness, here is the code for hello.js:
functionmain(params){constname=params.name||'World';constplace=params.place||'Space';return{message: `Hello ${name} in ${place}!`}}
The text was updated successfully, but these errors were encountered:
Addendum: when I use the inputs structure and I create an API that calls the function, I get this error when calling the API with curl, suggesting that the inputs structure marks the parameters to reserved properties that the API gateway can't set:
{
"code": "61b04fe092db97ce4f223069a4b0e0b3",
"error": "Request defines parameters that are not allowed (e.g., reserved properties)."
}
Issue
Action parameters specified in the
inputs
array are not visible through the WSK CLI while parameters specified in theannotations.parameters
array are visible.Expected behaviour
How the
inputs
andannotations.parameters
arrays work should be documented and the tests should reflect this.Details
I am trying to specify action parameters in the manifest so that those parameters are visible when you run
wsk package get <package> --summary
. Reading through the wskdeploy tests suggests that this should be done usign theinputs
field so I created this manifest:However, when I deploy this and get the package summary, I get
none defined
(queried via theibmcloud
CLI):Looking through the cloudant package install script, it uses
annotations
andparameters
instead so I created a different manifest:When deployed, the parameters for the action are now documented:
I therefore assume that:
If this is correct, both forms should be included in the tests and documented. From the perspective of developers writing manifests, having two forms is confusing, especially when they overlap but don't quite do the same thing. It would be a lot easier if all parameter details, including type, value and description, where defined in the same block in the manifest, for the tool to work out how to deploy it.
For completeness, here is the code for
hello.js
:The text was updated successfully, but these errors were encountered: