Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why do we validate the server variables? There is no such limitation in OpenAPI 3 specification #380

Closed
xg1990 opened this issue Sep 30, 2020 · 0 comments · Fixed by #410 or #413
Closed

Comments

@xg1990
Copy link
Contributor

xg1990 commented Sep 30, 2020

Problem description

if we have a openapi 3.0 specification like this:

servers:
  - url: https://api.example.com/{basePath}
    description: Production server (uses live data)
    variables:
        basePath:
            default: "v1/path-a/path-b/pathC

It will report error that the basePath doesn't match the pattern "[^\/#\?]+?"

Discussion

This pattern check comes from the package path-to-regexp.

But I don't think we need such constrains. There is no such limitation in OpenAPI 3 specification

According to https://swagger.io/docs/specification/api-host-and-base-path/, it says:

Variables can have arbitrary values, or may be restricted to an enum.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment