Skip to content

Trailing Slash in basePath and leading slash in route path leads to double slash in URL #65

@gshackles

Description

@gshackles

Description

When the Swagger input has a basePath with a trailing slash, and a path with a leading slash, the resulting concatenated URL will end up with two slashes. While this is what was technically specified in the input, it's a good chance to be a little more flexible and remove one of the slashes from the resulting URL.

Repro steps

Use a Swagger input that looks something like:

{
  "host": "api.host.com",
  "basePath": "/",
  "paths": {
    "/v0.1/user": {

Expected behavior

The URL would be https://api.host.com//v0.1/user

Actual behavior

The URL would be https://api.host.com/v0.1/user

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