express-openapi-validator icon indicating copy to clipboard operation
express-openapi-validator copied to clipboard

Server variables without enum don't get validated

Open yoelkohn opened this issue 2 years ago • 0 comments

Describe the bug If server variable is defined, with a default but no enum, per OpenAPI docs, it should allow any arbitrary value. This implementation, however, will create an enum array with the default value as its sole element, and ignore any value that doesn't match the default.

To Reproduce Create spec with

servers:
    -   url: /api/v0.1/t/{variableName}
        variables:
          variableName:
            default: blocked

then navigate to /api/v0.1/t/notBlocked

Actual behavior Path is completely ignored

Expected behavior Path should be validated

yoelkohn avatar Jan 18 '24 06:01 yoelkohn