swagger-api / swagger-api/swagger-codegen

[php][swagger3] post methodes don't generate parameters correctly

Open
#9,181 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

Description

The php client generator does not seem to generate some methods correctly.
From what I noticed it happens to mostly with some POST methods.
The required function parameter seems to generate without the separator. Same goes for some functioncalls with the function that also have broken parameters.
Broken Example (from v3.0.4)
Working Example (from v2.4.1)
Both examples were generated from the same revision of the swagger.json

Swagger-codegen version

v3.0.4 (possibly also v3.0.0-v3.0.3)

Swagger declaration file content or url

https://esi.evetech.net/latest/swagger.json

swagger json at time of generation
swagger.json.txt

Command line used for generation

java -jar swagger-codegen-cli-2.4.1.jar generate -i https://esi.evetech.net/latest/swagger.json?datasource=tranquility -l php --git-repo-id "esi-php-client" --git-user-id "jbs1" --release-note "<some commit message>"

Steps to reproduce

Generate with swagger v3 and the bug will be there.

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 with the generated lib/Api/CharacterApi.php broken and working examples linked in the issue, then reproduce generation from the provided swagger.json using the listed command. Compare POST method parameters and function calls between the outputs. Done means the generated PHP methods include the required separators and parameters correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.