Skip to content

List or object usage in runtime expressions embedded in strings #437

@DmitryAnansky

Description

@DmitryAnansky

What/Why/How?

HI All,
I’ve noticed that the expected behavior for runtime expression evaluation, particularly when dealing with lists or objects, is not clearly defined.
Technically, it is possible to produce a Step output in the following form:

    steps:
      - stepId: get-products
        operationId: listOfProducts
        outputs:
          products: $response.body#/items

Lets consider that response items is a list of objects:

[
   {
       "name": "item1",
       "id": 0
   },
   {
       ...
   },
]

It is also possible to use the Step output as runtime expressions embedded in string,
like in some specification examples:

  contentType: application/xml
  payload: |
    <order>
      <items>{$steps.get-products.outputs.products}</items>
    </order>
  contentType: application/x-www-form-urlencoded
  payload: 
    products: {$steps.get-products.outputs.products}

How should we interpret the expression in case when it is a list / list of objects / object ?
Should it be stringified value, or should we throw an error in this case?

Reference

Might be related to #424

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions