[More Detail] [Collapse All]
Feature: Pass input in body record (using sub-record)

Pass input in body record.
features/045-pass-input-parameters/005-body-record.feature
- Background:
link

Operation '/customer(post)' inputs 'Customer' record in
body. Customer record defines sub-records 'Address'.
features/045-pass-input-parameters/005-body-record.feature:6
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`
         properties:
           id:
            type: string
           type:
            type: string
           name:
            type: string
           address:
              $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 'setup1' 

setups:
- setupDirectory: setup1
  extensions:
      -  url: cnf/extend_setup1.yaml
And a file named "cnf/extend_setup1.yaml" with:
# Setup1:

# - call /customer(post), all fields in 'customer'
#   records have default value 1.
#
- step-extension:
       - interface: /customer(post)
         input:
           customer:
               _default: 1
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
# --> all fields are mapped to domain 'dommi'
-    Name: default-relsolver
     Matcher: !ruby/regexp /.*/
     Rules: 
      - Matcher: !ruby/regexp /.*/
        Domain: dommi
- Scenario: Call /customer(post) with query parmeters
link
features/045-pass-input-parameters/005-body-record.feature:106
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_1"
street "d_dommi_1"
city "d_dommi_1"