swagger-api / swagger-api/swagger-codegen

[PHP] Use servers variables

Open
#11,082 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Trying to find out how to use the server variables in the generated client. The server section in the yaml is:

servers:
  - url: https://{environment}.relaypay.io/api/v1
    variables:
        environment:
          enum:
            - sandbox-api
            - api
          default: sandbox-api

Is there a way to specify the variables somehow in the generated PHP client?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by examining how the generated PHP client handles the OpenAPI servers section and its variables entry. Confirm whether the client can select sandbox-api or api for environment, and document or implement the supported way to specify that value.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.