mountPath for middleware is not supporting array or regex

Open
#576 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript
Domain
cli, tooling

Research direction

Start with the UI5 CLI configuration validation that reports Configuration server/customMiddleware/1/mountPath, using the provided ui5.yaml middleware example to reproduce the failure. Check how mountPath is validated and verify that the requested array and regex forms are accepted without the current type error.

Written by the indexing model from the issue text.

Description

Expected Behavior

Support arrays for mountPath just like express does

Current Behavior

It's not supported

Steps to Reproduce the Issue

  1. add middleware with array definition for mountPath
    - name: ui5-middleware-simpleproxy
      afterMiddleware: ui5-middleware-stringreplacer
      mountPath:
        - '/ci/'
        - '/v2/'
        - '/sf/'

Context

  • UI5 Module Version (output of ui5 --version when using the CLI): 2.13
  • Node.js Version: 14
  • npm Version: 8.1

Log Output / Stack Trace

Configuration server/customMiddleware/1/mountPath must be of type 'string'

/home/pieter/projects/xxx/app/ui5.yaml:17

15:     - name: ui5-middleware-simpleproxy
16:       afterMiddleware: compression
17:       mountPath:
Dominant language
JavaScript
Stars
511
Forks
83
Avg merge
1d 5h
Merged PRs (30d)
55

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from UI5/cli

All issues in UI5/cli

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.