Skip to content

Problem with server url using variables with new routers #335

@riccardomanfrin

Description

@riccardomanfrin

Ciao,

I've updated to >0.50 (using gorilla mux), and it is not validating specs with this syntax because of the second url colon:

servers:
  - url: /
    description: devmode
  - url: '{protocol}://{server}/{prefix}/'
    description: production
    variables:
      protocol:
        enum:
          - 'http'
          - 'https'
        default: 'https'
        description: Protocol (http/https)
      server:
        default: 123z456789y0
        description: Server IP / Hostname
      prefix:
        default: ''
        description: Service platform prefix

Specifically this line is failing with this error:

 "first path segment in URL cannot contain colon"

Presumibly url.Parse is possibly not working when variables are included in the url path (since it's possibly not anymore a URL according to RFC).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions