description: FlowSync - Example 3

metadata:
  name: example 3
  version: 1.0.0

resources:
  testServer:
    type: Cybus::Server::Http
    properties:
      basePath: /FlowSync

  exampleNode:
    type: Cybus::Node::Http
    properties:
      parent: !ref testServer
      method: GET
      route: /example3
      operation: transaction

  exampleMappings:
    type: Cybus::Mapping
    properties:
      mappings:
        - subscribe:
            endpoint: !ref exampleNode
          publish:
            endpoint: !ref exampleNode
          rules:
            - transform:
                expression: >-
                  (
                    {
                      "id": $.id,
                      "timestamp": $.timestamp,
                      "error": {
                        "code": 500,
                        "message" : "This is an error message to your HTTP GET request."}
                    }
                  )
