Skip to content

Multiple fittings with parameters in a pipe #28

@enorm

Description

@enorm

Hi,

I want to define multiple fittings with parameters in a single pipe.

This works (multiple fittings without parameters):

    # pipe to serve swagger (endpoint is in swagger.yaml)
    swagger_raw:
      - swagger_raw
      - another_fitting

This also works (one fitting with parameters):

    # pipe to serve swagger (endpoint is in swagger.yaml)
    swagger_raw:
      name: swagger_raw
      filter: "^(?!x--.*)"
      privateTags:
        - x-swagger-router-controller
        - x-swagger-pipe

This does not work (array syntax):

    # pipe to serve swagger (endpoint is in swagger.yaml)
    swagger_raw:
      - name: swagger_raw
        filter: "^(?!x--.*)"
        privateTags:
          - x-swagger-router-controller
          - x-swagger-pipe

Error message:

Error: Pipe not found: ^(?!x--.*)
    at Bagpipes.getPipe (/.../node_modules/bagpipes/lib/bagpipes.js:46:11)
    at /.../node_modules/bagpipes/lib/fittings/parallel.js:20:30
    at /.../node_modules/lodash/index.js:3073:15
    at baseForOwn (/.../node_modules/lodash/index.js:2046:14)
    at /.../node_modules/lodash/index.js:3043:18
    at Function.<anonymous> (/.../node_modules/lodash/index.js:3346:13)
    at parallel (/.../node_modules/bagpipes/lib/fittings/parallel.js:18:7)
    at Runner.<anonymous> (/.../node_modules/bagpipes/lib/bagpipes.js:171:7)
    at bound (domain.js:280:14)
    at Runner.runBound (domain.js:293:12)

What I want to do actually:

    # pipe to serve swagger (endpoint is in swagger.yaml)
    swagger_raw:
      - name: swagger_raw
        filter: "^(?!x--.*)"
        privateTags:
          - x-swagger-router-controller
          - x-swagger-pipe
      - name: another_fitting

So, what is the correct syntax to add multiple fittings with parameters to a single pipe?

Best regards,
Norman

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