Skip to content

Feature Request: Servers Swagger Property to support variables In tsoa.json (Tsoa Config) #1760

@eaglexboy

Description

@eaglexboy

Sorting

  • I'm submitting a ...

    • bug report
    • feature request
    • support request
  • I confirm that I

    • used the search to make sure that a similar issue hasn't already been submit

Expected Behavior

enhanced server definitions to support server variables

Detailed Description

I would like to be able to use server variables in tsoa.json. I saw that #909 was requesting that server object be supported. I would like to add to the request to also have it support server variables as well.

I would like that if I add the following to tsoa.json

{
  "spec":{
    "servers": [
      {
        "url": "http://localhost:3000",
      },
      {
        "url": "https://{environment}.api.server.com",
        "variables": {
          "environment": {
            "default": "dev",
            "enum": ["dev", "test", "preprod", "prod"]
          }
        }
      }
    ],
  }
}

it would produce

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions