[More Detail] [Collapse All]
Feature: Pass row of input parameters in body record

Operation '/customer(post)' inputs 'Customer' record in
body. Customer record defines array of sub-record 'Address'.
features/045-pass-input-parameters/010-body-rows.feature
- Background:
link
features/045-pass-input-parameters/010-body-rows.feature:9
Given I use a fixture named "fixture-resolver"
# ------------------------------------------------------------------
# Swagger configuration
And YAML configuration file `cnf/interface_customer.yaml` in path `paths./customer.post`
      operationId: postCustomer
      parameters:
        - name: customer
          in: body
          description: Customers to enter
          required: true
          schema:
              $ref: '#/definitions/Customer'
      responses:
         200:
            description: OK
And YAML configuration file `cnf/interface_customer.yaml` in path `definitions.Customer`
#
# Customer with a number of addresses

         properties:
           id:
              type: string
           name:
              type: string
           addresses:
              type: array
              items:
                  $ref: '#/definitions/Address'
And YAML configuration file `cnf/interface_customer.yaml` in path `definitions.Address`
         properties:
           street:
            type: string
           city:
            type: string
# Swagger configuration
# ------------------------------------------------------------------
And YAML configuration file `cnf/sbuilder.yaml`
#
# 'setups' section defines a setup 'demo' 

setups:
- setupDirectory: setup1
  extensions:
      -  url: cnf/extend_setup1.yaml
And a file named "cnf/extend_setup1.yaml" with:
# Setup1:
#
# Setup1:
# - set cardinality for domain 'dommi'
# - lauch /customer(get)
#
- domain-extension:
     - domain: dommi
       cardinality: 3

- step-extension:
       - interface: /customer(post)
         bindExact: true
         input:
           customer:
               id: 1
               _default: 1
               name: 2
               addresses:
                 - street: 1
                   city: 2
                 - street: 3
                   city: 2
And YAML configuration file `cnf/sbuilder.yaml`
#
# 'resolvers' section loads resolvers from file
# 'cnf/resolver_customer.yaml'

resolvers:
    - url: cnf/resolver.yaml
And a file named "cnf/resolver.yaml" with:
# default resolver with one regexp rule
-    Name: default-relsolver
     Matcher: !ruby/regexp /.*/
     Rules: 
      - Matcher: !ruby/regexp /.*/
        Domain: dommi
- Scenario: Default resolvers with two rules.
link
features/045-pass-input-parameters/010-body-rows.feature:120
When I generate TLA+ model setup `setup1`
And I do PLC transformation for setup `setup1`
And I run TLC for setup `setup1`
And I can observe operation `/customer(post)` called on time tick `0`
And I can observe domain assignement:
Field Domain
id "d_dommi_1"
name "d_dommi_2"
street "d_dommi_1"
street "d_dommi_3"
city "d_dommi_2"